Community
Participate
Working Groups
Build Identifier: M20110909-1335 Test case: public class A { int foo() { int r = 42; // extract this line return r; } public static void main(String[] args) { System.out.println(new B().foo()); } } class B extends A { public int m() { return 23; } } This program prints 42. Extracting the indicated line into a new method m yields the following program, which prints 23: public class A { int foo() { int r = m(); return r; } public int m() { int r = 42; return r; } public static void main(String[] args) { System.out.println(new B().foo()); } } class B extends A { public int m() { return 23; } } The problem is that the extracted method is overridden in B, so the extracted call m() resolves to B.m instead of the extracted method A.m on objects of class B. Reproducible: Always Steps to Reproduce: See above.
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.