Bug 399347 - [Push Down Method] Strong precondition: Eclipse shows an incorrect warning
Summary: [Push Down Method] Strong precondition: Eclipse shows an incorrect warning
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-28 21:12 EST by Gustavo Soares CLA
Modified: 2022-05-20 14:04 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Soares CLA 2013-01-28 21:12:48 EST
Eclipse says that will change the access modifier to public but does not change. 

package p1;
public class A{
  protected long k(int a){
    return 83;
  }
  protected long k(long a){
    return 68;
  }
}
package p1;
public class B extends A{
  public long m(){
    return super.k(2);
  }
}
package p2;
import p1.*;
public class C extends B {
}


Step 2: apply the push down method to the method m(). Eclipse will show a warning:  The visibility of method 'p1.A.k(int)' will be changed to public. If we press 'continue', Eclipse moves the method to the super class but does not change the visibility of p1.A.k(int). The code still compiles after the change. It seems that the warning was not needed. Or Eclipse should have changed the access modifier of the method.
Comment 1 Noopur Gupta CLA 2013-02-05 06:37:17 EST
Tested with Build ID: I20130204-1400.
The bug is reproducible.
Comment 2 Eclipse Genie CLA 2020-05-28 18:12:52 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.
Comment 3 Eclipse Genie CLA 2022-05-20 14:04:31 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.