Community
Participate
Working Groups
I explain my problem with a little piece of code. If you have this example code: class NonnaPapera { } class Paperino extends NonnaPapera { } public class TestRefactor { public static void main(String[] args) { Paperino paperino = new Paperino(); NonnaPapera nonnaPapera = ( NonnaPapera )paperino; } } I have refactored the name of class NonnaPapera in Pippo and Eclipse trasform the code in this way: class Pippo { } class Paperino extends Pippo { } public class TestRefactor { public static void main(String[] args) { Paperino paperino = new Paperino(); Pippo nonnaPapera = ( NPippo)paperino; } } As you can see the line Pippo nonnaPapera = ( NPippo)paperino; is WRONG!!! insted of Pippo nonnaPapera = ( Pippo )paperino;
The problem exists also without use cast.. for example I try this method public static void test( String aLongNameParameter ) { String c = ( aLongNameParameter ); } If you change the name from aLongNameParameter to pippo you have this results: public static void test( String pippo ) { String c = (pippor ); }
great find Daniele, thanks i added test cases for affected refactorings: Rename Type, Rename Local, Inline Local Variable they will be enabled as soon as the culprit (bug 22939) is fixed.
one more bug (bug 23329) makes this not work yet
fixed
*** Bug 24125 has been marked as a duplicate of this bug. ***