score:16

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.

score:0

in checkstyle.xml, change

<module name="unusedimports"/>

to:

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

this requires version 6.0 of checkstyle.

source: https://github.com/jboss/jboss-parent-pom/issues/23

score:2

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.

score:11

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

/**
 * this class is a {@link java.io.file} that blah blah blah
 */

Related Query

More Query from same tag