Eclipse JDT
Release 3.8

org.eclipse.jdt.annotation
Annotation Type NonNull


@Documented
@Retention(value=CLASS)
@Target(value={METHOD,PARAMETER,LOCAL_VARIABLE})
public @interface NonNull

Qualifier for a type in a method signature or a local variable declaration: The entity (return value, parameter, local variable) whose type has this annotation can never have the value null at runtime.

This has two consequences:

  1. Dereferencing the entity is safe, i.e., no NullPointerException can occur at runtime.
  2. An attempt to bind a null value to the entity is a compile time error.
For the second case, diagnostics issued by the compiler should distinguish three situations:
  1. Nullness of the value can be statically determined, the entity is definitely bound from either of:
  2. Nullness cannot definitely be determined, because different code branches yield different results.
  3. Nullness cannot be determined, because other program elements are involved for which null annotations are lacking.

Since:
1.0


Eclipse JDT
Release 3.8

Guidelines for using Eclipse APIs.

Copyright (c) 2000, 2013 IBM Corporation and others. All rights reserved.