Bug 30370 - Warning "import never used" in spite of use by a javadoc @link
Summary: Warning "import never used" in spite of use by a javadoc @link
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-28 05:45 EST by Andreas Krüger CLA
Modified: 2003-01-28 06:37 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 Andreas Krüger CLA 2003-01-28 05:45:13 EST
I get a warning that a certain import statement is never used,
even though a javadoc @link tag relies on that import.
Comment 1 Philipe Mulet CLA 2003-01-28 06:19:11 EST
Javadoc are not considered when performing the unused import diagnosis. You 
should fully qualify the type in the javadoc. Note that unused import diagnosis 
is a configurable setting you can turn off.

Note that when the Java compiler performs, it will need to check that the extra 
import is resolvable, which means if you javadoc did become stale (extra import 
target got removed) then this extra import would prevent you from compiling 
your code, which doesn't need this import.


Closing, won't change current behavior.
Comment 2 Andreas Krüger CLA 2003-01-28 06:37:54 EST
> this extra import would prevent you from compiling  your code

Thanks for pointing this out.  In my universe, however, classes seldomly
cease to exist, in particular not classes that were important enough
to be mentioned in other packages' javadoc.  So that isn't much
of an issue to me.

> You should fully qualify the type in the javadoc.

Should I?  I think this is a matter of style and taste.

Personally, I don't like code clutter.
In my thinking, Java package names usually qualify as code clutter.
They are fine in import statements, but other than that,
I try to avoid package names.

I've noticed that this style of mine is supported by Eclipse extremely well,
as far as Java code is concerned, but, alas, not well at all,
as far as Javadoc is concerned.

I'd really wish you had a different approach towards Javadoc,
more consistent with what you do for code.