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: M20090211-1700 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 with a different signature. Reproducible: Always Steps to Reproduce: 1. Create the classes: 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 super.k(2);} } public class C extends B { public static void main(String[] args) { C c = new C(); System.out.println(c.m()); } } 2. This program prints 79. Apply a push down method refactoring on m(). The program will be transformed: public class A { public int k(long i) {return 79;} } public class B extends A { public int k(int i) {return 83; } } public class C extends B { public static void main(String[] args) { C c = new C(); System.out.println(c.m()); } public int m() {return super.k(2);} } 3. Note that After the refactoring, the "super.k(2);" invocation is to the method "int m(int i)" instead of "int m(long i)". the behavior of the program changes, now, it will be printed 83
Can reproduce in I20091020-0931. Same problem like in bug 234981 but a but more complext. *** This bug has been marked as a duplicate of bug 234981 ***
*** Bug 355322 has been marked as a duplicate of this bug. ***