Doroszlai, Attila created AMBARI-21185:
------------------------------------------
Summary: False positive unused import for nested class referenced
only in Javadoc
Key: AMBARI-21185
URL: https://issues.apache.org/jira/browse/AMBARI-21185
Project: Ambari
Issue Type: Bug
Components: ambari-server
Affects Versions: 3.0.0
Reporter: Doroszlai, Attila
Assignee: Doroszlai, Attila
Fix For: 3.0.0
Checkstyle reports unused import:
{code}
[ERROR]
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java:99:8:
Unused import - org.apache.ambari.server.state.stack.upgrade.StageWrapper.
[UnusedImports]
Audit done.
{code}
However, StageWrapper is referenced in the JavaDoc. IDEs, like Eclipse, don't
warn on this import since it's technically used int he JavaDoc generation:
{code}
/**
* Tests that commands created for {@link StageWrapper.Type#RU_TASKS} set the
* service and component on the {@link ExecutionCommand}.
{code}
This is an upstream bug: https://github.com/checkstyle/checkstyle/issues/3098
and https://github.com/checkstyle/checkstyle/issues/3453.
I think the best thing we can do here is {{@link}} by full classname in the
JavaDoc and avoid the import. This way we avoid both Checkstyle error when
import is present (due to "unused" import) and IDE warning when import is
missing (due to unresolved class).
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)