| Summary: | [refactoring] Refactoring for moving a role class doesn't handle base imports | ||
|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> |
| Component: | OTDT | Assignee: | Stephan Herrmann <stephan.herrmann> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 1.4 | ||
| Target Milestone: | 2.1 M5 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | trac | ||
| Bug Depends on: | |||
| Bug Blocks: | 356003 | ||
|
Description
Stephan Herrmann
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. |