Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329921 - Organize Imports creates illegal import statement on javadoc {@link EmbeddedClass} tag
Summary: Organize Imports creates illegal import statement on javadoc {@link EmbeddedC...
Status: CLOSED DUPLICATE of bug 319860
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC All
: P3 minor (vote)
Target Milestone: 3.6.1   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-10 11:33 EST by Sebastian Haufe CLA
Modified: 2010-11-10 11:54 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Haufe CLA 2010-11-10 11:33:35 EST
Build Identifier: 20100617-1415

Organize Imports creates an import statement for an embedded class/interface/enum linked by the javadoc {@link} tag.

1. The import leads to a compile error if the class exists in the default package.

2. The import is unused if the class exists in a package: The import foo.OrganizeImportBug.SomeClass is never used


OrganizeImportBug.java
----------------------------------------------------------------------------
import OrganizeImportBug.SomeClass; // generated by Eclipse Organize Imports

/** {@link SomeClass} */
public class OrganizeImportBug {
  public class SomeClass {}
}


Shell:
----------------------------------------------------------------------------
$ javac OrganizeImportBug.java 
OrganizeImportBug.java:1: package OrganizeImportBug does not exist
import OrganizeImportBug.SomeClass;
                        ^
1 error

Workaround: Use {@link OrganizeImportBug.SomeClass} instead.

Reproducible: Always
Comment 1 Olivier Thomann CLA 2010-11-10 11:54:18 EST
I could reproduce in 3.6.0, but not in 3.6.1.
This looks like a duplicate of bug 319860

*** This bug has been marked as a duplicate of bug 319860 ***