[
https://issues.apache.org/jira/browse/NETBEANS-5379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Bien closed NETBEANS-5379.
----------------------------------
Fix Version/s: 23
Resolution: Fixed
> Warning hint "Unused Element" can't be suppressed
> -------------------------------------------------
>
> Key: NETBEANS-5379
> URL: https://issues.apache.org/jira/browse/NETBEANS-5379
> Project: NetBeans
> Issue Type: Bug
> Components: java - Hints
> Affects Versions: 12.2
> Reporter: Niklas Matthies
> Priority: Major
> Fix For: 23
>
>
> The hint "Unused Element" (category "Probably Bugs") can't be suppressed, it
> seems. In particular, @SuppressWarnings("unused") doesn't suppress it.
> One concrete use case I have is a try-with-resources where the resource
> variable is not used in the try block. (Of course, it is implicitly used for
> close()-ing the resource.) NetBeans generates a warning (which is fine, the
> code could indeed be wrong) which however can't be suppressed. Previously
> (last tested in 12.0), @SuppressWarnings("try") would do the trick.
> This isn't the first time a warning hint was introduced without a way to
> suppress it. I'd like to suggest to always, as a rule, without exception, add
> a suppression constant, because there are invariably cases where a warning is
> a false positive.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists