Bug 6978

Summary: Organize Imports
Product: [Eclipse Project] JDT Reporter: Vijay Aravamudhan <avijayr>
Component: UIAssignee: Martin Aeschlimann <martinae>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Example that you asked for none

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