Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 490154

Summary: [pull up] changes method visibility when unneeded
Product: [Eclipse Project] JDT Reporter: leokom leokom <lrozenblyum>
Component: UIAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.5.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description leokom leokom CLA 2016-03-22 04:36:18 EDT
SCENARIO:

Let's have 4 classes Parent <- Child1 <- Child2 <- Child3
Parent, Child1 are in package1
Child2, Child3 are in package2

package package1;

public class Parent {
protected void doSmth() {

}
}

package package1;

public class Child1 extends Parent {
}


package package2;

import package1.Child1;

class Child2 extends Child1 {


}


package package2;

class Child3 extends Child2 {
	private void inC() {
		doSmth();
	}

}

Being in Child3#inC Refactor -> Pull up
Select package2.Child2 as target (usually it's preselected already)

Execute the refactoring

EXPECTED:
1) No warning 'The visibility of method 'package1.Parent.doSmth()' will be changed to public.
2) No actual change to public of this method. It will be still accessible via protected modifier.

ACTUALLY:
Warning exists.
protected doSmth() changed to public doSmth() unnecessarily

The issue is similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=399350
but doesn't depend on overriding a parent's method.
Comment 1 Eclipse Genie CLA 2019-03-20 14:49:44 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.