Community
Participate
Working Groups
User-Agent: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.9.0.14) Gecko/2009090216 Ubuntu/9.04 (jaunty) Firefox/3.0.14 GTB5 Build Identifier: 20090619-0625 When a push down method refactoring is applied on a method "m", and there is a method invocation to a method of the superclass inside "m". The method invocation changes to a method of the subclass. Reproducible: Always Steps to Reproduce: 1. Create the classes: public class A { public int k(long i) { return 79;} public int m() { return k(2);} } public class B extends A{ public int k(int i) { return 83;} public static void main(String[] args) { B b = new B(); System.out.println(b.m()); } } 2. This program prints 79. Apply a push down method on m(): public class A { public int k(long i) { return 79;} } public class B extends A{ public int k(int i) { return 83;} public int m() { return k(2);} public static void main(String[] args) { B b = new B(); System.out.println(b.m()); } } 3. The behavior of the program changes. Now, the program prints 83.
See also bug 234981.
*** This bug has been marked as a duplicate of bug 211860 ***