Bug 399181 - [Rename method] Strong precondition: type in its hierarchy defines a method with the same number of parameters and same parameter type names
Summary: [Rename method] Strong precondition: type in its hierarchy defines a method w...
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Mac OS X
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-26 17:33 EST by Gustavo Soares CLA
Modified: 2016-09-23 08:12 EDT (History)
2 users (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-26 17:33:22 EST
Step 1: Create the class.

package p1;
public class A {
  private long n(  int a){
    return 38;
  }
  public long test(){
    return n(2);
  }
}

package p2;
import p1.*;
public class B extends A {
  protected long k(  int a){
    return 58;
  }
}

package p2;
import p1.*;
public class C extends A {
}

Step 2: apply the rename method to rename n to k. Eclipse will show a warning: Type in its hierarchy defines a method with the same number of parameters and same parameter type names. 

In spite of the warning, the behavior of this program would be preserved after the transformation. This precondition seems to be too strong.
Comment 1 Stephan Herrmann CLA 2013-01-27 08:38:14 EST
Moving to JDT/UI
Comment 2 Stephan Herrmann CLA 2013-01-27 08:41:07 EST
*** Bug 399182 has been marked as a duplicate of this bug. ***
Comment 3 Markus Keller CLA 2013-01-28 08:30:36 EST
I20130122-0800 doesn't show a message in this case.
Comment 4 Gustavo Soares CLA 2016-09-23 08:12:15 EDT
(In reply to Markus Keller from comment #3)
> I20130122-0800 doesn't show a message in this case.

I have tried to apply this same refactoring using Eclipse 4.6 and it still shows this message.