Project: JDT
Bug 193969 [move static members] Uncompilable class after Moving Members
Reported: 2007-06-22 08:26:44 | Status: resolved fixed

Build ID: M20070212-1330 Steps To Reproduce: 1. Open the project contained in the jar file. 2. Select I1 and I2 in class BugMoveMember via the PackageExplorer and refactor -> Move. Type "NewType" as destination. 3. Class NewType become un-compilable because of import problems and uncorred extends for inner interface I2. More information: The probleme is located in "isMovedMember(IBinding binding)" in class MoveStaticMemberAnalyzer. A possible solution is : protected boolean isMovedMember(IBinding binding) { if (binding == null) return false; for (IBinding element : fMembers) { // Bug if (binding.getKind() == IBinding.TYPE) { ITypeBinding tBinding = (ITypeBinding) binding; ITypeBinding raw = tBinding.getErasure(); if (raw.isEqualTo(element)) { return true; } } // if (Bindings.equals(element, binding)) return true; } return false; }

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test62/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test62/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test62/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test62/out/B.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveMembersTests.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveStaticMemberAnalyzer.java