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

Bug 486692

Summary: [add parameter] A behavior preserving transformation (Add Parameter Refactoring) is rejected
Product: [Eclipse Project] JDT Reporter: Melina Mongiovi <melmongiovi>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug

Description Melina Mongiovi CLA 2016-01-27 20:37:43 EST
Steps to Reproduce:
1. Create the following program

package Package_1;
public class ClassId_2 {
  protected long methodid_0(){
    return 0;
  }
}
package Package_1;
public class ClassId_0 extends ClassId_2 {
}
package Package_0;
import Package_1.*;
public class ClassId_1 extends ClassId_0 {
  protected long methodid_0(){
    return 1;
  }
  public long m_0(){
    return new ClassId_1().methodid_0();
  }
}



2. Apply the add parameter refactoring to add a parameter of type int in the method Package_0.ClassId_1.methodid_0.

3. The tool does not apply the transformation and warns the following message:
The selected method overrides method in declared type

4. Another refactoring tool applies the same transformation and the resulting program (the program below) preserves behavior.

package Package_0;
import Package_1.*;
public class ClassId_1 extends ClassId_0 {
  protected long methodid_0(int i){
    return 1;
  }
  public long m_0(){
    return new ClassId_1().methodid_0(0);
  }
}

package Package_1;
public class ClassId_0 extends ClassId_2 {
}

package Package_1;
public class ClassId_2 {
  protected long methodid_0(int i){
    return 0;
  }
}
Comment 1 Eclipse Genie CLA 2018-09-22 09:52:09 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.