| Summary: | [push down] pushing down a method enables field hiding | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Gustavo Soares <gsoares> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | deepakazad |
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 211755 *** |
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.