| Summary: | [reorg] Move Compilation unit with reference to inner type causes invalid imports | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Andrew Eisenberg <andrew.eisenberg> | ||||
| Component: | Core | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | markus.kell.r, satyam.kandula | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | Macintosh | ||||||
| OS: | Mac OS X | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
|
Description
Andrew Eisenberg
Created attachment 198505 [details]
Project referred to in description
It looks like one problem is that the method org.eclipse.jdt.internal.corext.refactoring.reorg.MoveCuUpdateCreator.getDestinationPackageTypes() calls getAllTypes instead of getTypes. Simply changing the method call would likely solve the first problem described in the description (ie- the erroneous removal of the inner class import). The second problem (the erroneous addition of the outer import) is likely caused by the method org.eclipse.jdt.internal.corext.refactoring.structure.ReferenceFinderUtil.getTypeReferencesIn(IJavaElement, WorkingCopyOwner, IProgressMonitor) erroneously including outer types as a reference. The fix for this is a little more nuanced. Let me check if I can see something easily. It looks like org.eclipse.jdt.internal.core.search.matching.TypeReferenceLocator.reportDeclaration(ReferenceBinding, int, MatchLocator, SimpleSet) is reporting a match for a particular type, and then also reporting a match for all of its enclosing types. In this particular situation, this is the wrong behavior. Perhaps there can be a flag passed into TypeReferenceLocator that can toggle implicitly matching on enclosing types. Moving to JDT/UI as this should be better handled there 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. |