Netbeans provides a lot of custom "hints", which are like warnings, only that most of them can't be suppressed (just disabled IDE-globally).
But now I looking at code which uses
@SuppressWarnings("element-type-mismatch")
to suppress a hint/warning which is called "suspicious method call" (such as remove(...)
for a collection with a "wrong" type).
Well, I would never come to the idea to suppress a hint named "suspicious method call" with a SuppressWarnings
-parameter called "element-type-mismatch", but apparently, it works.
So, is there a "magic list" of such parameters?
How, for instance, do I suppress the hint/warning "return of collection field"?
NOTE: for this similar question, "element-type-mismatch" is not listed.
The documentation says:
Since NetBeans is using javac I think, here is a list.
See also this question.
If you are using another compiler, or some compiler plugin, search for its documentation.
Well the list is hard to find. Did find the sources of the
hint classes
of Netbeans.So the 'list' is here. (also look at the sub packages; e.g.
jdk
andperf
)All classes can be supressed by using its
camel cases
name like:After a brief look at the NB-sourcecode, I found these in some of the java.hint -classes:
Apparently, not all IDE-hints that are displayed as warnings are made suppressable... Don't know why though, 'cause the AbstractHint class wich many of them extends easily provides this ability... These are just the suppress-names though, so to find the mapping to the names of the warnings they represent, a deeper dig in the source is needed.