From ae36f571a23b6c7119a6eda8ae2f9c3200b8846f Mon Sep 17 00:00:00 2001 From: cpovirk Date: Sat, 21 Dec 2024 08:18:13 -0800 Subject: [PATCH] Turn `@ParametricNullness` into a no-op for Kotlin and IntelliJ, and reduce its retention to `CLASS`. We'll continue annotating our APIs with it for now, since it can be helpful for NullAway and perhaps other tools. (But please [let us know](https://github.com/google/guava/issues/new?template=Blank+issue) if you are depending on it from a tool other than NullAway.) This is the next step toward [using JSpecify in Guava](https://github.com/jspecify/jspecify/issues/239#issuecomment-2204318808). Also, I've updated the Javadoc to belatedly note that `ParametricNulless` isn't used by `NullPointerTester` anymore (as of cl/530341970). RELNOTES=Changed `@ParametricNullness` into a no-op for Kotlin and IntelliJ. Before now, it was forcing many usages of type variables to have [platform types](https://kotlinlang.org/docs/java-interop.html#null-safety-and-platform-types), which meant that Kotlin couldn't check those usages for nullness errors. With this change, Kotlin can detect more errors. PiperOrigin-RevId: 708610470 --- .../common/base/ParametricNullness.java | 31 ++++++------------- .../common/cache/ParametricNullness.java | 31 ++++++------------- .../common/collect/ParametricNullness.java | 31 ++++++------------- .../common/escape/ParametricNullness.java | 31 ++++++------------- .../common/eventbus/ParametricNullness.java | 31 ++++++------------- .../common/graph/ParametricNullness.java | 31 ++++++------------- .../common/hash/ParametricNullness.java | 31 ++++++------------- .../common/html/ParametricNullness.java | 31 ++++++------------- .../google/common/io/ParametricNullness.java | 31 ++++++------------- .../common/math/ParametricNullness.java | 31 ++++++------------- .../google/common/net/ParametricNullness.java | 31 ++++++------------- .../common/primitives/ParametricNullness.java | 31 ++++++------------- .../common/reflect/ParametricNullness.java | 31 ++++++------------- .../util/concurrent/ParametricNullness.java | 31 ++++++------------- .../google/common/xml/ParametricNullness.java | 31 ++++++------------- .../common/base/ParametricNullness.java | 31 ++++++------------- .../common/cache/ParametricNullness.java | 31 ++++++------------- .../common/collect/ParametricNullness.java | 31 ++++++------------- .../common/escape/ParametricNullness.java | 31 ++++++------------- .../common/eventbus/ParametricNullness.java | 31 ++++++------------- .../common/graph/ParametricNullness.java | 31 ++++++------------- .../common/hash/ParametricNullness.java | 31 ++++++------------- .../common/html/ParametricNullness.java | 31 ++++++------------- .../google/common/io/ParametricNullness.java | 31 ++++++------------- .../common/math/ParametricNullness.java | 31 ++++++------------- .../google/common/net/ParametricNullness.java | 31 ++++++------------- .../common/primitives/ParametricNullness.java | 31 ++++++------------- .../common/reflect/ParametricNullness.java | 31 ++++++------------- .../util/concurrent/ParametricNullness.java | 31 ++++++------------- .../google/common/xml/ParametricNullness.java | 31 ++++++------------- 30 files changed, 270 insertions(+), 660 deletions(-) diff --git a/android/guava/src/com/google/common/base/ParametricNullness.java b/android/guava/src/com/google/common/base/ParametricNullness.java index 3fadb315554a..cdec346f42b5 100644 --- a/android/guava/src/com/google/common/base/ParametricNullness.java +++ b/android/guava/src/com/google/common/base/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/cache/ParametricNullness.java b/android/guava/src/com/google/common/cache/ParametricNullness.java index 8892bb45267d..affbfc511840 100644 --- a/android/guava/src/com/google/common/cache/ParametricNullness.java +++ b/android/guava/src/com/google/common/cache/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/collect/ParametricNullness.java b/android/guava/src/com/google/common/collect/ParametricNullness.java index 8074de5d5689..d3d67ef6a186 100644 --- a/android/guava/src/com/google/common/collect/ParametricNullness.java +++ b/android/guava/src/com/google/common/collect/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/escape/ParametricNullness.java b/android/guava/src/com/google/common/escape/ParametricNullness.java index 9ac5d62e1296..3ddd153ba04f 100644 --- a/android/guava/src/com/google/common/escape/ParametricNullness.java +++ b/android/guava/src/com/google/common/escape/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/eventbus/ParametricNullness.java b/android/guava/src/com/google/common/eventbus/ParametricNullness.java index fd07ef09cb60..06ab743cb700 100644 --- a/android/guava/src/com/google/common/eventbus/ParametricNullness.java +++ b/android/guava/src/com/google/common/eventbus/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/graph/ParametricNullness.java b/android/guava/src/com/google/common/graph/ParametricNullness.java index 634ee0e19782..67db8773c3d0 100644 --- a/android/guava/src/com/google/common/graph/ParametricNullness.java +++ b/android/guava/src/com/google/common/graph/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/hash/ParametricNullness.java b/android/guava/src/com/google/common/hash/ParametricNullness.java index f5a8614a8762..1aee79c6a64b 100644 --- a/android/guava/src/com/google/common/hash/ParametricNullness.java +++ b/android/guava/src/com/google/common/hash/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/html/ParametricNullness.java b/android/guava/src/com/google/common/html/ParametricNullness.java index a43cc22a06b0..812d5b6aec8d 100644 --- a/android/guava/src/com/google/common/html/ParametricNullness.java +++ b/android/guava/src/com/google/common/html/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/io/ParametricNullness.java b/android/guava/src/com/google/common/io/ParametricNullness.java index 32eee700e1c6..48773c8718a1 100644 --- a/android/guava/src/com/google/common/io/ParametricNullness.java +++ b/android/guava/src/com/google/common/io/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/math/ParametricNullness.java b/android/guava/src/com/google/common/math/ParametricNullness.java index a18ba9348f9a..34901185ab04 100644 --- a/android/guava/src/com/google/common/math/ParametricNullness.java +++ b/android/guava/src/com/google/common/math/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/net/ParametricNullness.java b/android/guava/src/com/google/common/net/ParametricNullness.java index 5b3af1736ee1..d79abc1991ed 100644 --- a/android/guava/src/com/google/common/net/ParametricNullness.java +++ b/android/guava/src/com/google/common/net/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/primitives/ParametricNullness.java b/android/guava/src/com/google/common/primitives/ParametricNullness.java index 9af83702c0b1..598e5e68bcf6 100644 --- a/android/guava/src/com/google/common/primitives/ParametricNullness.java +++ b/android/guava/src/com/google/common/primitives/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/reflect/ParametricNullness.java b/android/guava/src/com/google/common/reflect/ParametricNullness.java index 4cc7fd284847..4c9afbe59684 100644 --- a/android/guava/src/com/google/common/reflect/ParametricNullness.java +++ b/android/guava/src/com/google/common/reflect/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/util/concurrent/ParametricNullness.java b/android/guava/src/com/google/common/util/concurrent/ParametricNullness.java index f12f1133e6df..fcc986685545 100644 --- a/android/guava/src/com/google/common/util/concurrent/ParametricNullness.java +++ b/android/guava/src/com/google/common/util/concurrent/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/android/guava/src/com/google/common/xml/ParametricNullness.java b/android/guava/src/com/google/common/xml/ParametricNullness.java index 0d989c7cefa6..e8af7cb05d02 100644 --- a/android/guava/src/com/google/common/xml/ParametricNullness.java +++ b/android/guava/src/com/google/common/xml/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/base/ParametricNullness.java b/guava/src/com/google/common/base/ParametricNullness.java index 3fadb315554a..cdec346f42b5 100644 --- a/guava/src/com/google/common/base/ParametricNullness.java +++ b/guava/src/com/google/common/base/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/cache/ParametricNullness.java b/guava/src/com/google/common/cache/ParametricNullness.java index 8892bb45267d..affbfc511840 100644 --- a/guava/src/com/google/common/cache/ParametricNullness.java +++ b/guava/src/com/google/common/cache/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/collect/ParametricNullness.java b/guava/src/com/google/common/collect/ParametricNullness.java index 8074de5d5689..d3d67ef6a186 100644 --- a/guava/src/com/google/common/collect/ParametricNullness.java +++ b/guava/src/com/google/common/collect/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/escape/ParametricNullness.java b/guava/src/com/google/common/escape/ParametricNullness.java index 9ac5d62e1296..3ddd153ba04f 100644 --- a/guava/src/com/google/common/escape/ParametricNullness.java +++ b/guava/src/com/google/common/escape/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/eventbus/ParametricNullness.java b/guava/src/com/google/common/eventbus/ParametricNullness.java index fd07ef09cb60..06ab743cb700 100644 --- a/guava/src/com/google/common/eventbus/ParametricNullness.java +++ b/guava/src/com/google/common/eventbus/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/graph/ParametricNullness.java b/guava/src/com/google/common/graph/ParametricNullness.java index 634ee0e19782..67db8773c3d0 100644 --- a/guava/src/com/google/common/graph/ParametricNullness.java +++ b/guava/src/com/google/common/graph/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/hash/ParametricNullness.java b/guava/src/com/google/common/hash/ParametricNullness.java index f5a8614a8762..1aee79c6a64b 100644 --- a/guava/src/com/google/common/hash/ParametricNullness.java +++ b/guava/src/com/google/common/hash/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/html/ParametricNullness.java b/guava/src/com/google/common/html/ParametricNullness.java index a43cc22a06b0..812d5b6aec8d 100644 --- a/guava/src/com/google/common/html/ParametricNullness.java +++ b/guava/src/com/google/common/html/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/io/ParametricNullness.java b/guava/src/com/google/common/io/ParametricNullness.java index 32eee700e1c6..48773c8718a1 100644 --- a/guava/src/com/google/common/io/ParametricNullness.java +++ b/guava/src/com/google/common/io/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/math/ParametricNullness.java b/guava/src/com/google/common/math/ParametricNullness.java index a18ba9348f9a..34901185ab04 100644 --- a/guava/src/com/google/common/math/ParametricNullness.java +++ b/guava/src/com/google/common/math/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/net/ParametricNullness.java b/guava/src/com/google/common/net/ParametricNullness.java index 5b3af1736ee1..d79abc1991ed 100644 --- a/guava/src/com/google/common/net/ParametricNullness.java +++ b/guava/src/com/google/common/net/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/primitives/ParametricNullness.java b/guava/src/com/google/common/primitives/ParametricNullness.java index 9af83702c0b1..598e5e68bcf6 100644 --- a/guava/src/com/google/common/primitives/ParametricNullness.java +++ b/guava/src/com/google/common/primitives/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/reflect/ParametricNullness.java b/guava/src/com/google/common/reflect/ParametricNullness.java index 4cc7fd284847..4c9afbe59684 100644 --- a/guava/src/com/google/common/reflect/ParametricNullness.java +++ b/guava/src/com/google/common/reflect/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/util/concurrent/ParametricNullness.java b/guava/src/com/google/common/util/concurrent/ParametricNullness.java index f12f1133e6df..fcc986685545 100644 --- a/guava/src/com/google/common/util/concurrent/ParametricNullness.java +++ b/guava/src/com/google/common/util/concurrent/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {} diff --git a/guava/src/com/google/common/xml/ParametricNullness.java b/guava/src/com/google/common/xml/ParametricNullness.java index 0d989c7cefa6..e8af7cb05d02 100644 --- a/guava/src/com/google/common/xml/ParametricNullness.java +++ b/guava/src/com/google/common/xml/ParametricNullness.java @@ -19,7 +19,7 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.RetentionPolicy.CLASS; import com.google.common.annotations.GwtCompatible; import java.lang.annotation.Retention; @@ -54,32 +54,19 @@ *

Consumers of this annotation include: * *

* - *

This annotation is a temporary hack. We will remove it after we're able to adopt the JSpecify nullness annotations and This annotation is a temporary hack. We will remove it after tools no longer need * it. */ @GwtCompatible -@Retention(RUNTIME) +@Retention(CLASS) @Target({FIELD, METHOD, PARAMETER}) -@javax.annotation.meta.TypeQualifierNickname -@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) @interface ParametricNullness {}