<div dir="ltr"><div>Hi,<br><br></div>For some time we considering enabling <a href="http://checkstyle.sourceforge.net/config_imports.html"><span id="goog_630655167"></span><span id="goog_630655168"></span>UnusedImports</a> but in past checkstyle seemingly reported too much false positives for imports that looked valid.<br>
<div><br></div><div>We are now <a href="https://github.com/jbossas/jboss-as/pull/4099">enabling </a>this check in most strict way possible.<br><br></div><div>that means:<br></div><div>- it will complain when there are usual unused imports<br>
</div><div>- it will complain when there are imports that are used <b>only in javadoc</b> comments.<br><br></div><div>the later is the controversial one, as many of us by default use imports also for javadoc and some IDEs do that by default.<br>
<br></div><div>For example code like this:<br><br></div><div><span style="font-family:courier new,monospace">import java.util.List;<br></span></div><div><span style="font-family:courier new,monospace"><br>...<br>/**<br>* @param a {@link List} for attributes<br>
*/<br>..</span><br></div><div><br></div><div>would complain that java.util.List is not used in this class.<br></div><div>Proper javadoc in this case would be to use fully qualified class names like:<br><br><span style="font-family:courier new,monospace">/**<br>
* @param a {@link java.util.List} for attributes</span><br>*/<br></div><div><br></div><div>this only applies if this import is only used in Javadoc not anywhere else.<br><br></div><div>This is a draconian change and will require some adjusting to but you can set your IDE to always use FQN for classes in javadoc.<br>
IDEA has support for this, for eclipse we have not found it yet...<br><br><br></div><div>One reason to be strict with javadocs is recent indecent [1] with product recompile failure of CFNE after some package was renamed and import was only in javadoc.<br>
<br></div><div>if full class name would be used Javadoc compilation would still work, but javadoc reference would be wrong.<br><br><br><br>--<br></div><div>tomaz<br></div><div><br></div><div><br><br></div><div>[1] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=912237">https://bugzilla.redhat.com/show_bug.cgi?id=912237</a><br>
</div></div>