Community
Participate
Working Groups
Steps to reproduce (Build id: 20121114-2344): 1. See instructions in code below 2. The resulting code does not compile ("Type mismatch: cannot convert from movemethod.id1.a.T to movemethod.id1.b.T") package movemethod.id1.a; public class T { } package movemethod.id1.b; public @interface T { } package movemethod.id1; import movemethod.id1.a.T; public class C1 { // INVOKE "Move" REFACTORING ON METHOD "m1" AND SELECT "C2" AS THE DESTINATION public static T m1() { return new movemethod.id1.a.T(); // *** } } package movemethod.id1; import movemethod.id1.b.T; public class C2 { @T public void m2() { } } Note that the problem may not be noticed immediately if the line *** is replaced with "return null" and the same steps are performed. In this case the resulting type of the method is modified, which should not be the case. Somehow related to bug 71761.?
Issue is reproducible using I20121210-0800. The refactoring results in compiler error.
The bug is that org.eclipse.jdt.internal.corext.refactoring.structure.MoveStaticMembersProcessor#getUpdatedMemberSource(RefactoringStatus, BodyDeclaration[], ITypeBinding) calls ImportRewriteUtil.addImports(..., new HashMap<Name, String>(), ...) The HashMaps actually do collect references that need to be rewritten, but this call just neglects the necessary updates.
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.