Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362380 - [organize imports] "Organize Imports" at the project level fails to identify type-qualified references to nested interfaces of classes.
Summary: [organize imports] "Organize Imports" at the project level fails to identify ...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-28 22:01 EDT by Byron Hawkins CLA
Modified: 2011-11-23 05:39 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Byron Hawkins CLA 2011-10-28 22:01:10 EDT
Build Identifier: M20110909-1335

Executing the "Organize Imports" feature with a project selected in the Package Explorer will not recognize a type-qualified interface reference when the enclosing type of that interface is not itself an interface. The same is true for classes, enums and annotations--when the enclosing type differs in this way, the "Organize Imports" feature will not find the nested types when executed at the project level. Opening each file and executing "Organize Imports" does work (but is extremely tedious with hundreds of sources!)

Reproducible: Always

Steps to Reproduce:
1. Declare an annotation A inside a class C.
2. Annotate a type in an third, separate class using the type-qualified name "C.A"
3. Change the name of the annotation A, or move class C to a different package without updating references (indeed, sometimes it cannot be done).
4. Select the project containing all mentioned sources and execute "Organize Imports". 

The import for the annotation A will simply be removed. It should be replaced with an updated import statement.
Comment 1 Remy Suen CLA 2011-10-28 22:08:15 EDT
Java tooling bugs go to JDT.
Comment 2 Deepak Azad CLA 2011-11-15 07:16:30 EST
I cannot reproduce this, can you please provide code snippets with which you see this problem?
Comment 3 Deepak Azad CLA 2011-11-23 05:39:49 EST
Please feel free to reopen with exact steps and code snippets.