Bug 30370

Summary: Warning "import never used" in spite of use by a javadoc @link
Product: [Eclipse Project] JDT Reporter: Andreas Krüger <andreas.krueger>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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.