See: Description
Package | Description |
---|---|
org.netbeans.api.annotations.common |
The API containing common annotations (namely for defect detection)
to be used across the IDE sources.
|
The Common Annotations module provides the
CommonAnnotationsAPI
that contains annotations usable across the IDE sources. One such type
of annotations can guard (together with FindBugs)
your code against null
related defects.
In case your module is using projectized.xml
you can simply run
ant findbugs
to check your module. In such case the result is
available in nbbuild/build/findbugs/your-module-name.xml
.
SuppressWarnings
Introduced justification attribute to specify why it is ok to suppress a warning.
StaticResource
Introduced an annotation for validating the existence of static resources.
First initial release of the Common Annotations API.
When the method return value is important value to check (or the only effect the method has) the method can be annotated with CheckReturnValue. Annotation serves as documentation as well as a hint for static code analysis.
Method annotated with
CheckForNull
may return null
value. Annotation serves as documentation
as well as a hint for static code analysis.
When the field, parameter, local variable or return value of the method
must not be null
the
NonNull
annotation can be used to clearly express this. It serves as documentation
as well as a hint for static code analysis.
Field, parameter or local variable annotated with
NullAllowed
can contain null
value so null
check should
occur before any dereference. Annotation serves as documentation
as well as a hint for static code analysis.
Annotation
NullUnknown
complementing other nullness annotations serves for cases where
the element may or may not be null
under certain
defined circumstances (usage).
When the analysis tool report false warning it is possible to use SuppressWarning annotation to suppress the warning.
|
The sources for the module are in the Apache Git repositories or in the GitHub repositories.
Nothing.
Read more about the implementation in the answers to architecture questions.