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

Common Annotations
Stable

See: Description

Common Annotations 
Package Description
org.netbeans.api.annotations.common
The API containg 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 defect.

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 servers as documentation as well as a hint for static code analysis.

CheckForNull annotated method

Method annotated with CheckForNull may return null value. Annotation servers 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 servers 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 servers as documentation as well as a hint for static code analysis.

NullUnknown annotated element

Annotation NullUnknown complementing other nullness annotations servers 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 NetBeans Mercurial 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.28

Built on December 12 2017.  |  Portions Copyright 1997-2017 Oracle. All rights reserved.