Bug 316828 - [push down] pushing down a method enables field hiding
Summary: [push down] pushing down a method enables field hiding
Status: CLOSED DUPLICATE of bug 211755
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-14 16:55 EDT by Gustavo Soares CLA
Modified: 2010-06-15 15:56 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 2010-06-14 16:55:22 EDT
Build Identifier: 20090920-1017

Apply the push down method refactoring to a method leads to a behavioral change due to field hiding.

Reproducible: Always

Steps to Reproduce:
1. Create the classes:

public class A {
  public int k = 10;
  public int m() {
    return k;
  }
}
public class B extends A {
  public int k = 20;
  public int test() {
    return m();
  }
}

2. the method test returns 10.
2. Apply the push down refactoring to m():

public class A {
  public int k = 10;
}
public class B extends A {
  public int k = 20;
  public int m() {
    return k;
  }
  public int test() {
    return m();
  }
}


3. After the refactoring, the method test returns 20.
Comment 1 Deepak Azad CLA 2010-06-15 15:56:14 EDT

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