Community
Participate
Working Groups
(originally from http://trac.objectteams.org/ot/ticket/227) (observed by Robert Wloch) The Move ... refactoring correctly moves a role class to another team. But if the role is bound to a base-imported class: the existing base import in the source team is not removed the created import statement in the target team misses the base modifier. (comment:1 by jogeb) At least the refactoring finds the existing base import in the source team, but the ImportRewrite doesn't handle the change correctly and creates an empty MultiTextEdit (line 1068) => no changes
Similar effects happen when renaming a package. Again base imports are not updated accordingly.
Adding a new test class MoveRoleTests to reproduce. (Test is a team for access to various private features of org.eclipse.jdt.ui.tests.refactoring.ccp.MoveTest). Fix comes in two steps (adding / removing): Adding: A new role in ReorgAdaptor hooks into org.eclipse.jdt.internal.corext.refactoring.structure.ImportRewriteUtil: a new nested team BaseImporting is activated during addImports(..). This new team records when ImportReferencesCollector finds a type reference inside a playedBy clause, passing this information to the existing BaseImportRewriting engine. Removing: Adapt org.eclipse.jdt.core.dom.rewrite.ImportRewrite.removeEntry(String) similar to addEntry(String).
Released for 2.1M5 via commit 1437f3b477d90032b1ab3c67a691de78ab0aeee2
(In reply to comment #1) > Similar effects happen when renaming a package. > Again base imports are not updated accordingly. Filed bug 382185 for an issue along these lines. The problem in this bug has been fixed as verified for 2.1 using build 201206090452.