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

Bug 434878

Summary: [pull up] Pull Up a field enables field hiding
Product: [Eclipse Project] JDT Reporter: Melina Mongiovi <melmongiovi>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: manju656
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Melina Mongiovi CLA 2014-05-14 12:10:06 EDT
Program's behavior changes after pulling up a field. 



Reproducible: Always

Steps to Reproduce:
1. Create the classes


package p1;
public class A {
  protected int f = 10;
}

package p1;
public class B extends A {
  public long m() {
    return f;
  }
}
package p1;
public class C extends B {
  private int f = 11;
}

2. Apply the pull up field refactoring (pll up the field f from C to B)

package p1;
public class A {
  protected int f = 10;
}

package p1;
public class B extends A {
  private int f = 11;
  public long m() {
    return f;
  }
}
package p1;
public class C extends B {
}

3. After the transformation, the ”m” method returns 11 instead of 10.
Comment 1 Martin Mathew CLA 2014-05-14 23:48:19 EDT
As mentioned in bug 234980, program semantics is changed after the pull up refactoring.

*** This bug has been marked as a duplicate of bug 234980 ***