Top Description Methods
org.eclipse.jgit.annotations

public @Interface Nullable

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:FIELD, METHOD, PARAMETER, LOCAL_VARIABLE
Static Imports
java.lang.annotation.ElementType.FIELD, .ElementType.LOCAL_VARIABLE, .ElementType.METHOD, .ElementType.PARAMETER

Marks types that can hold the value null at run time.

Unlike org.eclipse.jdt.annotation.Nullable, this has run-time retention, allowing the annotation to be recognized by Guice. Unlike javax.annotation.Nullable, this does not involve importing new classes to a standard (Java EE) package, so it can be deployed in an OSGi container without running into split-package problems.

You can use this annotation to qualify a type in a method signature or local variable declaration. The entity whose type has this annotation is allowed to hold the value null at run time. This allows annotation based null analysis to infer that

To avoid a dependency on Java 8, this annotation does not use @Target TYPE_USE. That may change when JGit starts requiring Java 8.

Warning

Please do not use this annotation on arrays. Different annotation processors treat @Nullable Object[] differently: some treat it as an array of nullable objects, for consistency with versions of Nullable defined with @Target TYPE_USE, while others treat it as a nullable array of objects. JGit therefore avoids using this annotation on arrays altogether.

Since
4.2
See Also
The checker-framework manual

Method Summary

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString