diff options
author | Stephan Herrmann | 2011-09-06 20:32:47 +0000 |
---|---|---|
committer | Stephan Herrmann | 2011-09-06 20:32:47 +0000 |
commit | 74df4d13a9bf655493f8d7a6a3225c92e0885552 (patch) | |
tree | d3a1b6c8d300ca2fb0288c62121ceb332a630f7d /contrib/jdt-null-annotations | |
parent | b04bef656b5ecbfa0a7b5cc034d92f3d4c5a9710 (diff) | |
download | org.eclipse.objectteams-74df4d13a9bf655493f8d7a6a3225c92e0885552.tar.gz org.eclipse.objectteams-74df4d13a9bf655493f8d7a6a3225c92e0885552.tar.xz org.eclipse.objectteams-74df4d13a9bf655493f8d7a6a3225c92e0885552.zip |
updated javadoc to the most recent semantics, main difference:
inheritance no longer automatically propagates annotations.
Diffstat (limited to 'contrib/jdt-null-annotations')
3 files changed, 24 insertions, 28 deletions
diff --git a/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NonNull.java b/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NonNull.java index a6e01fa24..3f07d5c0e 100644 --- a/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NonNull.java +++ b/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NonNull.java @@ -27,17 +27,19 @@ import java.lang.annotation.*; * annotation can never have the value <code>null</code> at runtime. * <p> * This has two consequences: - * <ul> - * <li>An attempt to bind a <code>null</code> value to the entity is a compile time error. - * Diagnostics issued by the compiler should distinguish three situations: - * <ul> - * <li>Nullness of the value can be statically determined.</li> - * <li>Nullness can not definitely be determined, because different code branches yield different results.</li> - * <li>Nullness can not be determined, because other program elements are involved for which - * null annotations are lacking.</li> - * </ul></li> + * <ol> * <li>Dereferencing the entity is safe, i.e., no <code>NullPointerException</code> can occur at runtime.</li> - * </ul> + * <li>An attempt to bind a <code>null</code> value to the entity is a compile time error.</li> + * </ol> + * For the second case diagnostics issued by the compiler should distinguish three situations: + * <ol> + * <li>Nullness of the value can be statically determined, the entity is definitely bound from either of: + * <ul><li>the value <code>null</code>, or</li> + * <li>an entity with a {@link Nullable @Nullable} type.</li></ul></li> + * <li>Nullness can not definitely be determined, because different code branches yield different results.</li> + * <li>Nullness can not be determined, because other program elements are involved for which + * null annotations are lacking.</li> + * </ol> * </p> * @author stephan */ diff --git a/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NonNullByDefault.java b/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NonNullByDefault.java index 2f0d84497..ea6755d46 100644 --- a/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NonNullByDefault.java +++ b/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NonNullByDefault.java @@ -24,19 +24,16 @@ import java.lang.annotation.*; * <p> * This annotation can be applied to a package or a type in order to define that * all contained entities for which a null annotation is otherwise lacking - * should be considered as @{@link NonNull}. + * should be considered as {@link NonNull @NonNull}. * <dl> * <dt>Interaction with inheritance</dt> - * <dd>This annotation has lower precedence than null contract inheritance, - * i.e., for a method with no explicit null annotations first inheritance - * from the super-method (overridden or implemented) are considered. - * Only if that search yields no null annotation the default defined using - * <code>@NonNullByDefault</code> is applied.</dd> + * <dd>The rules regarding inheritance are applied <em>after</em> the applicable default + * has been applied to all types lacking an annotation.</dd> * <dt>Nested defaults</dt> * <dd>If a <code>@NonNullByDefault</code> - * annotation is used within the scope of a <code>@NullableByDefault</code> - * annotation the inner most annotation defines the default applicable at - * any given position.</dd> + * annotation is used within the scope of a {@link NullableByDefault @NullableByDefault} + * annotation (or a project wide default setting) the inner most annotation defines the + * default applicable at any given position.</dd> * </dl> * Note that for applying an annotation to a package a file by the name * <code>package-info.java</code> is used. diff --git a/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NullableByDefault.java b/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NullableByDefault.java index 5e47006bb..9d2c61c30 100644 --- a/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NullableByDefault.java +++ b/contrib/jdt-null-annotations/src/org/eclipse/jdt/annotation/NullableByDefault.java @@ -24,19 +24,16 @@ import java.lang.annotation.*; * <p> * This annotation can be applied to a package or a type in order to define that * all contained entities for which a null annotation is otherwise lacking - * should be considered as @{@link Nullable}. + * should be considered as {@link Nullable @Nullable}. * <dl> * <dt>Interaction with inheritance</dt> - * <dd>This annotation has lower precedence than null contract inheritance, - * i.e., for a method with no explicit null annotations first inheritance - * from the super-method (overridden or implemented) are considered. - * Only if that search yields no null annotation the default defined using - * <code>@NullableByDefault</code> is applied.</dd> + * <dd>The rules regarding inheritance are applied <em>after</em> the applicable default + * has been applied to all types lacking an annotation.</dd> * <dt>Nested defaults</dt> * <dd>If a <code>@NullableByDefault</code> - * annotation is used within the scope of a <code>@NonNullByDefault</code> - * annotation the inner most annotation defines the default applicable at - * any given position.</dd> + * annotation is used within the scope of a {@link NonNullByDefault @NonNullByDefault} + * annotation (or a project wide default setting) the inner most annotation defines the + * default applicable at any given position.</dd> * </dl> * Note that for applying an annotation to a package a file by the name * <code>package-info.java</code> is used. |