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

Bug 355327

Summary: [pull up] disables field hiding
Product: [Eclipse Project] JDT Reporter: Gustavo Soares <gsoares>
Component: UIAssignee: Kenneth Styrberg <kenneth>
Status: VERIFIED FIXED QA Contact: Roland Grunberg <rgrunber>
Severity: normal    
Priority: P3 CC: melmongiovi, raksha.vasisht, rgrunber
Version: 3.6.1   
Target Milestone: 4.14 M3   
Hardware: PC   
OS: All   
See Also: https://git.eclipse.org/r/149285
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=2cc97af8e2df9241efdf5220325e2f1663e50314
Whiteboard:

Description Gustavo Soares CLA 2011-08-21 18:12:52 EDT
Build Identifier: 20110615-0604

Pulling up a field disables field hiding changing program behavior. 

Reproducible: Always

Steps to Reproduce:
1. Create the classes
public class A {
}
public class B extends A {
  public int k = 1;
}
public class C extends B {
  public int k = 2;
  public long test() {
    return k;
  }    
}
2. The test method returns 2. Apply the pull up field to B.k:
public class A {
  public int k = 1;
}
public class B extends A {   
}
public class C extends B {
  public long test() {
    return k;
  }    
}
3. After the transformation, the test method returns 1
Comment 1 Raksha Vasisht CLA 2011-10-24 13:54:56 EDT
(In reply to comment #0)
> 2. The test method returns 2. Apply the pull up field to B.k:
> public class A {
>   public int k = 1;
> }
> public class B extends A {   
> }
> public class C extends B {
>   public long test() {
>     return k;
>   }    
> }

Should not remove C.k. Happens with 3.8 build I20111021-0800 on win7.
Comment 2 Noopur Gupta CLA 2015-08-05 08:22:17 EDT
*** Bug 471951 has been marked as a duplicate of this bug. ***
Comment 3 Eclipse Genie CLA 2019-09-10 13:36:42 EDT
New Gerrit change created: https://git.eclipse.org/r/149285
Comment 5 Kenneth Styrberg CLA 2019-11-01 10:54:30 EDT
Verified with eclipse-SDK-I20191101-0300-win32-x86_64
Comment 6 Roland Grunberg CLA 2019-11-20 12:26:48 EST
Thanks Kenneth for testing. In the future, make sure to do this with an I-build during the quiet week, and set the status to VERIFIED (FIXED) afterwards.

Verified for 4.14 M3 using I20191120-0840 build.