Skip navigation links
org.netbeans.api.annotations.common/1 1.41

Common Annotations
Stable

See: Description

Common Annotations 
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.

What is New (see all changes)?

Use Cases

CheckReturnValue annotated method

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.

CheckForNull annotated method

Method annotated with CheckForNull may return null value. Annotation serves as documentation as well as a hint for static code analysis.

NonNull annotated element

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.

NullAllowed annotated element

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.

NullUnknown annotated element

Annotation NullUnknown complementing other nullness annotations serves for cases where the element may or may not be null under certain defined circumstances (usage).

SuppressWarnings annotated element

When the analysis tool report false warning it is possible to use SuppressWarning annotation to suppress the warning.

Exported Interfaces

This table lists all of the module exported APIs with defined stability classifications. It is generated based on answers to questions about the architecture of the module. Read them all...
Group of java interfaces
Interface NameIn/OutStabilitySpecified in What Document?
CommonAnnotationsAPIExportedStable .../annotations/common/package-summary.html

Implementation Details

Where are the sources for the module?

The sources for the module are in the Apache Git repositories or in the GitHub repositories.

What do other modules need to do to declare a dependency on this one, in addition to or instead of a plain module dependency?

Nothing.

Read more about the implementation in the answers to architecture questions.

Skip navigation links
org.netbeans.api.annotations.common/1 1.41