Skip to content

Commit 2cc8c5e

Browse files
cpovirkGoogle Java Core Libraries
authored and
Google Java Core Libraries
committed
Migrate from Checker Framework annotations to JSpecify annotations.
This is the next step toward [using JSpecify in Guava](jspecify/jspecify#239 (comment)). RELNOTES=Migrated from Checker Framework annotations to JSpecify annotations. PiperOrigin-RevId: 708707163
1 parent 04bf030 commit 2cc8c5e

File tree

1,317 files changed

+1356
-1356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,317 files changed

+1356
-1356
lines changed

android/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import com.google.errorprone.annotations.CanIgnoreReturnValue;
2121
import java.util.Collection;
2222
import org.jspecify.annotations.NullMarked;
23-
import org.checkerframework.checker.nullness.qual.Nullable;
23+
import org.jspecify.annotations.Nullable;
2424
import org.junit.Ignore;
2525

2626
/**

android/guava-testlib/src/com/google/common/collect/testing/AbstractContainerTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import java.util.Collection;
2929
import java.util.List;
3030
import org.jspecify.annotations.NullMarked;
31-
import org.checkerframework.checker.nullness.qual.Nullable;
31+
import org.jspecify.annotations.Nullable;
3232
import org.junit.Ignore;
3333

3434
/**

android/guava-testlib/src/com/google/common/collect/testing/AbstractIteratorTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import java.util.Set;
3636
import java.util.Stack;
3737
import org.jspecify.annotations.NullMarked;
38-
import org.checkerframework.checker.nullness.qual.Nullable;
38+
import org.jspecify.annotations.Nullable;
3939

4040
/**
4141
* Most of the logic for {@link IteratorTester} and {@link ListIteratorTester}.

android/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import java.util.Map;
2828
import java.util.Map.Entry;
2929
import org.jspecify.annotations.NullMarked;
30-
import org.checkerframework.checker.nullness.qual.Nullable;
30+
import org.jspecify.annotations.Nullable;
3131
import org.junit.Ignore;
3232

3333
/**

android/guava-testlib/src/com/google/common/collect/testing/AbstractTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.google.common.annotations.J2ktIncompatible;
2222
import junit.framework.TestCase;
2323
import org.jspecify.annotations.NullMarked;
24-
import org.checkerframework.checker.nullness.qual.Nullable;
24+
import org.jspecify.annotations.Nullable;
2525

2626
/**
2727
* This abstract base class for testers allows the framework to inject needed information after

android/guava-testlib/src/com/google/common/collect/testing/BaseComparable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import com.google.common.annotations.GwtCompatible;
2020
import java.io.Serializable;
21-
import org.checkerframework.checker.nullness.qual.Nullable;
21+
import org.jspecify.annotations.Nullable;
2222

2323
/**
2424
* Simple base class to verify that we handle generics correctly.

android/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import java.util.SortedMap;
3535
import java.util.SortedSet;
3636
import org.jspecify.annotations.NullMarked;
37-
import org.checkerframework.checker.nullness.qual.Nullable;
37+
import org.jspecify.annotations.Nullable;
3838

3939
/**
4040
* Derived suite generators, split out of the suite builders so that they are available to GWT.

android/guava-testlib/src/com/google/common/collect/testing/FeatureSpecificTestSuiteBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import junit.framework.Test;
4343
import junit.framework.TestCase;
4444
import junit.framework.TestSuite;
45-
import org.checkerframework.checker.nullness.qual.Nullable;
45+
import org.jspecify.annotations.Nullable;
4646

4747
/**
4848
* Creates, based on your criteria, a JUnit test suite that exhaustively tests the object generated

android/guava-testlib/src/com/google/common/collect/testing/Helpers.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import java.util.Map.Entry;
4646
import java.util.Set;
4747
import org.jspecify.annotations.NullMarked;
48-
import org.checkerframework.checker.nullness.qual.Nullable;
48+
import org.jspecify.annotations.Nullable;
4949

5050
@GwtCompatible(emulated = true)
5151
@NullMarked

android/guava-testlib/src/com/google/common/collect/testing/IteratorTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.Collections;
2121
import java.util.Iterator;
2222
import org.jspecify.annotations.NullMarked;
23-
import org.checkerframework.checker.nullness.qual.Nullable;
23+
import org.jspecify.annotations.Nullable;
2424

2525
/**
2626
* A utility for testing an Iterator implementation by comparing its behavior to that of a "known

android/guava-testlib/src/com/google/common/collect/testing/ListIteratorTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.util.List;
2222
import java.util.ListIterator;
2323
import org.jspecify.annotations.NullMarked;
24-
import org.checkerframework.checker.nullness.qual.Nullable;
24+
import org.jspecify.annotations.Nullable;
2525

2626
/**
2727
* A utility similar to {@link IteratorTester} for testing a {@link ListIterator} against a known

android/guava-testlib/src/com/google/common/collect/testing/MapInterfaceTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import java.util.Set;
3535
import junit.framework.TestCase;
3636
import org.jspecify.annotations.NullMarked;
37-
import org.checkerframework.checker.nullness.qual.Nullable;
37+
import org.jspecify.annotations.Nullable;
3838

3939
/**
4040
* Tests representing the contract of {@link Map}. Concrete subclasses of this base class test

android/guava-testlib/src/com/google/common/collect/testing/MinimalCollection.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import java.util.AbstractCollection;
2424
import java.util.Collection;
2525
import java.util.Iterator;
26-
import org.checkerframework.checker.nullness.qual.NonNull;
26+
import org.jspecify.annotations.NonNull;
2727
import org.jspecify.annotations.NullMarked;
28-
import org.checkerframework.checker.nullness.qual.Nullable;
28+
import org.jspecify.annotations.Nullable;
2929

3030
/**
3131
* A simplistic collection which implements only the bare minimum allowed by the spec, and throws

android/guava-testlib/src/com/google/common/collect/testing/MinimalIterable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.google.common.annotations.GwtCompatible;
2222
import java.util.Collection;
2323
import java.util.Iterator;
24-
import org.checkerframework.checker.nullness.qual.Nullable;
24+
import org.jspecify.annotations.Nullable;
2525

2626
/**
2727
* An implementation of {@code Iterable} which throws an exception on all invocations of the {@link

android/guava-testlib/src/com/google/common/collect/testing/MinimalSet.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import java.util.Collection;
2424
import java.util.List;
2525
import java.util.Set;
26-
import org.checkerframework.checker.nullness.qual.NonNull;
26+
import org.jspecify.annotations.NonNull;
2727
import org.jspecify.annotations.NullMarked;
28-
import org.checkerframework.checker.nullness.qual.Nullable;
28+
import org.jspecify.annotations.Nullable;
2929

3030
/**
3131
* A simplistic set which implements the bare minimum so that it can be used in tests without

android/guava-testlib/src/com/google/common/collect/testing/OneSizeGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.util.Collection;
2525
import java.util.List;
2626
import org.jspecify.annotations.NullMarked;
27-
import org.checkerframework.checker.nullness.qual.Nullable;
27+
import org.jspecify.annotations.Nullable;
2828

2929
/**
3030
* Generator for collection of a particular size.

android/guava-testlib/src/com/google/common/collect/testing/OneSizeTestContainerGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import com.google.common.collect.testing.features.CollectionSize;
2121
import java.util.Collection;
2222
import org.jspecify.annotations.NullMarked;
23-
import org.checkerframework.checker.nullness.qual.Nullable;
23+
import org.jspecify.annotations.Nullable;
2424

2525
/**
2626
* The subject-generator interface accepted by Collection testers, for testing a Collection at one

android/guava-testlib/src/com/google/common/collect/testing/ReflectionFreeAssertThrows.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import java.util.concurrent.TimeoutException;
3333
import junit.framework.AssertionFailedError;
3434
import org.jspecify.annotations.NullMarked;
35-
import org.checkerframework.checker.nullness.qual.Nullable;
35+
import org.jspecify.annotations.Nullable;
3636

3737
/** Replacements for JUnit's {@code assertThrows} that work under GWT/J2CL. */
3838
@GwtCompatible(emulated = true)

android/guava-testlib/src/com/google/common/collect/testing/SafeTreeMap.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import java.util.Set;
3030
import java.util.SortedMap;
3131
import java.util.TreeMap;
32-
import org.checkerframework.checker.nullness.qual.Nullable;
32+
import org.jspecify.annotations.Nullable;
3333

3434
/**
3535
* A wrapper around {@code TreeMap} that aggressively checks to see if keys are mutually comparable.

android/guava-testlib/src/com/google/common/collect/testing/SafeTreeSet.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.util.NavigableSet;
2626
import java.util.SortedSet;
2727
import java.util.TreeSet;
28-
import org.checkerframework.checker.nullness.qual.Nullable;
28+
import org.jspecify.annotations.Nullable;
2929

3030
/**
3131
* A wrapper around {@code TreeSet} that aggressively checks to see if elements are mutually

android/guava-testlib/src/com/google/common/collect/testing/SampleElements.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.util.List;
2525
import java.util.Map.Entry;
2626
import org.jspecify.annotations.NullMarked;
27-
import org.checkerframework.checker.nullness.qual.Nullable;
27+
import org.jspecify.annotations.Nullable;
2828

2929
/**
3030
* A container class for the five sample elements we need for testing.

android/guava-testlib/src/com/google/common/collect/testing/SortedMapTestSuiteBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import java.util.Map.Entry;
3232
import java.util.Set;
3333
import junit.framework.TestSuite;
34-
import org.checkerframework.checker.nullness.qual.Nullable;
34+
import org.jspecify.annotations.Nullable;
3535

3636
/**
3737
* Creates, based on your criteria, a JUnit test suite that exhaustively tests a SortedMap

android/guava-testlib/src/com/google/common/collect/testing/SpliteratorTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import java.util.function.Function;
4444
import java.util.function.Supplier;
4545
import org.jspecify.annotations.NullMarked;
46-
import org.checkerframework.checker.nullness.qual.Nullable;
46+
import org.jspecify.annotations.Nullable;
4747

4848
/**
4949
* Tester for {@code Spliterator} implementations.

android/guava-testlib/src/com/google/common/collect/testing/TestCollectionGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.google.common.annotations.GwtCompatible;
2020
import java.util.Collection;
2121
import org.jspecify.annotations.NullMarked;
22-
import org.checkerframework.checker.nullness.qual.Nullable;
22+
import org.jspecify.annotations.Nullable;
2323

2424
/**
2525
* Creates collections, containing sample elements, to be tested.

android/guava-testlib/src/com/google/common/collect/testing/TestContainerGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.util.List;
2222
import java.util.Map;
2323
import org.jspecify.annotations.NullMarked;
24-
import org.checkerframework.checker.nullness.qual.Nullable;
24+
import org.jspecify.annotations.Nullable;
2525

2626
/**
2727
* To be implemented by test generators of things that can contain elements. Such things include

android/guava-testlib/src/com/google/common/collect/testing/TestListGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.google.common.annotations.GwtCompatible;
2020
import java.util.List;
2121
import org.jspecify.annotations.NullMarked;
22-
import org.checkerframework.checker.nullness.qual.Nullable;
22+
import org.jspecify.annotations.Nullable;
2323

2424
/**
2525
* Creates sets, containing sample elements, to be tested.

android/guava-testlib/src/com/google/common/collect/testing/TestMapEntrySetGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.util.Map.Entry;
2525
import java.util.Set;
2626
import org.jspecify.annotations.NullMarked;
27-
import org.checkerframework.checker.nullness.qual.Nullable;
27+
import org.jspecify.annotations.Nullable;
2828

2929
/**
3030
* Creates map entries using sample keys and sample values.

android/guava-testlib/src/com/google/common/collect/testing/TestMapGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.google.common.annotations.GwtCompatible;
2020
import java.util.Map;
2121
import org.jspecify.annotations.NullMarked;
22-
import org.checkerframework.checker.nullness.qual.Nullable;
22+
import org.jspecify.annotations.Nullable;
2323

2424
/**
2525
* Creates maps, containing sample elements, to be tested.

android/guava-testlib/src/com/google/common/collect/testing/TestQueueGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.google.common.annotations.GwtCompatible;
2020
import java.util.Queue;
2121
import org.jspecify.annotations.NullMarked;
22-
import org.checkerframework.checker.nullness.qual.Nullable;
22+
import org.jspecify.annotations.Nullable;
2323

2424
/**
2525
* Creates queues, containing sample elements, to be tested.

android/guava-testlib/src/com/google/common/collect/testing/TestSetGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.google.common.annotations.GwtCompatible;
2020
import java.util.Set;
2121
import org.jspecify.annotations.NullMarked;
22-
import org.checkerframework.checker.nullness.qual.Nullable;
22+
import org.jspecify.annotations.Nullable;
2323

2424
/**
2525
* Creates sets, containing sample elements, to be tested.

android/guava-testlib/src/com/google/common/collect/testing/TestSortedMapGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.Map.Entry;
2121
import java.util.SortedMap;
2222
import org.jspecify.annotations.NullMarked;
23-
import org.checkerframework.checker.nullness.qual.Nullable;
23+
import org.jspecify.annotations.Nullable;
2424

2525
/**
2626
* Creates sorted maps, containing sample elements, to be tested.

android/guava-testlib/src/com/google/common/collect/testing/TestSortedSetGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.google.common.annotations.GwtCompatible;
2020
import java.util.SortedSet;
2121
import org.jspecify.annotations.NullMarked;
22-
import org.checkerframework.checker.nullness.qual.Nullable;
22+
import org.jspecify.annotations.Nullable;
2323

2424
/**
2525
* Creates sorted sets, containing sample elements, to be tested.

android/guava-testlib/src/com/google/common/collect/testing/TestSubjectGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import com.google.common.annotations.GwtCompatible;
2020
import org.jspecify.annotations.NullMarked;
21-
import org.checkerframework.checker.nullness.qual.Nullable;
21+
import org.jspecify.annotations.Nullable;
2222

2323
/**
2424
* To be implemented by test generators that can produce test subjects without requiring any

android/guava-testlib/src/com/google/common/collect/testing/UnhashableObject.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package com.google.common.collect.testing;
1818

1919
import com.google.common.annotations.GwtCompatible;
20-
import org.checkerframework.checker.nullness.qual.Nullable;
20+
import org.jspecify.annotations.Nullable;
2121

2222
/**
2323
* An unhashable object to be used in testing as values in our collections.

android/guava-testlib/src/com/google/common/collect/testing/features/CollectionSize.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.lang.annotation.RetentionPolicy;
2626
import java.util.Collection;
2727
import java.util.Set;
28-
import org.checkerframework.checker.nullness.qual.Nullable;
28+
import org.jspecify.annotations.Nullable;
2929

3030
/**
3131
* When describing the features of the collection produced by a given generator (i.e. in a call to

android/guava-testlib/src/com/google/common/collect/testing/features/TesterRequirements.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.google.common.annotations.GwtCompatible;
2222
import java.util.Collections;
2323
import java.util.Set;
24-
import org.checkerframework.checker.nullness.qual.Nullable;
24+
import org.jspecify.annotations.Nullable;
2525

2626
/**
2727
* Encapsulates the constraints that a class under test must satisfy in order for a tester method to

android/guava-testlib/src/com/google/common/collect/testing/google/AbstractBiMapTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import java.util.List;
2828
import java.util.Map.Entry;
2929
import org.jspecify.annotations.NullMarked;
30-
import org.checkerframework.checker.nullness.qual.Nullable;
30+
import org.jspecify.annotations.Nullable;
3131
import org.junit.Ignore;
3232

3333
/** Skeleton for a tester of a {@code BiMap}. */

android/guava-testlib/src/com/google/common/collect/testing/google/AbstractListMultimapTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.google.common.collect.ListMultimap;
2222
import java.util.Collection;
2323
import org.jspecify.annotations.NullMarked;
24-
import org.checkerframework.checker.nullness.qual.Nullable;
24+
import org.jspecify.annotations.Nullable;
2525
import org.junit.Ignore;
2626

2727
/**

android/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultimapTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import java.util.Iterator;
3030
import java.util.Map.Entry;
3131
import org.jspecify.annotations.NullMarked;
32-
import org.checkerframework.checker.nullness.qual.Nullable;
32+
import org.jspecify.annotations.Nullable;
3333
import org.junit.Ignore;
3434

3535
/**

android/guava-testlib/src/com/google/common/collect/testing/google/DerivedGoogleCollectionGenerators.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import java.util.Map.Entry;
3535
import java.util.Set;
3636
import org.jspecify.annotations.NullMarked;
37-
import org.checkerframework.checker.nullness.qual.Nullable;
37+
import org.jspecify.annotations.Nullable;
3838

3939
/**
4040
* Derived suite generators for Guava collection interfaces, split out of the suite builders so that

android/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapAsMapTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import java.util.Map.Entry;
3535
import java.util.Set;
3636
import org.jspecify.annotations.NullMarked;
37-
import org.checkerframework.checker.nullness.qual.Nullable;
37+
import org.jspecify.annotations.Nullable;
3838
import org.junit.Ignore;
3939

4040
/**

android/guava-testlib/src/com/google/common/collect/testing/google/MultimapEqualsTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import java.util.List;
2929
import java.util.Map.Entry;
3030
import org.jspecify.annotations.NullMarked;
31-
import org.checkerframework.checker.nullness.qual.Nullable;
31+
import org.jspecify.annotations.Nullable;
3232
import org.junit.Ignore;
3333

3434
/**

android/guava-testlib/src/com/google/common/collect/testing/google/MultimapPutTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import java.util.List;
3939
import java.util.Map.Entry;
4040
import org.jspecify.annotations.NullMarked;
41-
import org.checkerframework.checker.nullness.qual.Nullable;
41+
import org.jspecify.annotations.Nullable;
4242
import org.junit.Ignore;
4343

4444
/**

0 commit comments

Comments
 (0)