Bug 120541 - Wrong import added after Javadoc code assist
Summary: Wrong import added after Javadoc code assist
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-13 06:33 EST by Jerome Lanneluc CLA
Modified: 2005-12-13 16:27 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2005-12-13 06:33:22 EST
I20051213-0010

Follow steps from bug 114341.
Observe: The resulting CU is:

import Toto.Tata;
public class X {
  /**
   * {@link Tata}
   */
  void foo() {}
}
class Toto {
  class Tata {}
}

The import is wrong (not needed).
Comment 1 Jerome Lanneluc CLA 2005-12-13 06:47:35 EST
Note this is with 'Add import instead of fully qualified name' preference on.
Comment 2 Martin Aeschlimann CLA 2005-12-13 08:17:13 EST
This is a corner case.
In 1.3 compliance this is allowed (and not unnecessary), in  compliance > 1.3 imports from the default package are forbidden.
Everything works if your type is in a package.

I suggest to close as won't fix. Objections?
Comment 3 Jerome Lanneluc CLA 2005-12-13 09:08:25 EST
My compliance is 1.4. Why don't you check it ?
Comment 4 Martin Aeschlimann CLA 2005-12-13 16:27:26 EST
Currently it would mean extra code at each caller site of the import rewrite only gets the fully qualified name and can't know that this reference is in the default package.
It's a bug but a corner case: Default package and secondary type.