You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Doroszlai, Attila (JIRA)" <ji...@apache.org> on 2017/06/06 15:09:18 UTC

[jira] [Updated] (AMBARI-21185) False positive unused import for nested class referenced only in Javadoc

     [ https://issues.apache.org/jira/browse/AMBARI-21185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doroszlai, Attila updated AMBARI-21185:
---------------------------------------
    Status: Patch Available  (was: Open)

> 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
>
>         Attachments: AMBARI-21185.patch
>
>
> 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)