Accepted answer

people don't agree whether this is a bug or not. javadoc needs the imports to create appropriate links. i'd say checkstyle should provide an option (and eclipse maybe too) to change the warning.

there are two relevant bug reports:

update: the mentioned bug has been fixed in checkstyle. you know have the option to configure the behavior.


in checkstyle.xml, change

<module name="unusedimports"/>


<module name="unusedimports">
        <property name="processjavadoc" value="true"/>

this requires version 6.0 of checkstyle.



the checkstyle bug has been fixed now. in checkstyle config, go imports > unused imports > click open > make sure processjavadoc is checked.

enter image description here

now checkstyle doesn't warn on this anymore.


if you use the fully-qualified class name in the javadoc, eclipse will not add an import, e.g.

 * this class is a {@link} that blah blah blah

Related Query

More Query from same tag