Bug 6978 - Organize Imports
Summary: Organize Imports
Status: CLOSED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-15 22:17 EST by Vijay Aravamudhan CLA
Modified: 2008-01-09 19:42 EST (History)
0 users

See Also:


Attachments
Example that you asked for (17.37 KB, text/plain)
2002-01-12 02:21 EST, Vijay Aravamudhan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vijay Aravamudhan CLA 2001-12-15 22:17:09 EST
First, let me congratulate the team on a job well done!

I am not sure if this is a bug or not, but...
I have a class which extends DefaultTableCellEditor. When I do "Organize 
imports", it adds the following line
<code>
import javax.swing.DefaultCellEditor.EditorDelegate;
</code>
Should the internal class be part of the import?
I am not sure, but if I keep the import statement intact, I get a compile error.

I hope you can fix this in the next release.
Thanks
Vijay
Comment 1 DJ Houghton CLA 2001-12-16 02:15:02 EST
Moving to JDT/Core.
Comment 2 Martin Aeschlimann CLA 2001-12-17 08:24:33 EST
there must be a reference to EditorDelegate.
Is a inner class of yours named like that? 
I would be glad if you can send me a code snippet so I can see whats the 
problem.
A know bug is that if a field or local has a name of a class, a unnecessary 
import is added. 
Comment 3 Martin Aeschlimann CLA 2002-01-11 12:24:29 EST
can you provide me with an example?
Comment 4 Vijay Aravamudhan CLA 2002-01-12 02:21:18 EST
Created attachment 220 [details]
Example that you asked for
Comment 5 Martin Aeschlimann CLA 2002-01-14 08:16:35 EST
Thanks a lot. I investigated the matter.
In 20109, when I try this, organize import prompts to specify 
if 'EditorDelegate' is 
  vijay.TextCellEditor.EditorDelegate
or
  javax.swing.DefaultCellEditor.EditorDelegate

It seems you chose the second.
So, 'Organize imports' behaves correctly here.

In your code the propting makes sense, as you could import the swing class and 
at the same time have a inner class with the same name.
However, there are known problems with 'organize imports' ad unnessary 
prompting for inner classes.  There are plans to improve this with the release 
of the new AST API.
Comment 6 Vijay Aravamudhan CLA 2008-01-09 19:42:16 EST
Closing