From dd3863b48e7a1fc08107c15648b3f532cdd31365 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Mon, 15 Mar 2021 14:03:51 -0700 Subject: [PATCH] Add `@Nullable` to the bound of `Supplier`. RELNOTES=`base`: Marked the bound of the type parameter in `Supplier` as `@Nullable` -- including in `guava-android`. TODO(cpovirk): In the release, consider either reverting this or making sure that we've adopted such annotations thoroughly. PiperOrigin-RevId: 363025243 --- android/guava/pom.xml | 4 ++++ .../src/com/google/common/base/Supplier.java | 3 ++- android/pom.xml | 13 +++++++++++++ guava-gwt/pom.xml | 15 +++++++++++++++ .../google/common/ForceGuavaCompilation.gwt.xml | 1 + guava/src/com/google/common/base/Supplier.java | 3 ++- pom.xml | 9 ++++++++- 7 files changed, 45 insertions(+), 3 deletions(-) diff --git a/android/guava/pom.xml b/android/guava/pom.xml index ed15b827e213..bdf07e0a246d 100644 --- a/android/guava/pom.xml +++ b/android/guava/pom.xml @@ -30,6 +30,10 @@ com.google.code.findbugs jsr305 + + org.checkerframework + checker-qual + org.checkerframework checker-compat-qual diff --git a/android/guava/src/com/google/common/base/Supplier.java b/android/guava/src/com/google/common/base/Supplier.java index 662bf1f664df..9fd75f290ef8 100644 --- a/android/guava/src/com/google/common/base/Supplier.java +++ b/android/guava/src/com/google/common/base/Supplier.java @@ -16,6 +16,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import org.checkerframework.checker.nullness.qual.Nullable; /** * A class that can supply objects of a single type; a pre-Java-8 version of {@link @@ -45,7 +46,7 @@ * @since 2.0 */ @GwtCompatible -public interface Supplier { +public interface Supplier { /** * Retrieves an instance of the appropriate type. The returned object may or may not be a new * instance, depending on the implementation. diff --git a/android/pom.xml b/android/pom.xml index c802ca337186..a888cbc405a5 100644 --- a/android/pom.xml +++ b/android/pom.xml @@ -15,6 +15,7 @@ %regex[.*.class] 1.1 + 3.8.0 org.checkerframework checker-compat-qual diff --git a/guava-gwt/pom.xml b/guava-gwt/pom.xml index 7a1975fb4532..0d61f395d8c3 100644 --- a/guava-gwt/pom.xml +++ b/guava-gwt/pom.xml @@ -107,6 +107,11 @@ org.checkerframework checker-qual + + org.checkerframework + checker-qual + sources + @@ -129,6 +134,8 @@ **/ForceGuavaCompilation* **/DummyJavadocClass* + + **/Qual.gwt.xml @@ -139,6 +146,8 @@ **/ForceGuavaCompilation* **/DummyJavadocClass* + + **/Qual.gwt.xml @@ -299,6 +308,12 @@ + + + <module><source path="" /></module> + + + diff --git a/guava-gwt/src/com/google/common/ForceGuavaCompilation.gwt.xml b/guava-gwt/src/com/google/common/ForceGuavaCompilation.gwt.xml index 93f5404da501..86373cf5e53f 100644 --- a/guava-gwt/src/com/google/common/ForceGuavaCompilation.gwt.xml +++ b/guava-gwt/src/com/google/common/ForceGuavaCompilation.gwt.xml @@ -13,6 +13,7 @@ + diff --git a/guava/src/com/google/common/base/Supplier.java b/guava/src/com/google/common/base/Supplier.java index 0226d1d647af..476491285609 100644 --- a/guava/src/com/google/common/base/Supplier.java +++ b/guava/src/com/google/common/base/Supplier.java @@ -16,6 +16,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import org.checkerframework.checker.nullness.qual.Nullable; /** * Legacy version of {@link java.util.function.Supplier java.util.function.Supplier}. Semantically, @@ -37,7 +38,7 @@ */ @GwtCompatible @FunctionalInterface -public interface Supplier extends java.util.function.Supplier { +public interface Supplier extends java.util.function.Supplier { /** * Retrieves an instance of the appropriate type. The returned object may or may not be a new * instance, depending on the implementation. diff --git a/pom.xml b/pom.xml index 90ed28d17582..1a6d224b8aef 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,7 @@ %regex[.*.class] 1.1 + 3.8.0