diff --git a/android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java b/android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java index a4f3b45e7582..9b7b6f6a3358 100644 --- a/android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java +++ b/android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java @@ -53,6 +53,7 @@ import javax.annotation.CheckForNull; import junit.framework.Assert; import junit.framework.AssertionFailedError; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -81,6 +82,8 @@ */ @GwtIncompatible @J2ktIncompatible +@NullUnmarked +@SuppressWarnings("nullness") public final class ClassSanityTester { private static final Ordering> BY_METHOD_NAME = diff --git a/android/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java b/android/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java index 0386d875bc1d..c2fe57baf5a3 100644 --- a/android/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java +++ b/android/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java @@ -121,6 +121,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Pattern; import javax.annotation.CheckForNull; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -130,6 +131,8 @@ */ @GwtIncompatible @J2ktIncompatible +@NullUnmarked +@SuppressWarnings("nullness") class FreshValueGenerator { private static final ImmutableMap, Method> GENERATORS; diff --git a/android/guava-testlib/test/com/google/common/testing/AbstractPackageSanityTestsTest.java b/android/guava-testlib/test/com/google/common/testing/AbstractPackageSanityTestsTest.java index cb6ba6abf457..6ddcde40c359 100644 --- a/android/guava-testlib/test/com/google/common/testing/AbstractPackageSanityTestsTest.java +++ b/android/guava-testlib/test/com/google/common/testing/AbstractPackageSanityTestsTest.java @@ -23,12 +23,14 @@ import java.util.Arrays; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link AbstractPackageSanityTests}. * * @author Ben Yu */ +@NullUnmarked public class AbstractPackageSanityTestsTest extends TestCase { /* * This is a public type so that the Android test runner can create an instance directly as it diff --git a/android/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java b/android/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java index ca2f5f50e2a2..072150830f7f 100644 --- a/android/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java +++ b/android/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java @@ -129,6 +129,7 @@ import java.util.regex.MatchResult; import java.util.regex.Pattern; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -136,6 +137,7 @@ * * @author Ben Yu */ +@NullUnmarked public class ArbitraryInstancesTest extends TestCase { public void testGet_primitives() { diff --git a/android/guava-testlib/test/com/google/common/testing/EqualsTesterTest.java b/android/guava-testlib/test/com/google/common/testing/EqualsTesterTest.java index f777efa31048..039ae877ecb7 100644 --- a/android/guava-testlib/test/com/google/common/testing/EqualsTesterTest.java +++ b/android/guava-testlib/test/com/google/common/testing/EqualsTesterTest.java @@ -26,6 +26,7 @@ import java.util.Set; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -35,6 +36,7 @@ */ @GwtCompatible @SuppressWarnings("MissingTestCall") +@NullUnmarked public class EqualsTesterTest extends TestCase { private ValidTestObject reference; private EqualsTester equalsTester; diff --git a/android/guava-testlib/test/com/google/common/testing/EquivalenceTesterTest.java b/android/guava-testlib/test/com/google/common/testing/EquivalenceTesterTest.java index 7e9649090289..00bdb2aa4457 100644 --- a/android/guava-testlib/test/com/google/common/testing/EquivalenceTesterTest.java +++ b/android/guava-testlib/test/com/google/common/testing/EquivalenceTesterTest.java @@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableTable; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link EquivalenceTester}. @@ -34,6 +35,7 @@ * @author Gregory Kick */ @GwtCompatible +@NullUnmarked public class EquivalenceTesterTest extends TestCase { private EquivalenceTester tester; private MockEquivalence equivalenceMock; diff --git a/android/guava-testlib/test/com/google/common/testing/FakeTickerTest.java b/android/guava-testlib/test/com/google/common/testing/FakeTickerTest.java index e62e82ad6a2d..209b9f5b3536 100644 --- a/android/guava-testlib/test/com/google/common/testing/FakeTickerTest.java +++ b/android/guava-testlib/test/com/google/common/testing/FakeTickerTest.java @@ -31,6 +31,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -41,6 +42,7 @@ @GwtCompatible(emulated = true) // We also want to test the TimeUnit overload (especially under GWT, where it's the only option). @SuppressWarnings("SetAutoIncrementStep_Nanos") +@NullUnmarked public class FakeTickerTest extends TestCase { @GwtIncompatible // NullPointerTester diff --git a/android/guava-testlib/test/com/google/common/testing/FreshValueGeneratorTest.java b/android/guava-testlib/test/com/google/common/testing/FreshValueGeneratorTest.java index b20517cadb15..f3eb11694bbf 100644 --- a/android/guava-testlib/test/com/google/common/testing/FreshValueGeneratorTest.java +++ b/android/guava-testlib/test/com/google/common/testing/FreshValueGeneratorTest.java @@ -106,12 +106,14 @@ import java.util.regex.MatchResult; import java.util.regex.Pattern; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link FreshValueGenerator}. * * @author Ben Yu */ +@NullUnmarked public class FreshValueGeneratorTest extends TestCase { @AndroidIncompatible // problem with equality of Type objects? diff --git a/android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java b/android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java index bda3916c1834..7a83cc740a9c 100644 --- a/android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java +++ b/android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java @@ -26,6 +26,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -36,6 +37,7 @@ */ @AndroidIncompatible // depends on details of gc +@NullUnmarked public class GcFinalizationTest extends TestCase { // ---------------------------------------------------------------- diff --git a/android/guava-testlib/test/com/google/common/testing/PackageSanityTests.java b/android/guava-testlib/test/com/google/common/testing/PackageSanityTests.java index d5483d36f092..1770e3376685 100644 --- a/android/guava-testlib/test/com/google/common/testing/PackageSanityTests.java +++ b/android/guava-testlib/test/com/google/common/testing/PackageSanityTests.java @@ -16,7 +16,9 @@ package com.google.common.testing; +import org.jspecify.annotations.NullUnmarked; /** Test nulls for the entire package. */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests {} diff --git a/android/guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java b/android/guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java index 943c2951e3a0..e5c597892fb8 100644 --- a/android/guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java +++ b/android/guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java @@ -18,12 +18,14 @@ import com.google.common.testing.RelationshipTester.ItemReporter; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link RelationshipTester}. * * @author Ben Yu */ +@NullUnmarked public class RelationshipTesterTest extends TestCase { public void testNulls() { diff --git a/android/guava-testlib/test/com/google/common/testing/SerializableTesterTest.java b/android/guava-testlib/test/com/google/common/testing/SerializableTesterTest.java index e950c9968cd1..dbab0b6c5a5b 100644 --- a/android/guava-testlib/test/com/google/common/testing/SerializableTesterTest.java +++ b/android/guava-testlib/test/com/google/common/testing/SerializableTesterTest.java @@ -19,6 +19,7 @@ import java.io.Serializable; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -26,6 +27,7 @@ * * @author Nick Kralevich */ +@NullUnmarked public class SerializableTesterTest extends TestCase { public void testStringAssertions() { String original = "hello world"; diff --git a/android/guava-testlib/test/com/google/common/testing/TearDownStackTest.java b/android/guava-testlib/test/com/google/common/testing/TearDownStackTest.java index 369563e04755..1e23183baf3c 100644 --- a/android/guava-testlib/test/com/google/common/testing/TearDownStackTest.java +++ b/android/guava-testlib/test/com/google/common/testing/TearDownStackTest.java @@ -20,10 +20,14 @@ import com.google.common.annotations.GwtCompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; -/** @author Luiz-Otavio "Z" Zorzella */ +/** + * @author Luiz-Otavio "Z" Zorzella + */ @GwtCompatible +@NullUnmarked public class TearDownStackTest extends TestCase { private TearDownStack tearDownStack = new TearDownStack(); diff --git a/android/guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java b/android/guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java index 212f6af9f0e9..4af6b6b3ed94 100644 --- a/android/guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java +++ b/android/guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java @@ -20,12 +20,14 @@ import java.util.logging.LogRecord; import java.util.logging.Logger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link TestLogHandler}. * * @author kevinb */ +@NullUnmarked public class TestLogHandlerTest extends TestCase { private TestLogHandler handler; diff --git a/android/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java index 6ed8006ee903..2727d3723fe6 100644 --- a/android/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java @@ -25,12 +25,14 @@ import java.util.List; import java.util.Locale; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the ASCII class. * * @author Kevin Bourrillion */ +@NullUnmarked public class AsciiBenchmark { private static final String ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; private static final String NONALPHA = "0123456789`~-_=+[]{}|;:',.<>/?!@#$%^&*()\"\\"; diff --git a/android/guava-tests/benchmark/com/google/common/base/CharMatcherBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/CharMatcherBenchmark.java index f5667d89b27d..dcc5532ea7bd 100644 --- a/android/guava-tests/benchmark/com/google/common/base/CharMatcherBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/CharMatcherBenchmark.java @@ -25,6 +25,7 @@ import java.util.Collections; import java.util.List; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmark for the {@link CharMatcher} class. @@ -33,6 +34,7 @@ * @author Kevin Bourrillion * @author David Richter */ +@NullUnmarked public class CharMatcherBenchmark { // Caliper injects params automatically diff --git a/android/guava-tests/benchmark/com/google/common/base/EnumsBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/EnumsBenchmark.java index 0acb562a0b53..79143409d672 100644 --- a/android/guava-tests/benchmark/com/google/common/base/EnumsBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/EnumsBenchmark.java @@ -22,8 +22,10 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.jspecify.annotations.NullUnmarked; @SuppressWarnings("unused") // Nested enums used reflectively in setUp. +@NullUnmarked public class EnumsBenchmark { @Param({"Small", "Medium", "Large"}) diff --git a/android/guava-tests/benchmark/com/google/common/base/JoinerBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/JoinerBenchmark.java index 99728327e9bb..8b3b5afd02d3 100644 --- a/android/guava-tests/benchmark/com/google/common/base/JoinerBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/JoinerBenchmark.java @@ -21,12 +21,14 @@ import com.google.caliper.Param; import java.util.Arrays; import java.util.Iterator; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks {@link Joiner} against some common implementations of delimiter-based string joining. * * @author Adomas Paltanavicius */ +@NullUnmarked public class JoinerBenchmark { private static final String DELIMITER_STRING = ","; diff --git a/android/guava-tests/benchmark/com/google/common/base/LazyStackTraceBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/LazyStackTraceBenchmark.java index 5f79d0c42366..f4843bddcaef 100644 --- a/android/guava-tests/benchmark/com/google/common/base/LazyStackTraceBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/LazyStackTraceBenchmark.java @@ -24,11 +24,13 @@ import com.google.caliper.Param; import com.google.caliper.api.SkipThisScenarioException; import java.util.List; +import org.jspecify.annotations.NullUnmarked; /** * Quick and dirty benchmark of {@link Throwables#lazyStackTrace(Throwable)}. We benchmark a "caller * finder" implementation that might be used in a logging framework. */ +@NullUnmarked public class LazyStackTraceBenchmark { @Param({"20", "200", "2000"}) int stackDepth; diff --git a/android/guava-tests/benchmark/com/google/common/base/ObjectsBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/ObjectsBenchmark.java index 561f76dca98b..82385daa3725 100644 --- a/android/guava-tests/benchmark/com/google/common/base/ObjectsBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/ObjectsBenchmark.java @@ -17,12 +17,14 @@ package com.google.common.base; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Some microbenchmarks for the {@link com.google.common.base.Objects} class. * * @author Ben L. Titzer */ +@NullUnmarked public class ObjectsBenchmark { private static final Integer I0 = -45; diff --git a/android/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java index 5c3ced36e8bc..4d23cc20fc68 100644 --- a/android/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java @@ -20,12 +20,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import com.google.common.collect.Iterables; +import org.jspecify.annotations.NullUnmarked; /** * Microbenchmark for {@link Splitter#on} with char vs String with length == 1. * * @author Paul Lindner */ +@NullUnmarked public class SplitterBenchmark { // overall size of string @Param({"1", "10", "100", "1000"}) diff --git a/android/guava-tests/benchmark/com/google/common/base/StopwatchBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/StopwatchBenchmark.java index 0351e94fcfa1..21e71774391e 100644 --- a/android/guava-tests/benchmark/com/google/common/base/StopwatchBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/StopwatchBenchmark.java @@ -19,6 +19,7 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Simple benchmark: create, start, read. This does not currently report the most useful result @@ -26,6 +27,7 @@ * * @author Kevin Bourrillion */ +@NullUnmarked public class StopwatchBenchmark { @Benchmark long stopwatch(int reps) { diff --git a/android/guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java index 16e00ef3d2e2..9f350cf68c78 100644 --- a/android/guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java @@ -19,12 +19,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; import com.google.caliper.Param; +import org.jspecify.annotations.NullUnmarked; /** * Microbenchmark for {@link com.google.common.base.Strings#repeat} * * @author Mike Cripps */ +@NullUnmarked public class StringsRepeatBenchmark { @Param({"1", "5", "25", "125"}) int count; diff --git a/android/guava-tests/benchmark/com/google/common/base/ToStringHelperBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/ToStringHelperBenchmark.java index 9d3acfbd2dd5..c0241db44f9b 100644 --- a/android/guava-tests/benchmark/com/google/common/base/ToStringHelperBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/ToStringHelperBenchmark.java @@ -20,12 +20,14 @@ import com.google.caliper.Param; import java.util.Arrays; import java.util.Collections; +import org.jspecify.annotations.NullUnmarked; /** * Some microbenchmarks for the {@link MoreObjects.ToStringHelper} class. * * @author Osvaldo Doederlein */ +@NullUnmarked public class ToStringHelperBenchmark { @Param({"0", "1", "5"}) diff --git a/android/guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java index fd3c9c4dc255..2793fc5e08d4 100644 --- a/android/guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java @@ -21,8 +21,10 @@ import com.google.caliper.Param; import java.util.BitSet; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** Benchmark for the {@link CharMatcher#whitespace} implementation. */ +@NullUnmarked public class WhitespaceMatcherBenchmark { private static final int STRING_LENGTH = 10000; diff --git a/android/guava-tests/benchmark/com/google/common/cache/ChainBenchmark.java b/android/guava-tests/benchmark/com/google/common/cache/ChainBenchmark.java index 592e80b64ae8..4ffc712078d6 100644 --- a/android/guava-tests/benchmark/com/google/common/cache/ChainBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/cache/ChainBenchmark.java @@ -20,6 +20,7 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import com.google.common.cache.LocalCache.Segment; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -28,6 +29,7 @@ * @author Charles Fry */ @SuppressWarnings("CheckReturnValue") +@NullUnmarked public class ChainBenchmark { @Param({"1", "2", "3", "4", "5", "6"}) diff --git a/android/guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java b/android/guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java index b15de8f8892e..3383b407b448 100644 --- a/android/guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java @@ -23,12 +23,14 @@ import com.google.common.primitives.Ints; import java.util.Random; import java.util.concurrent.atomic.AtomicLong; +import org.jspecify.annotations.NullUnmarked; /** * Single-threaded benchmark for {@link LoadingCache}. * * @author Charles Fry */ +@NullUnmarked public class LoadingCacheSingleThreadBenchmark { @Param({"1000", "2000"}) int maximumSize; diff --git a/android/guava-tests/benchmark/com/google/common/cache/MapMakerComparisonBenchmark.java b/android/guava-tests/benchmark/com/google/common/cache/MapMakerComparisonBenchmark.java index 5fa6cbc94d14..5b8fc509acfe 100644 --- a/android/guava-tests/benchmark/com/google/common/cache/MapMakerComparisonBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/cache/MapMakerComparisonBenchmark.java @@ -20,12 +20,14 @@ import com.google.caliper.Benchmark; import com.google.common.collect.MapMaker; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; /** * Compare CacheBuilder and MapMaker performance, ensuring that they remain on par with each other. * * @author Nikita Sidorov */ +@NullUnmarked public class MapMakerComparisonBenchmark { private static final String TEST_KEY = "test key"; private static final String TEST_VALUE = "test value"; diff --git a/android/guava-tests/benchmark/com/google/common/cache/SegmentBenchmark.java b/android/guava-tests/benchmark/com/google/common/cache/SegmentBenchmark.java index a473d75e585d..e50da889645e 100644 --- a/android/guava-tests/benchmark/com/google/common/cache/SegmentBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/cache/SegmentBenchmark.java @@ -23,12 +23,14 @@ import com.google.caliper.Param; import com.google.common.cache.LocalCache.Segment; import java.util.concurrent.atomic.AtomicReferenceArray; +import org.jspecify.annotations.NullUnmarked; /** * Benchmark for {@code LocalCache.Segment.expand()}. * * @author Charles Fry */ +@NullUnmarked public class SegmentBenchmark { @Param({"16", "32", "64", "128", "256", "512", "1024", "2048", "4096", "8192"}) diff --git a/android/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java index 75fc1f90d2ef..76e04fddfc81 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java @@ -21,12 +21,14 @@ import com.google.common.primitives.Ints; import java.util.List; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the {@code TreeTraverser} operations on binary trees. * * @author Louis Wasserman */ +@NullUnmarked public class BinaryTreeTraverserBenchmark { private static class BinaryNode { final int x; diff --git a/android/guava-tests/benchmark/com/google/common/collect/ComparatorDelegationOverheadBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/ComparatorDelegationOverheadBenchmark.java index 11e4b80a6204..9d618b5fb9d3 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/ComparatorDelegationOverheadBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/ComparatorDelegationOverheadBenchmark.java @@ -22,6 +22,7 @@ import java.util.Arrays; import java.util.Comparator; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * A benchmark to determine the overhead of sorting with {@link Ordering#from(Comparator)}, or with @@ -30,6 +31,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class ComparatorDelegationOverheadBenchmark { private final Integer[][] inputArrays = new Integer[0x100][]; diff --git a/android/guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java index 3fd9be87980d..4a70a0e07988 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java @@ -38,6 +38,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -45,6 +46,7 @@ * * @author mike nonemacher */ +@NullUnmarked public class ConcurrentHashMultisetBenchmark { @Param({"1", "2", "4", "8"}) int threads; diff --git a/android/guava-tests/benchmark/com/google/common/collect/HashMultisetAddPresentBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/HashMultisetAddPresentBenchmark.java index a109cc2ed324..f48d27cf5cc2 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/HashMultisetAddPresentBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/HashMultisetAddPresentBenchmark.java @@ -19,12 +19,14 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmark for HashMultiset.add for an already-present element. * * @author Louis Wasserman */ +@NullUnmarked public class HashMultisetAddPresentBenchmark { private static final int ARRAY_MASK = 0x0ffff; private static final int ARRAY_SIZE = 0x10000; diff --git a/android/guava-tests/benchmark/com/google/common/collect/ImmutableListCreationBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/ImmutableListCreationBenchmark.java index ce0e24abb616..a2c0f3976b95 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/ImmutableListCreationBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/ImmutableListCreationBenchmark.java @@ -19,12 +19,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.util.List; +import org.jspecify.annotations.NullUnmarked; /** * Benchmark for various ways to create an {@code ImmutableList}. * * @author Louis Wasserman */ +@NullUnmarked public class ImmutableListCreationBenchmark { @Param({"10", "1000", "1000000"}) diff --git a/android/guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java index 2b6a8c011488..aa96b5ee67a5 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java @@ -17,12 +17,14 @@ package com.google.common.collect; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarking interners. * * @author Dimitris Andreou */ +@NullUnmarked public class InternersBenchmark { @Benchmark int weakInterner(int reps) { diff --git a/android/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java index 20e832dd882e..931d86cc9ed8 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java @@ -21,12 +21,14 @@ import com.google.caliper.Param; import java.util.ArrayList; import java.util.LinkedList; +import org.jspecify.annotations.NullUnmarked; /** * Tests the speed of iteration of different iteration methods for collections. * * @author David Richter */ +@NullUnmarked public class IteratorBenchmark { @Param({"0", "1", "16", "256", "4096", "65536"}) int size; diff --git a/android/guava-tests/benchmark/com/google/common/collect/MapBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/MapBenchmark.java index e8aa4e9e22eb..4c71174b5073 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/MapBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/MapBenchmark.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListMap; +import org.jspecify.annotations.NullUnmarked; /** * A microbenchmark that tests the performance of get() and iteration on various map @@ -37,6 +38,7 @@ * * @author Nicholaus Shupe */ +@NullUnmarked public class MapBenchmark { @Param({"Hash", "LinkedHM", "MapMaker1", "Immutable"}) private Impl impl; diff --git a/android/guava-tests/benchmark/com/google/common/collect/MapsMemoryBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/MapsMemoryBenchmark.java index 301271e54e99..afb01a2ef654 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/MapsMemoryBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/MapsMemoryBenchmark.java @@ -30,8 +30,10 @@ import com.google.common.collect.BenchmarkHelpers.SortedMapImpl; import com.google.common.collect.CollectionBenchmarkSampleData.Element; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; /** Benchmarks for memory consumption of map implementations. */ +@NullUnmarked public class MapsMemoryBenchmark { static final Map mapEnums = uniqueIndex( diff --git a/android/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java index 08755044c3e0..432414accc62 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java @@ -25,6 +25,7 @@ import java.util.PriorityQueue; import java.util.Queue; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -32,6 +33,7 @@ * * @author Sverre Sundsdal */ +@NullUnmarked public class MinMaxPriorityQueueBenchmark { @Param private ComparatorType comparator; diff --git a/android/guava-tests/benchmark/com/google/common/collect/MultipleSetContainsBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/MultipleSetContainsBenchmark.java index ecefcb0e4dc0..e21eb4734698 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/MultipleSetContainsBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/MultipleSetContainsBenchmark.java @@ -21,8 +21,10 @@ import com.google.caliper.Param; import com.google.caliper.api.SkipThisScenarioException; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** A benchmark that tries invoking {@code Set.contains} on many different sets. */ +@NullUnmarked public class MultipleSetContainsBenchmark { @Param({"0.0", "0.1", "0.7", "1.0"}) diff --git a/android/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java index 29caec305638..552743d69abe 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java @@ -23,12 +23,14 @@ import com.google.caliper.Param; import com.google.common.base.Preconditions; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Tests the speed of iteration of different iteration methods for collections. * * @author David Richter */ +@NullUnmarked public class MultisetIteratorBenchmark { @Param({"0", "1", "16", "256", "4096", "65536"}) int size; diff --git a/android/guava-tests/benchmark/com/google/common/collect/PowerSetBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/PowerSetBenchmark.java index e775b8b28acf..bf6cd36a5142 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/PowerSetBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/PowerSetBenchmark.java @@ -22,12 +22,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; /** * Very simple powerSet iteration benchmark. * * @author Kevin Bourrillion */ +@NullUnmarked public class PowerSetBenchmark { @Param({"2", "4", "8", "16"}) int elements; diff --git a/android/guava-tests/benchmark/com/google/common/collect/SetContainsBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/SetContainsBenchmark.java index c2a21b124460..88665d667521 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/SetContainsBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/SetContainsBenchmark.java @@ -22,12 +22,14 @@ import com.google.common.collect.BenchmarkHelpers.SetImpl; import com.google.common.collect.CollectionBenchmarkSampleData.Element; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; /** * A microbenchmark that tests the performance of contains() on various Set implementations. * * @author Kevin Bourrillion */ +@NullUnmarked public class SetContainsBenchmark { // Start at 4.88 then multiply by 2*2^phi - The goal is be uniform // yet visit a variety of "values-relative-to-the-next-power-of-2" diff --git a/android/guava-tests/benchmark/com/google/common/collect/SetCreationBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/SetCreationBenchmark.java index be114e1539e3..00887ba70904 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/SetCreationBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/SetCreationBenchmark.java @@ -20,6 +20,7 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import com.google.common.collect.BenchmarkHelpers.SetImpl; +import org.jspecify.annotations.NullUnmarked; /** * This is meant to be used with {@code --measureMemory} to measure the memory usage of various @@ -27,6 +28,7 @@ * * @author Christopher Swenson */ +@NullUnmarked public class SetCreationBenchmark { @Param({ "3", "6", "11", "23", "45", "91", "181", "362", "724", "1448", "2896", "5793", "11585", "23170", diff --git a/android/guava-tests/benchmark/com/google/common/collect/SetIterationBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/SetIterationBenchmark.java index 796acefabfe6..958fc0c19817 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/SetIterationBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/SetIterationBenchmark.java @@ -22,12 +22,14 @@ import com.google.common.collect.BenchmarkHelpers.SetImpl; import com.google.common.collect.CollectionBenchmarkSampleData.Element; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; /** * Test iteration speed at various size for {@link Set} instances. * * @author Christopher Swenson */ +@NullUnmarked public class SetIterationBenchmark { @Param({ "3", "6", "11", "23", "45", "91", "181", "362", "724", "1448", "2896", "5793", "11585", "23170", diff --git a/android/guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java index 639f48847f93..3353ed96dc04 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java @@ -27,6 +27,7 @@ import java.util.Random; import java.util.Set; import java.util.TreeSet; +import org.jspecify.annotations.NullUnmarked; /** * Provides supporting data for performance notes in the documentation of {@link @@ -34,6 +35,7 @@ * suggestions. * */ +@NullUnmarked public class SortedCopyBenchmark { @Param({"1", "10", "1000", "1000000"}) int size; // logarithmic triangular diff --git a/android/guava-tests/benchmark/com/google/common/eventbus/EventBusBenchmark.java b/android/guava-tests/benchmark/com/google/common/eventbus/EventBusBenchmark.java index 53ddfb7cc0c7..0c4095efbb62 100644 --- a/android/guava-tests/benchmark/com/google/common/eventbus/EventBusBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/eventbus/EventBusBenchmark.java @@ -18,12 +18,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Benchmark for {@link EventBus}. * * @author Eric Fellheimer */ +@NullUnmarked public class EventBusBenchmark { private EventBus eventBus; diff --git a/android/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java b/android/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java index 868a9d390f28..5fe37f971697 100644 --- a/android/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java @@ -23,6 +23,7 @@ import java.util.zip.Adler32; import java.util.zip.CRC32; import java.util.zip.Checksum; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for comparing {@link Checksum}s and {@link HashFunction}s that wrap {@link Checksum}s. @@ -35,6 +36,7 @@ * * @author Colin Decker */ +@NullUnmarked public class ChecksumBenchmark { // Use a constant seed for all of the benchmarks to ensure apples to apples comparisons. diff --git a/android/guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java b/android/guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java index 3e3ec70fafa1..d7b6eb110454 100644 --- a/android/guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java @@ -22,6 +22,7 @@ import java.security.MessageDigest; import java.util.Arrays; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for comparing the various {@link HashCode#equals} methods. @@ -41,6 +42,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class HashCodeBenchmark { // Use a statically configured random instance for all of the benchmarks diff --git a/android/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java b/android/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java index 8a807f9b1ba1..69ece875f195 100644 --- a/android/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java @@ -20,6 +20,7 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for comparing the various {@link HashFunction functions} that we provide. @@ -33,6 +34,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class HashFunctionBenchmark { // Use a statically configured random instance for all of the benchmarks diff --git a/android/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java b/android/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java index 2c73be0994f2..6dc7c0963569 100644 --- a/android/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java @@ -22,8 +22,10 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** Benchmarks for the hashing of UTF-8 strings. */ +@NullUnmarked public class HashStringBenchmark { static class MaxCodePoint { final int value; diff --git a/android/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java b/android/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java index 2e252d127b68..8eca5a99cced 100644 --- a/android/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java @@ -22,6 +22,7 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for comparing {@link MessageDigest}s and {@link com.google.common.hash.HashFunction}s @@ -37,6 +38,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class MessageDigestAlgorithmBenchmark { @Param({"10", "1000", "100000", "1000000"}) int size; diff --git a/android/guava-tests/benchmark/com/google/common/hash/MessageDigestCreationBenchmark.java b/android/guava-tests/benchmark/com/google/common/hash/MessageDigestCreationBenchmark.java index bc2dc94102f2..3990b467633a 100644 --- a/android/guava-tests/benchmark/com/google/common/hash/MessageDigestCreationBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/hash/MessageDigestCreationBenchmark.java @@ -20,12 +20,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.security.MessageDigest; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for comparing instance creation of {@link MessageDigest}s. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class MessageDigestCreationBenchmark { @Param({"MD5", "SHA-1", "SHA-256", "SHA-384", "SHA-512"}) diff --git a/android/guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java b/android/guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java index a098542a7130..4cd211110c3d 100644 --- a/android/guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java @@ -23,8 +23,10 @@ import java.io.StringReader; import java.io.StringWriter; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** Benchmark for {@code BaseEncoding} performance. */ +@NullUnmarked public class BaseEncodingBenchmark { private static final int INPUTS_COUNT = 0x1000; private static final int INPUTS_MASK = 0xFFF; diff --git a/android/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java b/android/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java index f82a0c3e6020..cdc9ec4ce6b6 100644 --- a/android/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java @@ -23,12 +23,14 @@ import java.io.InputStreamReader; import java.nio.charset.Charset; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for various potential implementations of {@code ByteSource.asCharSource(...).read()}. */ // These benchmarks allocate a lot of data so use a large heap @VmOptions({"-Xms12g", "-Xmx12g", "-d64"}) +@NullUnmarked public class ByteSourceAsCharSourceReadBenchmark { enum ReadStrategy { TO_BYTE_ARRAY_NEW_STRING { diff --git a/android/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java b/android/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java index 0b9c87489c67..b6ff61f25d9f 100644 --- a/android/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java @@ -24,6 +24,7 @@ import java.nio.Buffer; import java.nio.CharBuffer; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for {@link CharStreams#copy}. @@ -33,6 +34,7 @@ */ // These benchmarks allocate a lot of data so use a large heap @VmOptions({"-Xms12g", "-Xmx12g", "-d64"}) +@NullUnmarked public class CharStreamsCopyBenchmark { enum CopyStrategy { OLD { diff --git a/android/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java index afcf95c4285b..4105c1c49b46 100644 --- a/android/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java @@ -25,6 +25,7 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; import com.google.caliper.Param; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks against the Apache Commons Math utilities. @@ -33,6 +34,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class ApacheBenchmark { private enum Impl { GUAVA { diff --git a/android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java index f2087f3b1c08..d719e4adac75 100644 --- a/android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java @@ -25,12 +25,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.math.BigInteger; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the non-rounding methods of {@code BigIntegerMath}. * * @author Louis Wasserman */ +@NullUnmarked public class BigIntegerMathBenchmark { private static final int[] factorials = new int[ARRAY_SIZE]; private static final int[] slowFactorials = new int[ARRAY_SIZE]; diff --git a/android/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java index be387f792459..e33aca162dd3 100644 --- a/android/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java @@ -26,12 +26,14 @@ import com.google.caliper.Param; import java.math.BigInteger; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the rounding methods of {@code BigIntegerMath}. * * @author Louis Wasserman */ +@NullUnmarked public class BigIntegerMathRoundingBenchmark { private static final BigInteger[] nonzero1 = new BigInteger[ARRAY_SIZE]; private static final BigInteger[] nonzero2 = new BigInteger[ARRAY_SIZE]; diff --git a/android/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java index 937c94c98337..b012e729f40d 100644 --- a/android/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java @@ -24,12 +24,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the non-rounding methods of {@code DoubleMath}. * * @author Louis Wasserman */ +@NullUnmarked public class DoubleMathBenchmark { private static final double[] positiveDoubles = new double[ARRAY_SIZE]; private static final int[] factorials = new int[ARRAY_SIZE]; diff --git a/android/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java index 7ab80b15cd6b..6ba25a1994ec 100644 --- a/android/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java @@ -25,12 +25,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the rounding methods of {@code DoubleMath}. * * @author Louis Wasserman */ +@NullUnmarked public class DoubleMathRoundingBenchmark { private static final double[] doubleInIntRange = new double[ARRAY_SIZE]; private static final double[] doubleInLongRange = new double[ARRAY_SIZE]; diff --git a/android/guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java index 58b0bb64e0e9..730284d79cf9 100644 --- a/android/guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java @@ -25,12 +25,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the non-rounding methods of {@code IntMath}. * * @author Louis Wasserman */ +@NullUnmarked public class IntMathBenchmark { private static int[] exponent = new int[ARRAY_SIZE]; private static int[] factorial = new int[ARRAY_SIZE]; diff --git a/android/guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java index cfa3d7393cd1..b1902b9f6a4f 100644 --- a/android/guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java @@ -26,12 +26,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the rounding methods of {@code IntMath}. * * @author Louis Wasserman */ +@NullUnmarked public class IntMathRoundingBenchmark { private static final int[] positive = new int[ARRAY_SIZE]; private static final int[] nonzero = new int[ARRAY_SIZE]; diff --git a/android/guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java index a63dd6b16b0a..de7a3e55c247 100644 --- a/android/guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java @@ -20,12 +20,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for various ways of writing the expression {@code foo + ((bar < baz) ? 1 : 0)}. * * @author Louis Wasserman */ +@NullUnmarked public class LessThanBenchmark { static final int SAMPLE_SIZE = 0x1000; static final int SAMPLE_MASK = 0x0FFF; diff --git a/android/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java index 6b0407cd5787..7934a776c71f 100644 --- a/android/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java @@ -25,12 +25,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the non-rounding methods of {@code LongMath}. * * @author Louis Wasserman */ +@NullUnmarked public class LongMathBenchmark { private static final int[] exponents = new int[ARRAY_SIZE]; private static final int[] factorialArguments = new int[ARRAY_SIZE]; diff --git a/android/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java index 5f2ac40550c3..868f2d5d2d04 100644 --- a/android/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java @@ -26,12 +26,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the rounding methods of {@code LongMath}. * * @author Louis Wasserman */ +@NullUnmarked public class LongMathRoundingBenchmark { @Param({"DOWN", "UP", "FLOOR", "CEILING", "HALF_EVEN", "HALF_UP", "HALF_DOWN"}) RoundingMode mode; diff --git a/android/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java index d97c2d56d642..d55d7b1069d5 100644 --- a/android/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java @@ -24,8 +24,10 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Range; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** Benchmarks some algorithms providing the same functionality as {@link Quantiles}. */ +@NullUnmarked public class QuantilesBenchmark { private static final ContiguousSet ALL_DECILE_INDEXES = diff --git a/android/guava-tests/benchmark/com/google/common/math/StatsBenchmark.java b/android/guava-tests/benchmark/com/google/common/math/StatsBenchmark.java index 7e50249162af..c37b1610e50b 100644 --- a/android/guava-tests/benchmark/com/google/common/math/StatsBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/math/StatsBenchmark.java @@ -22,12 +22,14 @@ import com.google.caliper.api.SkipThisScenarioException; import com.google.common.primitives.Doubles; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for various algorithms for computing the mean and/or variance. * * @author Louis Wasserman */ +@NullUnmarked public class StatsBenchmark { enum MeanAlgorithm { diff --git a/android/guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java b/android/guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java index 71ea279bd057..3b4fda5a7f28 100644 --- a/android/guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java @@ -22,12 +22,14 @@ import java.util.Arrays; import java.util.Comparator; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Microbenchmark for {@link UnsignedBytes}. * * @author Hiroshi Yamauchi */ +@NullUnmarked public class UnsignedBytesBenchmark { private byte[] ba1; diff --git a/android/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java b/android/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java index 288aa0c5c33c..cf5d3744cf6a 100644 --- a/android/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java @@ -19,12 +19,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for certain methods of {@code UnsignedLongs}. * * @author Eamonn McManus */ +@NullUnmarked public class UnsignedLongsBenchmark { private static final int ARRAY_SIZE = 0x10000; private static final int ARRAY_MASK = 0x0ffff; diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java index 09edd1dcb013..b4dd6202da5f 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java @@ -27,8 +27,10 @@ import java.util.HashSet; import java.util.Set; import java.util.concurrent.Executor; +import org.jspecify.annotations.NullUnmarked; /** Measures the size of AbstractFuture implementations. */ +@NullUnmarked public class AbstractFutureFootprintBenchmark { enum State { diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java index ce674e14e8ce..ec28f78abab8 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java @@ -21,12 +21,14 @@ import com.google.caliper.Param; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for {@link CycleDetectingLockFactory}. * * @author Darick Tong */ +@NullUnmarked public class CycleDetectingLockFactoryBenchmark { @Param({"2", "3", "4", "5", "10"}) diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java index 50618e63e4d2..a8411cec1afd 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java @@ -42,11 +42,13 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.logging.Logger; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import sun.misc.Unsafe; /** Benchmarks for {@link ExecutionList}. */ @VmOptions({"-Xms8g", "-Xmx8g"}) +@NullUnmarked public class ExecutionListBenchmark { private static final int NUM_THREADS = 10; // make a param? diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java index 9129bfc2a9f1..23f700cdb66a 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java @@ -44,8 +44,10 @@ import java.util.prefs.InvalidPreferencesFormatException; import java.util.zip.DataFormatException; import javax.security.auth.RefreshFailedException; +import org.jspecify.annotations.NullUnmarked; /** Microbenchmark for {@link Futures#getChecked}. */ +@NullUnmarked public class FuturesGetCheckedBenchmark { private enum Validator { NON_CACHING_WITH_CONSTRUCTOR_CHECK(nonCachingWithConstructorCheckValidator()), diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java index 7b9be17ec374..7ad6e961a2f2 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java @@ -25,6 +25,7 @@ import java.util.NoSuchElementException; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -52,6 +53,7 @@ * @param the type of elements held in this collection */ // TODO(kak): consider removing some of the @CanIgnoreReturnValue annotations as appropriate +@NullUnmarked public class MonitorBasedArrayBlockingQueue extends AbstractQueue implements BlockingQueue { diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java index efa7e033bc2c..e5dd26f62b2f 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java @@ -30,6 +30,7 @@ import java.util.SortedSet; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -76,6 +77,7 @@ * @author Justin T. Sampson * @param the type of elements held in this collection */ +@NullUnmarked public class MonitorBasedPriorityBlockingQueue extends AbstractQueue implements BlockingQueue { diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBenchmark.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBenchmark.java index 692017d786c2..2513d861776b 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBenchmark.java @@ -21,12 +21,14 @@ import com.google.caliper.Param; import java.lang.reflect.Constructor; import java.util.concurrent.BlockingQueue; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for {@link Monitor}. * * @author Justin T. Sampson */ +@NullUnmarked public class MonitorBenchmark { @Param({"10", "100", "1000"}) diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/MoreExecutorsDirectExecutorBenchmark.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/MoreExecutorsDirectExecutorBenchmark.java index f64ae389eefe..b42305e2b3e1 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/MoreExecutorsDirectExecutorBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/MoreExecutorsDirectExecutorBenchmark.java @@ -29,12 +29,14 @@ import java.util.Set; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicInteger; +import org.jspecify.annotations.NullUnmarked; /** * A benchmark comparing the {@link MoreExecutors#newDirectExecutorService()} to {@link * MoreExecutors#directExecutor}. */ @VmOptions({"-Xms12g", "-Xmx12g", "-d64"}) +@NullUnmarked public class MoreExecutorsDirectExecutorBenchmark { enum Impl { EXECUTOR_SERVICE { diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/SingleThreadAbstractFutureBenchmark.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/SingleThreadAbstractFutureBenchmark.java index 94b513f92897..0d8cfd59a9b9 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/SingleThreadAbstractFutureBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/SingleThreadAbstractFutureBenchmark.java @@ -30,9 +30,11 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; +import org.jspecify.annotations.NullUnmarked; /** A benchmark that times how long it takes to add a given number of */ @VmOptions({"-Xms8g", "-Xmx8g"}) +@NullUnmarked public class SingleThreadAbstractFutureBenchmark { @Param Impl impl; diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/StripedBenchmark.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/StripedBenchmark.java index 03c90d31dd89..3c1401e901c8 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/StripedBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/StripedBenchmark.java @@ -33,9 +33,11 @@ import java.util.Random; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; +import org.jspecify.annotations.NullUnmarked; /** A benchmark comparing the various striped implementations. */ @VmOptions({"-Xms12g", "-Xmx12g", "-d64"}) +@NullUnmarked public class StripedBenchmark { private static final Supplier LOCK_SUPPLIER = new Supplier() { diff --git a/android/guava-tests/test/com/google/common/base/AbstractIteratorTest.java b/android/guava-tests/test/com/google/common/base/AbstractIteratorTest.java index 7dc3d0274017..a81bacf73baa 100644 --- a/android/guava-tests/test/com/google/common/base/AbstractIteratorTest.java +++ b/android/guava-tests/test/com/google/common/base/AbstractIteratorTest.java @@ -28,6 +28,7 @@ import java.util.Iterator; import java.util.NoSuchElementException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@code AbstractIterator}. @@ -35,6 +36,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class AbstractIteratorTest extends TestCase { public void testDefaultBehaviorOfNextAndHasNext() { diff --git a/android/guava-tests/test/com/google/common/base/AsciiTest.java b/android/guava-tests/test/com/google/common/base/AsciiTest.java index 3017289c5077..6faf81046006 100644 --- a/android/guava-tests/test/com/google/common/base/AsciiTest.java +++ b/android/guava-tests/test/com/google/common/base/AsciiTest.java @@ -21,6 +21,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Ascii}. @@ -28,6 +29,7 @@ * @author Craig Berry */ @GwtCompatible +@NullUnmarked public class AsciiTest extends TestCase { /** diff --git a/android/guava-tests/test/com/google/common/base/BenchmarkHelpers.java b/android/guava-tests/test/com/google/common/base/BenchmarkHelpers.java index eda9074b5418..adba32ca9587 100644 --- a/android/guava-tests/test/com/google/common/base/BenchmarkHelpers.java +++ b/android/guava-tests/test/com/google/common/base/BenchmarkHelpers.java @@ -14,12 +14,15 @@ package com.google.common.base; +import org.jspecify.annotations.NullUnmarked; + /** * Common benchmarking utilities. * * @author Christopher Swenson * @author Louis Wasserman */ +@NullUnmarked class BenchmarkHelpers { private static final String WHITESPACE_CHARACTERS = "\u00a0\u180e\u202f\t\n\013\f\r \u0085" diff --git a/android/guava-tests/test/com/google/common/base/CaseFormatTest.java b/android/guava-tests/test/com/google/common/base/CaseFormatTest.java index 57c7e1725672..ac9efb1f7fea 100644 --- a/android/guava-tests/test/com/google/common/base/CaseFormatTest.java +++ b/android/guava-tests/test/com/google/common/base/CaseFormatTest.java @@ -28,6 +28,7 @@ import com.google.common.testing.NullPointerTester; import com.google.common.testing.SerializableTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link CaseFormat}. @@ -35,6 +36,7 @@ * @author Mike Bostock */ @GwtCompatible(emulated = true) +@NullUnmarked public class CaseFormatTest extends TestCase { public void testIdentity() { diff --git a/android/guava-tests/test/com/google/common/base/CharsetsTest.java b/android/guava-tests/test/com/google/common/base/CharsetsTest.java index 8ff80d0f7e43..94dc1a115e2a 100644 --- a/android/guava-tests/test/com/google/common/base/CharsetsTest.java +++ b/android/guava-tests/test/com/google/common/base/CharsetsTest.java @@ -22,6 +22,7 @@ import java.nio.charset.Charset; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Charsets}. @@ -29,6 +30,7 @@ * @author Mike Bostock */ @GwtCompatible(emulated = true) +@NullUnmarked public class CharsetsTest extends TestCase { @J2ktIncompatible diff --git a/android/guava-tests/test/com/google/common/base/ConverterTest.java b/android/guava-tests/test/com/google/common/base/ConverterTest.java index d74331af2996..d566dcba0ceb 100644 --- a/android/guava-tests/test/com/google/common/base/ConverterTest.java +++ b/android/guava-tests/test/com/google/common/base/ConverterTest.java @@ -29,9 +29,11 @@ import java.util.Iterator; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link Converter}. */ @GwtCompatible(emulated = true) +@NullUnmarked public class ConverterTest extends TestCase { private static final Converter STR_TO_LONG = diff --git a/android/guava-tests/test/com/google/common/base/DefaultsTest.java b/android/guava-tests/test/com/google/common/base/DefaultsTest.java index 43881a70e0a5..3a95ab08f6a1 100644 --- a/android/guava-tests/test/com/google/common/base/DefaultsTest.java +++ b/android/guava-tests/test/com/google/common/base/DefaultsTest.java @@ -20,6 +20,7 @@ import com.google.common.annotations.GwtIncompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Defaults}. @@ -27,6 +28,7 @@ * @author Jige Yu */ @GwtIncompatible +@NullUnmarked public class DefaultsTest extends TestCase { public void testGetDefaultValue() { assertEquals(false, Defaults.defaultValue(boolean.class).booleanValue()); diff --git a/android/guava-tests/test/com/google/common/base/EnumsTest.java b/android/guava-tests/test/com/google/common/base/EnumsTest.java index 26b3a52a376d..394bbd3689b2 100644 --- a/android/guava-tests/test/com/google/common/base/EnumsTest.java +++ b/android/guava-tests/test/com/google/common/base/EnumsTest.java @@ -39,6 +39,7 @@ import java.util.HashSet; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Enums}. @@ -47,6 +48,7 @@ */ @GwtIncompatible @J2ktIncompatible +@NullUnmarked public class EnumsTest extends TestCase { private enum TestEnum { diff --git a/android/guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java b/android/guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java index 923647621376..c4236becab70 100644 --- a/android/guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java +++ b/android/guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java @@ -30,6 +30,7 @@ import java.net.URL; import java.net.URLClassLoader; import java.util.concurrent.atomic.AtomicReference; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -43,6 +44,7 @@ */ @AndroidIncompatible @RunWith(JUnit4.class) +@NullUnmarked public class FinalizableReferenceQueueClassLoaderUnloadingTest { /* diff --git a/android/guava-tests/test/com/google/common/base/FinalizableReferenceQueueTest.java b/android/guava-tests/test/com/google/common/base/FinalizableReferenceQueueTest.java index 534728db0942..fb4ca4da972c 100644 --- a/android/guava-tests/test/com/google/common/base/FinalizableReferenceQueueTest.java +++ b/android/guava-tests/test/com/google/common/base/FinalizableReferenceQueueTest.java @@ -35,6 +35,7 @@ import java.net.URLClassLoader; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.After; import org.junit.Test; @@ -52,6 +53,7 @@ @AndroidIncompatible @GwtIncompatible @RunWith(JUnit4.class) +@NullUnmarked public class FinalizableReferenceQueueTest { private @Nullable FinalizableReferenceQueue frq; diff --git a/android/guava-tests/test/com/google/common/base/MoreObjectsTest.java b/android/guava-tests/test/com/google/common/base/MoreObjectsTest.java index 9b3bbadd1b7d..3b7c8068953b 100644 --- a/android/guava-tests/test/com/google/common/base/MoreObjectsTest.java +++ b/android/guava-tests/test/com/google/common/base/MoreObjectsTest.java @@ -23,9 +23,11 @@ import com.google.common.annotations.J2ktIncompatible; import com.google.common.testing.NullPointerTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link MoreObjects}. */ @GwtCompatible(emulated = true) +@NullUnmarked public class MoreObjectsTest extends TestCase { public void testFirstNonNull_withNonNull() { String s1 = "foo"; diff --git a/android/guava-tests/test/com/google/common/base/ObjectsTest.java b/android/guava-tests/test/com/google/common/base/ObjectsTest.java index ff81db62d1d2..4d277975c3ae 100644 --- a/android/guava-tests/test/com/google/common/base/ObjectsTest.java +++ b/android/guava-tests/test/com/google/common/base/ObjectsTest.java @@ -21,6 +21,7 @@ import com.google.common.annotations.J2ktIncompatible; import com.google.common.testing.NullPointerTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Objects}. @@ -28,6 +29,7 @@ * @author Laurence Gonsalves */ @GwtCompatible(emulated = true) +@NullUnmarked public class ObjectsTest extends TestCase { public void testEqual() throws Exception { diff --git a/android/guava-tests/test/com/google/common/base/PackageSanityTests.java b/android/guava-tests/test/com/google/common/base/PackageSanityTests.java index c9eeed0decf7..7b77c80c7f63 100644 --- a/android/guava-tests/test/com/google/common/base/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/base/PackageSanityTests.java @@ -18,10 +18,12 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** Basic sanity tests for classes in {@code common.base}. */ @GwtIncompatible +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { // package private classes like FunctionalEquivalence are tested through the public API. diff --git a/android/guava-tests/test/com/google/common/base/StandardSystemPropertyTest.java b/android/guava-tests/test/com/google/common/base/StandardSystemPropertyTest.java index f4907a337e1e..6c898bf3dc52 100644 --- a/android/guava-tests/test/com/google/common/base/StandardSystemPropertyTest.java +++ b/android/guava-tests/test/com/google/common/base/StandardSystemPropertyTest.java @@ -22,6 +22,7 @@ import com.google.common.annotations.GwtIncompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link StandardSystemProperty}. @@ -29,6 +30,7 @@ * @author Kurt Alfred Kluever */ @GwtIncompatible +@NullUnmarked public class StandardSystemPropertyTest extends TestCase { public void testGetKeyMatchesString() { diff --git a/android/guava-tests/test/com/google/common/base/StopwatchTest.java b/android/guava-tests/test/com/google/common/base/StopwatchTest.java index abe0f438fb2a..53d583b1b17b 100644 --- a/android/guava-tests/test/com/google/common/base/StopwatchTest.java +++ b/android/guava-tests/test/com/google/common/base/StopwatchTest.java @@ -25,6 +25,7 @@ import com.google.common.annotations.J2ktIncompatible; import com.google.common.testing.FakeTicker; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Stopwatch}. @@ -32,6 +33,7 @@ * @author Kevin Bourrillion */ @GwtCompatible +@NullUnmarked public class StopwatchTest extends TestCase { private final FakeTicker ticker = new FakeTicker(); diff --git a/android/guava-tests/test/com/google/common/base/TestExceptions.java b/android/guava-tests/test/com/google/common/base/TestExceptions.java index ae911419bd11..3eadceb43b43 100644 --- a/android/guava-tests/test/com/google/common/base/TestExceptions.java +++ b/android/guava-tests/test/com/google/common/base/TestExceptions.java @@ -17,9 +17,11 @@ package com.google.common.base; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; /** Exception classes for use in tests. */ @GwtCompatible +@NullUnmarked final class TestExceptions { static class SomeError extends Error {} diff --git a/android/guava-tests/test/com/google/common/base/ThrowablesTest.java b/android/guava-tests/test/com/google/common/base/ThrowablesTest.java index 6e00c08fb6a8..4ae5ad110da3 100644 --- a/android/guava-tests/test/com/google/common/base/ThrowablesTest.java +++ b/android/guava-tests/test/com/google/common/base/ThrowablesTest.java @@ -46,6 +46,7 @@ import com.google.common.testing.NullPointerTester; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Throwables}. @@ -54,6 +55,7 @@ */ @GwtCompatible(emulated = true) @SuppressWarnings("deprecation") // tests of numerous deprecated methods +@NullUnmarked public class ThrowablesTest extends TestCase { // We're testing that the method is in fact equivalent to throwing the exception directly. @SuppressWarnings("ThrowIfUncheckedKnownUnchecked") diff --git a/android/guava-tests/test/com/google/common/base/ToStringHelperTest.java b/android/guava-tests/test/com/google/common/base/ToStringHelperTest.java index c0bf9b25ce76..5240fc877fa8 100644 --- a/android/guava-tests/test/com/google/common/base/ToStringHelperTest.java +++ b/android/guava-tests/test/com/google/common/base/ToStringHelperTest.java @@ -28,6 +28,7 @@ import java.util.HashMap; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link MoreObjects#toStringHelper(Object)}. @@ -35,6 +36,7 @@ * @author Jason Lee */ @GwtCompatible +@NullUnmarked public class ToStringHelperTest extends TestCase { @GwtIncompatible // Class names are obfuscated in GWT diff --git a/android/guava-tests/test/com/google/common/base/UnannotatedJavaClass.java b/android/guava-tests/test/com/google/common/base/UnannotatedJavaClass.java index 521035c61752..0d7cc9cae8e8 100644 --- a/android/guava-tests/test/com/google/common/base/UnannotatedJavaClass.java +++ b/android/guava-tests/test/com/google/common/base/UnannotatedJavaClass.java @@ -16,7 +16,10 @@ package com.google.common.base; +import org.jspecify.annotations.NullUnmarked; + /** Class containing an unannotated Java method for use from {@code OptionalExtensionsTest}. */ +@NullUnmarked final class UnannotatedJavaClass { static Object getNull() { return null; diff --git a/android/guava-tests/test/com/google/common/base/Utf8Test.java b/android/guava-tests/test/com/google/common/base/Utf8Test.java index b4dfcb5c1991..72da351b5e24 100644 --- a/android/guava-tests/test/com/google/common/base/Utf8Test.java +++ b/android/guava-tests/test/com/google/common/base/Utf8Test.java @@ -32,6 +32,7 @@ import java.util.HashMap; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Utf8}. @@ -41,6 +42,7 @@ * @author Clément Roux */ @GwtCompatible(emulated = true) +@NullUnmarked public class Utf8Test extends TestCase { private static final ImmutableList ILL_FORMED_STRINGS; diff --git a/android/guava-tests/test/com/google/common/base/VerifyTest.java b/android/guava-tests/test/com/google/common/base/VerifyTest.java index 6257c5eb7faa..6a1e8a0a0785 100644 --- a/android/guava-tests/test/com/google/common/base/VerifyTest.java +++ b/android/guava-tests/test/com/google/common/base/VerifyTest.java @@ -24,9 +24,11 @@ import com.google.common.annotations.J2ktIncompatible; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit test for {@link com.google.common.base.Verify}. */ @GwtCompatible(emulated = true) +@NullUnmarked public class VerifyTest extends TestCase { public void testVerify_simple_success() { verify(true); diff --git a/android/guava-tests/test/com/google/common/cache/AbstractCacheTest.java b/android/guava-tests/test/com/google/common/cache/AbstractCacheTest.java index 7793a4ff365d..856164a6c331 100644 --- a/android/guava-tests/test/com/google/common/cache/AbstractCacheTest.java +++ b/android/guava-tests/test/com/google/common/cache/AbstractCacheTest.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -33,6 +34,7 @@ * * @author Charles Fry */ +@NullUnmarked public class AbstractCacheTest extends TestCase { public void testGetIfPresent() { diff --git a/android/guava-tests/test/com/google/common/cache/AbstractLoadingCacheTest.java b/android/guava-tests/test/com/google/common/cache/AbstractLoadingCacheTest.java index c029ff3d00a2..2cb08ef6dc03 100644 --- a/android/guava-tests/test/com/google/common/cache/AbstractLoadingCacheTest.java +++ b/android/guava-tests/test/com/google/common/cache/AbstractLoadingCacheTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -31,6 +32,7 @@ * * @author Charles Fry */ +@NullUnmarked public class AbstractLoadingCacheTest extends TestCase { public void testGetUnchecked_checked() { diff --git a/android/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java b/android/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java index 3caca22bb180..695298f6ebc8 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java +++ b/android/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -34,6 +35,7 @@ * * @author mike nonemacher */ +@NullUnmarked class CacheBuilderFactory { // Default values contain only 'null', which means don't call the CacheBuilder method (just give // the CacheBuilder default). diff --git a/android/guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java b/android/guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java index f36a873b7a06..087cbb48980c 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java @@ -32,6 +32,7 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test suite for {@link CacheBuilder}. TODO(cpovirk): merge into CacheBuilderTest? @@ -39,6 +40,7 @@ * @author Jon Donovan */ @GwtCompatible +@NullUnmarked public class CacheBuilderGwtTest extends TestCase { private FakeTicker fakeTicker; diff --git a/android/guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java b/android/guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java index 57d7b4aa6bb0..670275b08252 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java @@ -28,6 +28,7 @@ import com.google.common.cache.LocalCache.Strength; import com.google.common.testing.EqualsTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests CacheBuilderSpec. TODO(user): tests of a few invalid input conditions, boundary @@ -35,6 +36,7 @@ * * @author Adam Winer */ +@NullUnmarked public class CacheBuilderSpecTest extends TestCase { public void testParse_empty() { CacheBuilderSpec spec = parse(""); diff --git a/android/guava-tests/test/com/google/common/cache/CacheBuilderTest.java b/android/guava-tests/test/com/google/common/cache/CacheBuilderTest.java index 1f3923bdfc2d..45314e0b85aa 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheBuilderTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheBuilderTest.java @@ -47,11 +47,13 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for CacheBuilder. */ @GwtCompatible(emulated = true) // We are intentionally testing the TimeUnit overloads, too. @SuppressWarnings("LongTimeUnit_ExpireAfterWrite_Seconds") +@NullUnmarked public class CacheBuilderTest extends TestCase { public void testNewBuilder() { diff --git a/android/guava-tests/test/com/google/common/cache/CacheEvictionTest.java b/android/guava-tests/test/com/google/common/cache/CacheEvictionTest.java index dce8c88d0389..1f0d7b41f650 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheEvictionTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheEvictionTest.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests relating to cache eviction: what does and doesn't count toward maximumSize, what happens @@ -36,6 +37,7 @@ * * @author mike nonemacher */ +@NullUnmarked public class CacheEvictionTest extends TestCase { static final int MAX_SIZE = 100; diff --git a/android/guava-tests/test/com/google/common/cache/CacheExpirationTest.java b/android/guava-tests/test/com/google/common/cache/CacheExpirationTest.java index 4d3924de2f0e..86d3e4af648c 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheExpirationTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheExpirationTest.java @@ -32,6 +32,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests relating to cache expiration: make sure entries expire at the right times, make sure @@ -40,6 +41,7 @@ * @author mike nonemacher */ @SuppressWarnings("deprecation") // tests of deprecated method +@NullUnmarked public class CacheExpirationTest extends TestCase { private static final long EXPIRING_TIME = 1000; diff --git a/android/guava-tests/test/com/google/common/cache/CacheLoaderTest.java b/android/guava-tests/test/com/google/common/cache/CacheLoaderTest.java index 5ecedcf5a98b..9c8cd2819658 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheLoaderTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheLoaderTest.java @@ -28,12 +28,14 @@ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link CacheLoader}. * * @author Charles Fry */ +@NullUnmarked public class CacheLoaderTest extends TestCase { private static class QueuingExecutor implements Executor { diff --git a/android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java b/android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java index 6344109dba01..cd37da76bfba 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java @@ -55,12 +55,14 @@ import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.logging.LogRecord; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests relating to cache loading: concurrent loading, exceptions during loading, etc. * * @author mike nonemacher */ +@NullUnmarked public class CacheLoadingTest extends TestCase { TestLogHandler logHandler; diff --git a/android/guava-tests/test/com/google/common/cache/CacheManualTest.java b/android/guava-tests/test/com/google/common/cache/CacheManualTest.java index abe0b15eb6cc..a2cf24dcef28 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheManualTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheManualTest.java @@ -19,8 +19,12 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author Charles Fry */ +/** + * @author Charles Fry + */ +@NullUnmarked public class CacheManualTest extends TestCase { public void testGetIfPresent() { diff --git a/android/guava-tests/test/com/google/common/cache/CacheReferencesTest.java b/android/guava-tests/test/com/google/common/cache/CacheReferencesTest.java index 63af4b59c9f2..a11d14a090fd 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheReferencesTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheReferencesTest.java @@ -26,6 +26,7 @@ import com.google.common.collect.Iterables; import java.lang.ref.WeakReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests of basic {@link LoadingCache} operations with all possible combinations of key & value @@ -33,6 +34,7 @@ * * @author mike nonemacher */ +@NullUnmarked public class CacheReferencesTest extends TestCase { private static final CacheLoader KEY_TO_STRING_LOADER = diff --git a/android/guava-tests/test/com/google/common/cache/CacheRefreshTest.java b/android/guava-tests/test/com/google/common/cache/CacheRefreshTest.java index 823ad360f8b9..6a7948c470dc 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheRefreshTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheRefreshTest.java @@ -20,12 +20,14 @@ import com.google.common.cache.TestingCacheLoaders.IncrementingLoader; import com.google.common.testing.FakeTicker; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests relating to automatic cache refreshing. * * @author Charles Fry */ +@NullUnmarked public class CacheRefreshTest extends TestCase { public void testAutoRefresh() { FakeTicker ticker = new FakeTicker(); diff --git a/android/guava-tests/test/com/google/common/cache/CacheStatsTest.java b/android/guava-tests/test/com/google/common/cache/CacheStatsTest.java index 73efa0e1f8f2..cfd174aea242 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheStatsTest.java +++ b/android/guava-tests/test/com/google/common/cache/CacheStatsTest.java @@ -19,12 +19,14 @@ import static com.google.common.truth.Truth.assertThat; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link CacheStats}. * * @author Charles Fry */ +@NullUnmarked public class CacheStatsTest extends TestCase { public void testEmpty() { diff --git a/android/guava-tests/test/com/google/common/cache/CacheTesting.java b/android/guava-tests/test/com/google/common/cache/CacheTesting.java index bf792e70e042..31a126524870 100644 --- a/android/guava-tests/test/com/google/common/cache/CacheTesting.java +++ b/android/guava-tests/test/com/google/common/cache/CacheTesting.java @@ -45,6 +45,7 @@ import java.util.Set; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicReferenceArray; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -53,6 +54,7 @@ * @author mike nonemacher */ @SuppressWarnings("GuardedBy") // TODO(b/35466881): Fix or suppress. +@NullUnmarked class CacheTesting { /** diff --git a/android/guava-tests/test/com/google/common/cache/EmptyCachesTest.java b/android/guava-tests/test/com/google/common/cache/EmptyCachesTest.java index ccdcb955d572..f93568bc29a5 100644 --- a/android/guava-tests/test/com/google/common/cache/EmptyCachesTest.java +++ b/android/guava-tests/test/com/google/common/cache/EmptyCachesTest.java @@ -33,6 +33,7 @@ import java.util.Set; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * {@link LoadingCache} tests that deal with empty caches. @@ -40,6 +41,7 @@ * @author mike nonemacher */ +@NullUnmarked public class EmptyCachesTest extends TestCase { public void testEmpty() { diff --git a/android/guava-tests/test/com/google/common/cache/ForwardingCacheTest.java b/android/guava-tests/test/com/google/common/cache/ForwardingCacheTest.java index 639a208bd5cd..76de76c3707c 100644 --- a/android/guava-tests/test/com/google/common/cache/ForwardingCacheTest.java +++ b/android/guava-tests/test/com/google/common/cache/ForwardingCacheTest.java @@ -24,12 +24,14 @@ import com.google.common.collect.ImmutableMap; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingCache}. * * @author Charles Fry */ +@NullUnmarked public class ForwardingCacheTest extends TestCase { private Cache forward; private Cache mock; diff --git a/android/guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java b/android/guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java index fe41612132b1..cdef91afe699 100644 --- a/android/guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java +++ b/android/guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java @@ -24,12 +24,14 @@ import com.google.common.collect.ImmutableMap; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingLoadingCache}. * * @author Charles Fry */ +@NullUnmarked public class ForwardingLoadingCacheTest extends TestCase { private LoadingCache forward; private LoadingCache mock; diff --git a/android/guava-tests/test/com/google/common/cache/LocalCacheTest.java b/android/guava-tests/test/com/google/common/cache/LocalCacheTest.java index 1a6c7d471e5e..1d0979297dca 100644 --- a/android/guava-tests/test/com/google/common/cache/LocalCacheTest.java +++ b/android/guava-tests/test/com/google/common/cache/LocalCacheTest.java @@ -86,10 +86,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; -/** @author Charles Fry */ +/** + * @author Charles Fry + */ @SuppressWarnings("GuardedBy") // TODO(b/35466881): Fix or suppress. +@NullUnmarked public class LocalCacheTest extends TestCase { private static class TestStringCacheGenerator extends TestStringMapGenerator { private final CacheBuilder builder; diff --git a/android/guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java b/android/guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java index 318bebc2f53c..8111b2e6ad00 100644 --- a/android/guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java +++ b/android/guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java @@ -34,8 +34,12 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author Charles Fry */ +/** + * @author Charles Fry + */ +@NullUnmarked public class LocalLoadingCacheTest extends TestCase { private static LocalLoadingCache makeCache( diff --git a/android/guava-tests/test/com/google/common/cache/LongAdderTest.java b/android/guava-tests/test/com/google/common/cache/LongAdderTest.java index 876f90748880..8a5bed0bb235 100644 --- a/android/guava-tests/test/com/google/common/cache/LongAdderTest.java +++ b/android/guava-tests/test/com/google/common/cache/LongAdderTest.java @@ -17,8 +17,10 @@ import static com.google.common.truth.Truth.assertThat; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link LongAdder}. */ +@NullUnmarked public class LongAdderTest extends TestCase { /** diff --git a/android/guava-tests/test/com/google/common/cache/NullCacheTest.java b/android/guava-tests/test/com/google/common/cache/NullCacheTest.java index 6fa8f7b13ce4..23ccbe9ff0eb 100644 --- a/android/guava-tests/test/com/google/common/cache/NullCacheTest.java +++ b/android/guava-tests/test/com/google/common/cache/NullCacheTest.java @@ -26,12 +26,14 @@ import com.google.common.cache.TestingRemovalListeners.QueuingRemovalListener; import com.google.common.util.concurrent.UncheckedExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * {@link LoadingCache} tests for caches with a maximum size of zero. * * @author mike nonemacher */ +@NullUnmarked public class NullCacheTest extends TestCase { QueuingRemovalListener listener; diff --git a/android/guava-tests/test/com/google/common/cache/PackageSanityTests.java b/android/guava-tests/test/com/google/common/cache/PackageSanityTests.java index 64cdc13375f2..e4909906e5d8 100644 --- a/android/guava-tests/test/com/google/common/cache/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/cache/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.cache; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -24,6 +25,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { setDefault( diff --git a/android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java b/android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java index 8ebeeb16a540..81eea6c63ff3 100644 --- a/android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java +++ b/android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java @@ -38,6 +38,7 @@ import java.util.Map.Entry; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * {@link LoadingCache} tests that deal with caches that actually contain some key-value mappings. @@ -45,6 +46,7 @@ * @author mike nonemacher */ +@NullUnmarked public class PopulatedCachesTest extends TestCase { // we use integers as keys; make sure the range covers some values that ARE cached by // Integer.valueOf(int), and some that are not cached. (127 is the highest cached value.) diff --git a/android/guava-tests/test/com/google/common/cache/RemovalNotificationTest.java b/android/guava-tests/test/com/google/common/cache/RemovalNotificationTest.java index 9cd587db7c82..12d6e0e0cfcd 100644 --- a/android/guava-tests/test/com/google/common/cache/RemovalNotificationTest.java +++ b/android/guava-tests/test/com/google/common/cache/RemovalNotificationTest.java @@ -18,12 +18,14 @@ import com.google.common.testing.EqualsTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests of {@link RemovalNotification}. * * @author Ben Yu */ +@NullUnmarked public class RemovalNotificationTest extends TestCase { public void testEquals() { diff --git a/android/guava-tests/test/com/google/common/cache/TestingCacheLoaders.java b/android/guava-tests/test/com/google/common/cache/TestingCacheLoaders.java index cae57e532002..239c71fceaa6 100644 --- a/android/guava-tests/test/com/google/common/cache/TestingCacheLoaders.java +++ b/android/guava-tests/test/com/google/common/cache/TestingCacheLoaders.java @@ -23,6 +23,7 @@ import com.google.common.util.concurrent.ListenableFuture; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -31,6 +32,7 @@ * @author mike nonemacher */ @GwtCompatible(emulated = true) +@NullUnmarked class TestingCacheLoaders { /** diff --git a/android/guava-tests/test/com/google/common/cache/TestingRemovalListeners.java b/android/guava-tests/test/com/google/common/cache/TestingRemovalListeners.java index 698467fceb07..4aab99e1aaec 100644 --- a/android/guava-tests/test/com/google/common/cache/TestingRemovalListeners.java +++ b/android/guava-tests/test/com/google/common/cache/TestingRemovalListeners.java @@ -18,6 +18,7 @@ import com.google.common.annotations.GwtIncompatible; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; +import org.jspecify.annotations.NullUnmarked; /** * Utility {@link RemovalListener} implementations intended for use in testing. @@ -25,6 +26,7 @@ * @author mike nonemacher */ @GwtCompatible(emulated = true) +@NullUnmarked class TestingRemovalListeners { /** Returns a new no-op {@code RemovalListener}. */ diff --git a/android/guava-tests/test/com/google/common/cache/TestingWeighers.java b/android/guava-tests/test/com/google/common/cache/TestingWeighers.java index b09fdf03e78a..db508aae5749 100644 --- a/android/guava-tests/test/com/google/common/cache/TestingWeighers.java +++ b/android/guava-tests/test/com/google/common/cache/TestingWeighers.java @@ -14,11 +14,14 @@ package com.google.common.cache; +import org.jspecify.annotations.NullUnmarked; + /** * Utility {@link Weigher} implementations intended for use in testing. * * @author Charles Fry */ +@NullUnmarked public class TestingWeighers { /** Returns a {@link Weigher} that returns the given {@code constant} for every request. */ diff --git a/android/guava-tests/test/com/google/common/collect/AbstractBiMapTest.java b/android/guava-tests/test/com/google/common/collect/AbstractBiMapTest.java index e430f0e523b9..b0e4055ab9cb 100644 --- a/android/guava-tests/test/com/google/common/collect/AbstractBiMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/AbstractBiMapTest.java @@ -18,12 +18,14 @@ import java.util.Iterator; import java.util.Map.Entry; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code AbstractBiMap}. * * @author Mike Bostock */ +@NullUnmarked public class AbstractBiMapTest extends TestCase { // The next two tests verify that map entries are not accessed after they're diff --git a/android/guava-tests/test/com/google/common/collect/AbstractImmutableBiMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/AbstractImmutableBiMapMapInterfaceTest.java index 1588bf61321a..5a4934ebcc84 100644 --- a/android/guava-tests/test/com/google/common/collect/AbstractImmutableBiMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/AbstractImmutableBiMapMapInterfaceTest.java @@ -23,8 +23,10 @@ import com.google.common.collect.testing.MapInterfaceTest; import java.util.Map; import java.util.Map.Entry; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked abstract class AbstractImmutableBiMapMapInterfaceTest extends MapInterfaceTest { AbstractImmutableBiMapMapInterfaceTest() { super(false, false, false, false, false); diff --git a/android/guava-tests/test/com/google/common/collect/AbstractImmutableMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/AbstractImmutableMapMapInterfaceTest.java index b31675647ebe..29c57ec3cc25 100644 --- a/android/guava-tests/test/com/google/common/collect/AbstractImmutableMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/AbstractImmutableMapMapInterfaceTest.java @@ -24,8 +24,10 @@ import com.google.common.collect.testing.MinimalSet; import java.util.Map; import java.util.Map.Entry; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked abstract class AbstractImmutableMapMapInterfaceTest extends MapInterfaceTest { AbstractImmutableMapMapInterfaceTest() { super(false, false, false, false, false); diff --git a/android/guava-tests/test/com/google/common/collect/AbstractImmutableSortedMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/AbstractImmutableSortedMapMapInterfaceTest.java index 612768d329e9..73ac6f385761 100644 --- a/android/guava-tests/test/com/google/common/collect/AbstractImmutableSortedMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/AbstractImmutableSortedMapMapInterfaceTest.java @@ -24,8 +24,10 @@ import java.util.Map; import java.util.Map.Entry; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public abstract class AbstractImmutableSortedMapMapInterfaceTest extends SortedMapInterfaceTest { public AbstractImmutableSortedMapMapInterfaceTest() { diff --git a/android/guava-tests/test/com/google/common/collect/AbstractRangeSetTest.java b/android/guava-tests/test/com/google/common/collect/AbstractRangeSetTest.java index 9319bb5a8ae1..90b8a4792aad 100644 --- a/android/guava-tests/test/com/google/common/collect/AbstractRangeSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/AbstractRangeSetTest.java @@ -19,6 +19,7 @@ import java.util.List; import java.util.NoSuchElementException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Base class for {@link RangeSet} tests. @@ -26,6 +27,7 @@ * @author Louis Wasserman */ @GwtIncompatible // TreeRangeSet +@NullUnmarked public abstract class AbstractRangeSetTest extends TestCase { public static void testInvariants(RangeSet rangeSet) { testInvariantsInternal(rangeSet); diff --git a/android/guava-tests/test/com/google/common/collect/ArrayTableColumnMapTest.java b/android/guava-tests/test/com/google/common/collect/ArrayTableColumnMapTest.java index 8adf4e4e165d..f73153084816 100644 --- a/android/guava-tests/test/com/google/common/collect/ArrayTableColumnMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ArrayTableColumnMapTest.java @@ -21,8 +21,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.TableCollectionTest.ColumnMapTests; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // TODO(hhchan): ArrayTable +@NullUnmarked public class ArrayTableColumnMapTest extends ColumnMapTests { public ArrayTableColumnMapTest() { super(true, false, false, false); diff --git a/android/guava-tests/test/com/google/common/collect/ArrayTableColumnTest.java b/android/guava-tests/test/com/google/common/collect/ArrayTableColumnTest.java index 208f70085061..902e5ea7b00f 100644 --- a/android/guava-tests/test/com/google/common/collect/ArrayTableColumnTest.java +++ b/android/guava-tests/test/com/google/common/collect/ArrayTableColumnTest.java @@ -21,8 +21,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.TableCollectionTest.ColumnTests; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // TODO(hhchan): ArrayTable +@NullUnmarked public class ArrayTableColumnTest extends ColumnTests { public ArrayTableColumnTest() { super(true, true, false, false, false); diff --git a/android/guava-tests/test/com/google/common/collect/ArrayTableRowMapTest.java b/android/guava-tests/test/com/google/common/collect/ArrayTableRowMapTest.java index 8e1479c86377..082a43596f9d 100644 --- a/android/guava-tests/test/com/google/common/collect/ArrayTableRowMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ArrayTableRowMapTest.java @@ -21,8 +21,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.TableCollectionTest.RowMapTests; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // TODO(hhchan): ArrayTable +@NullUnmarked public class ArrayTableRowMapTest extends RowMapTests { public ArrayTableRowMapTest() { super(true, false, false, false); diff --git a/android/guava-tests/test/com/google/common/collect/ArrayTableRowTest.java b/android/guava-tests/test/com/google/common/collect/ArrayTableRowTest.java index ed83526c658f..9d8370717961 100644 --- a/android/guava-tests/test/com/google/common/collect/ArrayTableRowTest.java +++ b/android/guava-tests/test/com/google/common/collect/ArrayTableRowTest.java @@ -21,8 +21,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.TableCollectionTest.RowTests; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // TODO(hhchan): ArrayTable +@NullUnmarked public class ArrayTableRowTest extends RowTests { public ArrayTableRowTest() { super(true, true, false, false, false); diff --git a/android/guava-tests/test/com/google/common/collect/Base.java b/android/guava-tests/test/com/google/common/collect/Base.java index b68bd7f651fa..d39cd87c57a4 100644 --- a/android/guava-tests/test/com/google/common/collect/Base.java +++ b/android/guava-tests/test/com/google/common/collect/Base.java @@ -18,10 +18,12 @@ import com.google.common.annotations.GwtCompatible; import java.io.Serializable; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** Simple base class to verify that we handle generics correctly. */ @GwtCompatible +@NullUnmarked class Base implements Comparable, Serializable { private final String s; diff --git a/android/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java b/android/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java index d0475fc47d65..45015d01e6ab 100644 --- a/android/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java +++ b/android/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java @@ -33,12 +33,14 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentSkipListMap; +import org.jspecify.annotations.NullUnmarked; /** * Helper classes for various benchmarks. * * @author Christopher Swenson */ +@NullUnmarked final class BenchmarkHelpers { /** So far, this is the best way to test various implementations of {@link Set} subclasses. */ public interface CollectionsImplEnum { diff --git a/android/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java b/android/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java index 839b0b505d88..86624974fd41 100644 --- a/android/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java +++ b/android/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -28,6 +29,7 @@ * * @author Nicholaus Shupe */ +@NullUnmarked class CollectionBenchmarkSampleData { private final boolean isUserTypeFast; private final SpecialRandom random; diff --git a/android/guava-tests/test/com/google/common/collect/Collections2FilterArrayListTest.java b/android/guava-tests/test/com/google/common/collect/Collections2FilterArrayListTest.java index 8a783ec6e823..4c3ef4b26098 100644 --- a/android/guava-tests/test/com/google/common/collect/Collections2FilterArrayListTest.java +++ b/android/guava-tests/test/com/google/common/collect/Collections2FilterArrayListTest.java @@ -19,7 +19,9 @@ import com.google.common.base.Predicate; import com.google.common.collect.FilteredCollectionsTestUtil.AbstractFilteredCollectionTest; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class Collections2FilterArrayListTest extends AbstractFilteredCollectionTest> { @Override diff --git a/android/guava-tests/test/com/google/common/collect/CompactHashMapTest.java b/android/guava-tests/test/com/google/common/collect/CompactHashMapTest.java index 1ea73b1cc032..c6b3d0c39eb7 100644 --- a/android/guava-tests/test/com/google/common/collect/CompactHashMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/CompactHashMapTest.java @@ -30,12 +30,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code CompactHashMap}. * * @author Louis Wasserman */ +@NullUnmarked public class CompactHashMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/android/guava-tests/test/com/google/common/collect/CompactHashSetTest.java b/android/guava-tests/test/com/google/common/collect/CompactHashSetTest.java index 2c68585b217e..1fe94825fecc 100644 --- a/android/guava-tests/test/com/google/common/collect/CompactHashSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/CompactHashSetTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for CompactHashSet. @@ -39,6 +40,7 @@ * @author Dimitris Andreou */ @GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array +@NullUnmarked public class CompactHashSetTest extends TestCase { public static Test suite() { List> allFeatures = diff --git a/android/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java b/android/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java index b2db8c562fc2..1b6c58c61410 100644 --- a/android/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java @@ -29,12 +29,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code CompactLinkedHashMap}. * * @author Louis Wasserman */ +@NullUnmarked public class CompactLinkedHashMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/android/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java b/android/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java index fef992e90688..6996938a09f8 100644 --- a/android/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for CompactLinkedHashSet. @@ -39,6 +40,7 @@ * @author Dimitris Andreou */ @GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array +@NullUnmarked public class CompactLinkedHashSetTest extends TestCase { public static Test suite() { List> allFeatures = diff --git a/android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java b/android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java index 425808658c06..aa7836dfe39f 100644 --- a/android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java +++ b/android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java @@ -34,6 +34,7 @@ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Basher test for {@link ConcurrentHashMultiset}: start a bunch of threads, have each of them do @@ -44,6 +45,7 @@ * @author mike nonemacher */ +@NullUnmarked public class ConcurrentHashMultisetBasherTest extends TestCase { public void testAddAndRemove_concurrentHashMap() throws Exception { diff --git a/android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java b/android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java index f7ffbc92f2f9..d211a0bed2cd 100644 --- a/android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java +++ b/android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java @@ -40,6 +40,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test case for {@link ConcurrentHashMultiset}. @@ -47,6 +48,7 @@ * @author Cliff L. Biffle * @author mike nonemacher */ +@NullUnmarked public class ConcurrentHashMultisetTest extends TestCase { public static Test suite() { diff --git a/android/guava-tests/test/com/google/common/collect/ContiguousSetTest.java b/android/guava-tests/test/com/google/common/collect/ContiguousSetTest.java index abca6e75e499..bf53d89a0dd5 100644 --- a/android/guava-tests/test/com/google/common/collect/ContiguousSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/ContiguousSetTest.java @@ -45,11 +45,13 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * @author Gregory Kick */ @GwtCompatible(emulated = true) +@NullUnmarked public class ContiguousSetTest extends TestCase { private static final DiscreteDomain NOT_EQUAL_TO_INTEGERS = new DiscreteDomain() { diff --git a/android/guava-tests/test/com/google/common/collect/Derived.java b/android/guava-tests/test/com/google/common/collect/Derived.java index 995c42be8136..9d3c0a2a0a71 100644 --- a/android/guava-tests/test/com/google/common/collect/Derived.java +++ b/android/guava-tests/test/com/google/common/collect/Derived.java @@ -17,9 +17,11 @@ package com.google.common.collect; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; /** Simple derived class to verify that we handle generics correctly. */ @GwtCompatible +@NullUnmarked class Derived extends Base { public Derived(String s) { super(s); diff --git a/android/guava-tests/test/com/google/common/collect/DiscreteDomainTest.java b/android/guava-tests/test/com/google/common/collect/DiscreteDomainTest.java index bd7fa8b646db..c11828ad39dc 100644 --- a/android/guava-tests/test/com/google/common/collect/DiscreteDomainTest.java +++ b/android/guava-tests/test/com/google/common/collect/DiscreteDomainTest.java @@ -22,6 +22,7 @@ import com.google.common.annotations.GwtIncompatible; import java.math.BigInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link DiscreteDomain}. @@ -29,6 +30,7 @@ * @author Chris Povirk */ @GwtIncompatible // SerializableTester +@NullUnmarked public class DiscreteDomainTest extends TestCase { public void testSerialization() { reserializeAndAssert(DiscreteDomain.integers()); diff --git a/android/guava-tests/test/com/google/common/collect/EnumHashBiMapTest.java b/android/guava-tests/test/com/google/common/collect/EnumHashBiMapTest.java index 91d454dbdd8f..b0e0bab7e214 100644 --- a/android/guava-tests/test/com/google/common/collect/EnumHashBiMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/EnumHashBiMapTest.java @@ -38,6 +38,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code EnumHashBiMap}. @@ -46,6 +47,7 @@ */ @J2ktIncompatible // EnumHashBiMap @GwtCompatible(emulated = true) +@NullUnmarked public class EnumHashBiMapTest extends TestCase { private enum Currency { DOLLAR, diff --git a/android/guava-tests/test/com/google/common/collect/EnumMultisetTest.java b/android/guava-tests/test/com/google/common/collect/EnumMultisetTest.java index 4a3fc9d07e4e..3d66d0f58836 100644 --- a/android/guava-tests/test/com/google/common/collect/EnumMultisetTest.java +++ b/android/guava-tests/test/com/google/common/collect/EnumMultisetTest.java @@ -38,6 +38,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for an {@link EnumMultiset}. @@ -46,6 +47,7 @@ */ @GwtCompatible(emulated = true) @J2ktIncompatible // EnumMultiset +@NullUnmarked public class EnumMultisetTest extends TestCase { @J2ktIncompatible diff --git a/android/guava-tests/test/com/google/common/collect/FauxveridesTest.java b/android/guava-tests/test/com/google/common/collect/FauxveridesTest.java index 0e1ec2b6f2df..61db37fec916 100644 --- a/android/guava-tests/test/com/google/common/collect/FauxveridesTest.java +++ b/android/guava-tests/test/com/google/common/collect/FauxveridesTest.java @@ -35,6 +35,7 @@ import java.util.Map; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -44,6 +45,7 @@ * * @author Chris Povirk */ +@NullUnmarked public class FauxveridesTest extends TestCase { public void testImmutableBiMap() { doHasAllFauxveridesTest(ImmutableBiMap.class, ImmutableMap.class); diff --git a/android/guava-tests/test/com/google/common/collect/FilteredCollectionsTestUtil.java b/android/guava-tests/test/com/google/common/collect/FilteredCollectionsTestUtil.java index ee572f309a6a..a965aa31f010 100644 --- a/android/guava-tests/test/com/google/common/collect/FilteredCollectionsTestUtil.java +++ b/android/guava-tests/test/com/google/common/collect/FilteredCollectionsTestUtil.java @@ -32,6 +32,7 @@ import java.util.Set; import java.util.SortedSet; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Class that contains nested abstract tests for filtered collection views, along with their @@ -43,6 +44,7 @@ * TODO(cpovirk): Should all the tests for filtered collections run under GWT, too? Currently, they * don't. */ +@NullUnmarked public final class FilteredCollectionsTestUtil { private static final Predicate EVEN = new Predicate() { diff --git a/android/guava-tests/test/com/google/common/collect/FilteredMultimapTest.java b/android/guava-tests/test/com/google/common/collect/FilteredMultimapTest.java index 3f0a2ea78a92..01010c52eacf 100644 --- a/android/guava-tests/test/com/google/common/collect/FilteredMultimapTest.java +++ b/android/guava-tests/test/com/google/common/collect/FilteredMultimapTest.java @@ -24,6 +24,7 @@ import com.google.common.base.Predicate; import java.util.Map.Entry; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Multimaps} filtering methods. @@ -31,6 +32,7 @@ * @author Jared Levy */ @GwtIncompatible // nottested +@NullUnmarked public class FilteredMultimapTest extends TestCase { private static final Predicate> ENTRY_PREDICATE = diff --git a/android/guava-tests/test/com/google/common/collect/FluentIterableTest.java b/android/guava-tests/test/com/google/common/collect/FluentIterableTest.java index 438a5745c77c..248674e3553f 100644 --- a/android/guava-tests/test/com/google/common/collect/FluentIterableTest.java +++ b/android/guava-tests/test/com/google/common/collect/FluentIterableTest.java @@ -49,6 +49,7 @@ import java.util.concurrent.TimeUnit; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -57,6 +58,7 @@ * @author Marcin Mikosik */ @GwtCompatible(emulated = true) +@NullUnmarked public class FluentIterableTest extends TestCase { @GwtIncompatible // NullPointerTester diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingCollectionTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingCollectionTest.java index 63dd135afaec..f8b9cb02f4f8 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingCollectionTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingCollectionTest.java @@ -29,6 +29,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ForwardingCollection}. @@ -37,6 +38,7 @@ * @author Hayward Chan * @author Louis Wasserman */ +@NullUnmarked public class ForwardingCollectionTest extends TestCase { static final class StandardImplForwardingCollection extends ForwardingCollection { private final Collection backingCollection; diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java index aa1c61c88d35..3bd70757f696 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java @@ -19,12 +19,14 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ForwardingConcurrentMap}. * * @author Jared Levy */ +@NullUnmarked public class ForwardingConcurrentMapTest extends TestCase { private static class TestMap extends ForwardingConcurrentMap { diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingDequeTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingDequeTest.java index 3e7343fc32b1..6811b1c2393a 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingDequeTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingDequeTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.ForwardingWrapperTester; import java.util.Deque; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code ForwardingDeque}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class ForwardingDequeTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingListIteratorTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingListIteratorTest.java index d71ed3b0be7e..e369de4254cd 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingListIteratorTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingListIteratorTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.ForwardingWrapperTester; import java.util.ListIterator; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code ForwardingListIterator}. * * @author Robert Konigsberg */ +@NullUnmarked public class ForwardingListIteratorTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingListMultimapTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingListMultimapTest.java index 9ad47bde144e..ba974e0dc9bd 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingListMultimapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingListMultimapTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.ForwardingWrapperTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingListMultimap}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class ForwardingListMultimapTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingListTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingListTest.java index 881228260edd..d0bac259adac 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingListTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingListTest.java @@ -31,6 +31,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -39,6 +40,7 @@ * @author Robert Konigsberg * @author Louis Wasserman */ +@NullUnmarked public class ForwardingListTest extends TestCase { static final class StandardImplForwardingList extends ForwardingList { private final List backingList; diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingMapTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingMapTest.java index d080c20efd81..39643eb61016 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingMapTest.java @@ -49,6 +49,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -57,6 +58,7 @@ * @author Hayward Chan * @author Louis Wasserman */ +@NullUnmarked public class ForwardingMapTest extends TestCase { static class StandardImplForwardingMap extends ForwardingMap { private final Map backingMap; diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingMultimapTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingMultimapTest.java index 1203428f8095..ec93966ea344 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingMultimapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingMultimapTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.ForwardingWrapperTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingMultimap}. * * @author Hayward Chan */ +@NullUnmarked public class ForwardingMultimapTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingMultisetTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingMultisetTest.java index 5bdb70801b07..e070713703db 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingMultisetTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingMultisetTest.java @@ -34,6 +34,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -42,6 +43,7 @@ * @author Hayward Chan * @author Louis Wasserman */ +@NullUnmarked public class ForwardingMultisetTest extends TestCase { static final class StandardImplForwardingMultiset extends ForwardingMultiset { diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingNavigableMapTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingNavigableMapTest.java index 41e29ec8807f..f85fd1f21b2b 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingNavigableMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingNavigableMapTest.java @@ -39,6 +39,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -47,6 +48,7 @@ * @author Robert Konigsberg * @author Louis Wasserman */ +@NullUnmarked public class ForwardingNavigableMapTest extends TestCase { static class StandardImplForwardingNavigableMap extends ForwardingNavigableMap { private final NavigableMap backingMap; diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingNavigableSetTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingNavigableSetTest.java index 5b4acfdefe89..1fdac7a84137 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingNavigableSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingNavigableSetTest.java @@ -35,6 +35,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -42,6 +43,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class ForwardingNavigableSetTest extends TestCase { static class StandardImplForwardingNavigableSet extends ForwardingNavigableSet { private final NavigableSet backingSet; diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingObjectTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingObjectTest.java index abd14248eecc..efcdf0e87d5e 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingObjectTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingObjectTest.java @@ -21,12 +21,14 @@ import com.google.common.testing.EqualsTester; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code ForwardingObject}. * * @author Mike Bostock */ +@NullUnmarked public class ForwardingObjectTest extends TestCase { public void testEqualsReflexive() { diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingQueueTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingQueueTest.java index 033a96d9e310..a421c0acd577 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingQueueTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingQueueTest.java @@ -29,6 +29,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -37,6 +38,7 @@ * @author Robert Konigsberg * @author Louis Wasserman */ +@NullUnmarked public class ForwardingQueueTest extends TestCase { static final class StandardImplForwardingQueue extends ForwardingQueue { diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingSetMultimapTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingSetMultimapTest.java index ff19b19c0b53..f25b2aa3ee85 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingSetMultimapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingSetMultimapTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.ForwardingWrapperTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingSetMultimap}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class ForwardingSetMultimapTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingSetTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingSetTest.java index 53d12c36afb1..a6f02f7069fc 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingSetTest.java @@ -31,6 +31,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -39,6 +40,7 @@ * @author Robert Konigsberg * @author Louis Wasserman */ +@NullUnmarked public class ForwardingSetTest extends TestCase { static class StandardImplForwardingSet extends ForwardingSet { private final Set backingSet; diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingSortedMapTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingSortedMapTest.java index a4d829085d42..dedb8a8fd361 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingSortedMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingSortedMapTest.java @@ -36,6 +36,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -43,6 +44,7 @@ * * @author Robert KonigsbergSortedMapFeature */ +@NullUnmarked public class ForwardingSortedMapTest extends TestCase { static class StandardImplForwardingSortedMap extends ForwardingSortedMap { private final SortedMap backingSortedMap; diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingSortedMultisetTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingSortedMultisetTest.java index ad4d6e768490..03f3199310e7 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingSortedMultisetTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingSortedMultisetTest.java @@ -31,6 +31,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -38,6 +39,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class ForwardingSortedMultisetTest extends TestCase { static class StandardImplForwardingSortedMultiset extends ForwardingSortedMultiset { private final SortedMultiset backingMultiset; diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingSortedSetMultimapTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingSortedSetMultimapTest.java index c5d91965eda8..237eb0570eac 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingSortedSetMultimapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingSortedSetMultimapTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.ForwardingWrapperTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingSortedSetMultimap}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class ForwardingSortedSetMultimapTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingSortedSetTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingSortedSetTest.java index b19ec90bba5c..9af2ef4f44ef 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingSortedSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingSortedSetTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -39,6 +40,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class ForwardingSortedSetTest extends TestCase { static class StandardImplForwardingSortedSet extends ForwardingSortedSet { private final SortedSet backingSortedSet; diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingTableTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingTableTest.java index 4d8e784354f4..79e6ad3d16a9 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingTableTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingTableTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.ForwardingWrapperTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests {@link ForwardingTable}. * * @author Gregory Kick */ +@NullUnmarked public class ForwardingTableTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableBiMapInverseMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableBiMapInverseMapInterfaceTest.java index 1484171ed7c4..2bcf2a7e0793 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableBiMapInverseMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableBiMapInverseMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableBiMapInverseMapInterfaceTest extends AbstractImmutableBiMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableBiMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableBiMapMapInterfaceTest.java index 6a7846e3dd30..63bd444579db 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableBiMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableBiMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableBiMapMapInterfaceTest extends AbstractImmutableBiMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableClassToInstanceMapTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableClassToInstanceMapTest.java index 04fc2a7d2747..d075f580b036 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableClassToInstanceMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableClassToInstanceMapTest.java @@ -36,6 +36,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -43,6 +44,7 @@ * * @author Kevin Bourrillion */ +@NullUnmarked public class ImmutableClassToInstanceMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableCollectionTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableCollectionTest.java index 260c43459b3d..59d794dfa6f2 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableCollectionTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableCollectionTest.java @@ -17,12 +17,14 @@ package com.google.common.collect; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code ImmutableCollection}. * * @author Louis Wasserman */ +@NullUnmarked public class ImmutableCollectionTest extends TestCase { public void testCapacityExpansion() { assertEquals(1, ImmutableCollection.Builder.expandedCapacity(0, 1)); diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.java index e236ae6a070b..f758b8daf3c2 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.java @@ -32,8 +32,10 @@ import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // reflection +@NullUnmarked public class ImmutableListCopyOfConcurrentlyModifiedInputTest extends TestCase { enum WrapWithIterable { WRAP, diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableMapWithBadHashesMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableMapWithBadHashesMapInterfaceTest.java index 76a1fac5935e..d7e4910b2af8 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableMapWithBadHashesMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableMapWithBadHashesMapInterfaceTest.java @@ -19,8 +19,10 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.collect.testing.SampleElements.Colliders; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableMapWithBadHashesMapInterfaceTest extends AbstractImmutableMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableRangeMapTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableRangeMapTest.java index b615d489812b..f6f87d4dd56e 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableRangeMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableRangeMapTest.java @@ -24,6 +24,7 @@ import java.util.Map.Entry; import java.util.NoSuchElementException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code ImmutableRangeMap}. @@ -31,6 +32,7 @@ * @author Louis Wasserman */ @GwtIncompatible // NavigableMap +@NullUnmarked public class ImmutableRangeMapTest extends TestCase { private static final ImmutableList> RANGES; private static final int MIN_BOUND = 0; diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableRangeSetTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableRangeSetTest.java index ff16280a9d02..527a3dfe8d6e 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableRangeSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableRangeSetTest.java @@ -29,6 +29,7 @@ import java.util.Set; import junit.framework.Test; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ImmutableRangeSet}. @@ -36,6 +37,7 @@ * @author Louis Wasserman */ @GwtIncompatible // ImmutableRangeSet +@NullUnmarked public class ImmutableRangeSetTest extends AbstractRangeSetTest { static final class ImmutableRangeSetIntegerAsSetGenerator implements TestSetGenerator { diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapInclusiveMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapInclusiveMapInterfaceTest.java index 5823d542d275..40848428bf64 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapInclusiveMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapInclusiveMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableSortedMapHeadMapInclusiveMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapMapInterfaceTest.java index ed96bd1f53e4..c22d8063072d 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableSortedMapHeadMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapSubMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapSubMapMapInterfaceTest.java index 7d45663909ce..31faf4bf4c26 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapSubMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapSubMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableSortedMapSubMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapExclusiveMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapExclusiveMapInterfaceTest.java index 15ba852faefd..8752bd4f79bd 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapExclusiveMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapExclusiveMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableSortedMapTailMapExclusiveMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapMapInterfaceTest.java index 54c3aa575adb..5a31f11b46fc 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableSortedMapTailMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java index 532f19628c65..aab304da544b 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java @@ -42,12 +42,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ImmutableSortedMultiset}. * * @author Louis Wasserman */ +@NullUnmarked public class ImmutableSortedMultisetTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/android/guava-tests/test/com/google/common/collect/InternersTest.java b/android/guava-tests/test/com/google/common/collect/InternersTest.java index 8d0239f62e2e..bd28f8a85696 100644 --- a/android/guava-tests/test/com/google/common/collect/InternersTest.java +++ b/android/guava-tests/test/com/google/common/collect/InternersTest.java @@ -25,12 +25,14 @@ import com.google.common.testing.NullPointerTester; import java.lang.ref.WeakReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Interners}. * * @author Kevin Bourrillion */ +@NullUnmarked public class InternersTest extends TestCase { public void testStrong_simplistic() { diff --git a/android/guava-tests/test/com/google/common/collect/IterablesFilterArrayListTest.java b/android/guava-tests/test/com/google/common/collect/IterablesFilterArrayListTest.java index 9cd2d90917c6..ff8706a22071 100644 --- a/android/guava-tests/test/com/google/common/collect/IterablesFilterArrayListTest.java +++ b/android/guava-tests/test/com/google/common/collect/IterablesFilterArrayListTest.java @@ -18,7 +18,9 @@ import com.google.common.base.Predicate; import com.google.common.collect.FilteredCollectionsTestUtil.AbstractFilteredIterableTest; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class IterablesFilterArrayListTest extends AbstractFilteredIterableTest> { @Override diff --git a/android/guava-tests/test/com/google/common/collect/LenientSerializableTester.java b/android/guava-tests/test/com/google/common/collect/LenientSerializableTester.java index 8c346e61842f..51378a31b49e 100644 --- a/android/guava-tests/test/com/google/common/collect/LenientSerializableTester.java +++ b/android/guava-tests/test/com/google/common/collect/LenientSerializableTester.java @@ -27,6 +27,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Collection; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; /** * Variant of {@link SerializableTester} that does not require the reserialized object's class to be @@ -39,6 +40,7 @@ * parameter for non-GWT, non-test files, and it didn't seem worth adding one for this unusual case. */ @GwtCompatible(emulated = true) +@NullUnmarked final class LenientSerializableTester { /* * TODO(cpovirk): move this to c.g.c.testing if we allow for c.g.c.annotations dependencies so diff --git a/android/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java b/android/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java index 1590399dc37f..7bc01a7dc2e0 100644 --- a/android/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java @@ -29,9 +29,13 @@ import java.lang.ref.Reference; import java.util.concurrent.atomic.AtomicReferenceArray; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author Charles Fry */ +/** + * @author Charles Fry + */ @SuppressWarnings("deprecation") // many tests of deprecated methods +@NullUnmarked public class MapMakerInternalMapTest extends TestCase { static final int SMALL_MAX_SIZE = DRAIN_THRESHOLD * 5; diff --git a/android/guava-tests/test/com/google/common/collect/MapMakerTest.java b/android/guava-tests/test/com/google/common/collect/MapMakerTest.java index 0bc48dde11b2..9c79948d17a1 100644 --- a/android/guava-tests/test/com/google/common/collect/MapMakerTest.java +++ b/android/guava-tests/test/com/google/common/collect/MapMakerTest.java @@ -28,12 +28,14 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * @author Charles Fry */ @GwtCompatible(emulated = true) @J2ktIncompatible // MapMaker +@NullUnmarked public class MapMakerTest extends TestCase { @GwtIncompatible // NullPointerTester public void testNullParameters() throws Exception { diff --git a/android/guava-tests/test/com/google/common/collect/MapsCollectionTest.java b/android/guava-tests/test/com/google/common/collect/MapsCollectionTest.java index f584d85a0d56..7a964e1d3d3c 100644 --- a/android/guava-tests/test/com/google/common/collect/MapsCollectionTest.java +++ b/android/guava-tests/test/com/google/common/collect/MapsCollectionTest.java @@ -52,6 +52,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -59,6 +60,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class MapsCollectionTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/android/guava-tests/test/com/google/common/collect/MultimapsCollectionTest.java b/android/guava-tests/test/com/google/common/collect/MultimapsCollectionTest.java index 853502c5c328..27cd588bd1ff 100644 --- a/android/guava-tests/test/com/google/common/collect/MultimapsCollectionTest.java +++ b/android/guava-tests/test/com/google/common/collect/MultimapsCollectionTest.java @@ -69,6 +69,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Run collection tests on wrappers from {@link Multimaps}. @@ -76,6 +77,7 @@ * @author Jared Levy */ @GwtIncompatible // suite // TODO(cpovirk): set up collect/gwt/suites version +@NullUnmarked public class MultimapsCollectionTest extends TestCase { private static final Feature[] FOR_MAP_FEATURES_ONE = { diff --git a/android/guava-tests/test/com/google/common/collect/MultimapsFilterEntriesAsMapTest.java b/android/guava-tests/test/com/google/common/collect/MultimapsFilterEntriesAsMapTest.java index 314a12774e8d..9066880cf25b 100644 --- a/android/guava-tests/test/com/google/common/collect/MultimapsFilterEntriesAsMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/MultimapsFilterEntriesAsMapTest.java @@ -21,6 +21,7 @@ import java.util.Collection; import java.util.Map; import java.util.Map.Entry; +import org.jspecify.annotations.NullUnmarked; /** * Tests for Multimaps.filterEntries().asMap(). @@ -28,6 +29,7 @@ * @author Jared Levy */ @GwtIncompatible(value = "untested") +@NullUnmarked public class MultimapsFilterEntriesAsMapTest extends AbstractMultimapAsMapImplementsMapTest { private static final Predicate> PREDICATE = new Predicate>() { diff --git a/android/guava-tests/test/com/google/common/collect/MultisetsCollectionTest.java b/android/guava-tests/test/com/google/common/collect/MultisetsCollectionTest.java index 7698b1917fc4..eac7058b374b 100644 --- a/android/guava-tests/test/com/google/common/collect/MultisetsCollectionTest.java +++ b/android/guava-tests/test/com/google/common/collect/MultisetsCollectionTest.java @@ -40,6 +40,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Collection tests on wrappers from {@link Multisets}. @@ -47,6 +48,7 @@ * @author Jared Levy */ @GwtIncompatible // suite // TODO(cpovirk): set up collect/gwt/suites version +@NullUnmarked public class MultisetsCollectionTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/android/guava-tests/test/com/google/common/collect/MutableClassToInstanceMapTest.java b/android/guava-tests/test/com/google/common/collect/MutableClassToInstanceMapTest.java index 765115d42b5e..f1d2e94fa302 100644 --- a/android/guava-tests/test/com/google/common/collect/MutableClassToInstanceMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/MutableClassToInstanceMapTest.java @@ -29,12 +29,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Unit test of {@link MutableClassToInstanceMap}. * * @author Kevin Bourrillion */ +@NullUnmarked public class MutableClassToInstanceMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/android/guava-tests/test/com/google/common/collect/PackageSanityTests.java b/android/guava-tests/test/com/google/common/collect/PackageSanityTests.java index c847140d573e..52ebabb173f1 100644 --- a/android/guava-tests/test/com/google/common/collect/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/collect/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.collect; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Covers basic sanity checks for the entire package. @@ -24,6 +25,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { publicApiOnly(); // Many package-private classes are tested through the public API. diff --git a/android/guava-tests/test/com/google/common/collect/QueuesTest.java b/android/guava-tests/test/com/google/common/collect/QueuesTest.java index f9ca68b0fcaa..22725fe4ed72 100644 --- a/android/guava-tests/test/com/google/common/collect/QueuesTest.java +++ b/android/guava-tests/test/com/google/common/collect/QueuesTest.java @@ -41,6 +41,7 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.TimeUnit; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -48,6 +49,7 @@ * * @author Dimitris Andreou */ +@NullUnmarked public class QueuesTest extends TestCase { /* * All the following tests relate to BlockingQueue methods in Queues. diff --git a/android/guava-tests/test/com/google/common/collect/RangeNonGwtTest.java b/android/guava-tests/test/com/google/common/collect/RangeNonGwtTest.java index 666624a305f1..e669fc41cf7f 100644 --- a/android/guava-tests/test/com/google/common/collect/RangeNonGwtTest.java +++ b/android/guava-tests/test/com/google/common/collect/RangeNonGwtTest.java @@ -18,6 +18,7 @@ import com.google.common.testing.NullPointerTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test cases for {@link Range} which cannot run as GWT tests. @@ -25,6 +26,7 @@ * @author Gregory Kick * @see RangeTest */ +@NullUnmarked public class RangeNonGwtTest extends TestCase { public void testNullPointers() { diff --git a/android/guava-tests/test/com/google/common/collect/RegularImmutableMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/RegularImmutableMapMapInterfaceTest.java index 4035d6955032..f888c7677904 100644 --- a/android/guava-tests/test/com/google/common/collect/RegularImmutableMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/RegularImmutableMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class RegularImmutableMapMapInterfaceTest extends AbstractImmutableMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/RegularImmutableMapWithUnhashableValuesMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/RegularImmutableMapWithUnhashableValuesMapInterfaceTest.java index 5bbf247b8f15..641c99d8f42f 100644 --- a/android/guava-tests/test/com/google/common/collect/RegularImmutableMapWithUnhashableValuesMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/RegularImmutableMapWithUnhashableValuesMapInterfaceTest.java @@ -20,8 +20,10 @@ import com.google.common.collect.testing.SampleElements.Unhashables; import com.google.common.collect.testing.UnhashableObject; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // GWT's ImmutableMap emulation is backed by java.util.HashMap. +@NullUnmarked public class RegularImmutableMapWithUnhashableValuesMapInterfaceTest extends AbstractImmutableMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/RegularImmutableSortedMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/RegularImmutableSortedMapMapInterfaceTest.java index d825eac5e043..ca09158f053e 100644 --- a/android/guava-tests/test/com/google/common/collect/RegularImmutableSortedMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/RegularImmutableSortedMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class RegularImmutableSortedMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/ReserializedImmutableMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/ReserializedImmutableMapMapInterfaceTest.java index 6eef9f30b968..a09be5094498 100644 --- a/android/guava-tests/test/com/google/common/collect/ReserializedImmutableMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/ReserializedImmutableMapMapInterfaceTest.java @@ -19,8 +19,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.testing.SerializableTester; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // SerializableTester +@NullUnmarked public class ReserializedImmutableMapMapInterfaceTest extends AbstractImmutableMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/ReserializedImmutableSortedMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/ReserializedImmutableSortedMapMapInterfaceTest.java index 1011cfef3ce2..01e24ffb9e7c 100644 --- a/android/guava-tests/test/com/google/common/collect/ReserializedImmutableSortedMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/ReserializedImmutableSortedMapMapInterfaceTest.java @@ -19,8 +19,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.testing.SerializableTester; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // SerializableTester +@NullUnmarked public class ReserializedImmutableSortedMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/SetsFilterHashSetTest.java b/android/guava-tests/test/com/google/common/collect/SetsFilterHashSetTest.java index 658d88056905..6a74bf9726ef 100644 --- a/android/guava-tests/test/com/google/common/collect/SetsFilterHashSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/SetsFilterHashSetTest.java @@ -21,7 +21,9 @@ import com.google.common.base.Predicate; import com.google.common.collect.FilteredCollectionsTestUtil.AbstractFilteredSetTest; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class SetsFilterHashSetTest extends AbstractFilteredSetTest> { @Override Set createUnfiltered(Iterable contents) { diff --git a/android/guava-tests/test/com/google/common/collect/SetsFilterNavigableSetTest.java b/android/guava-tests/test/com/google/common/collect/SetsFilterNavigableSetTest.java index 350c091507ba..2090e78098c6 100644 --- a/android/guava-tests/test/com/google/common/collect/SetsFilterNavigableSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/SetsFilterNavigableSetTest.java @@ -19,7 +19,9 @@ import com.google.common.base.Predicate; import com.google.common.collect.FilteredCollectionsTestUtil.AbstractFilteredNavigableSetTest; import java.util.NavigableSet; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class SetsFilterNavigableSetTest extends AbstractFilteredNavigableSetTest { @Override NavigableSet createUnfiltered(Iterable contents) { diff --git a/android/guava-tests/test/com/google/common/collect/SetsFilterSortedSetTest.java b/android/guava-tests/test/com/google/common/collect/SetsFilterSortedSetTest.java index 0529bead6ccd..8d6b85ab517f 100644 --- a/android/guava-tests/test/com/google/common/collect/SetsFilterSortedSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/SetsFilterSortedSetTest.java @@ -20,7 +20,9 @@ import com.google.common.collect.FilteredCollectionsTestUtil.AbstractFilteredSortedSetTest; import java.util.SortedSet; import java.util.TreeSet; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class SetsFilterSortedSetTest extends AbstractFilteredSortedSetTest> { @Override diff --git a/android/guava-tests/test/com/google/common/collect/SingletonImmutableMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/SingletonImmutableMapMapInterfaceTest.java index 2a9197d6c5df..45be28eb17b9 100644 --- a/android/guava-tests/test/com/google/common/collect/SingletonImmutableMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/SingletonImmutableMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class SingletonImmutableMapMapInterfaceTest extends AbstractImmutableMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/SingletonImmutableMapWithUnhashableValueMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/SingletonImmutableMapWithUnhashableValueMapInterfaceTest.java index 851e5d8c5dbe..0891fa2952c2 100644 --- a/android/guava-tests/test/com/google/common/collect/SingletonImmutableMapWithUnhashableValueMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/SingletonImmutableMapWithUnhashableValueMapInterfaceTest.java @@ -20,8 +20,10 @@ import com.google.common.collect.testing.SampleElements.Unhashables; import com.google.common.collect.testing.UnhashableObject; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // GWT's ImmutableMap emulation is backed by java.util.HashMap. +@NullUnmarked public class SingletonImmutableMapWithUnhashableValueMapInterfaceTest extends RegularImmutableMapWithUnhashableValuesMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/SingletonImmutableSortedMapMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/SingletonImmutableSortedMapMapInterfaceTest.java index 4cb7ca5f436a..ae4f7d8962fe 100644 --- a/android/guava-tests/test/com/google/common/collect/SingletonImmutableSortedMapMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/SingletonImmutableSortedMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class SingletonImmutableSortedMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/android/guava-tests/test/com/google/common/collect/SpecialRandom.java b/android/guava-tests/test/com/google/common/collect/SpecialRandom.java index 5996e5bfe26c..571a061f74ae 100644 --- a/android/guava-tests/test/com/google/common/collect/SpecialRandom.java +++ b/android/guava-tests/test/com/google/common/collect/SpecialRandom.java @@ -17,6 +17,7 @@ package com.google.common.collect; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Utility class for being able to seed a {@link Random} value with a passed in seed from a @@ -26,6 +27,7 @@ * * @author Nicholaus Shupe */ +@NullUnmarked public final class SpecialRandom extends Random { public static SpecialRandom valueOf(String s) { return (s.length() == 0) ? new SpecialRandom() : new SpecialRandom(Long.parseLong(s)); diff --git a/android/guava-tests/test/com/google/common/collect/SynchronizedBiMapTest.java b/android/guava-tests/test/com/google/common/collect/SynchronizedBiMapTest.java index b96986111339..98e49d696207 100644 --- a/android/guava-tests/test/com/google/common/collect/SynchronizedBiMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/SynchronizedBiMapTest.java @@ -29,6 +29,7 @@ import java.util.Map.Entry; import java.util.Set; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -36,6 +37,7 @@ * * @author Mike Bostock */ +@NullUnmarked public class SynchronizedBiMapTest extends SynchronizedMapTest { public static TestSuite suite() { diff --git a/android/guava-tests/test/com/google/common/collect/SynchronizedDequeTest.java b/android/guava-tests/test/com/google/common/collect/SynchronizedDequeTest.java index dd1b9569e801..5d1394fbf3e0 100644 --- a/android/guava-tests/test/com/google/common/collect/SynchronizedDequeTest.java +++ b/android/guava-tests/test/com/google/common/collect/SynchronizedDequeTest.java @@ -21,6 +21,7 @@ import java.util.Deque; import java.util.Iterator; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -28,6 +29,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class SynchronizedDequeTest extends TestCase { protected Deque create() { diff --git a/android/guava-tests/test/com/google/common/collect/SynchronizedMapTest.java b/android/guava-tests/test/com/google/common/collect/SynchronizedMapTest.java index 7b49e26f2625..55425e73aba3 100644 --- a/android/guava-tests/test/com/google/common/collect/SynchronizedMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/SynchronizedMapTest.java @@ -28,6 +28,7 @@ import java.util.Map.Entry; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -35,6 +36,7 @@ * * @author Mike Bostock */ +@NullUnmarked public class SynchronizedMapTest extends TestCase { public final Object mutex = new Object[0]; // something Serializable diff --git a/android/guava-tests/test/com/google/common/collect/SynchronizedMultimapTest.java b/android/guava-tests/test/com/google/common/collect/SynchronizedMultimapTest.java index c4e17efeddf1..b4499f96371d 100644 --- a/android/guava-tests/test/com/google/common/collect/SynchronizedMultimapTest.java +++ b/android/guava-tests/test/com/google/common/collect/SynchronizedMultimapTest.java @@ -35,6 +35,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -42,6 +43,7 @@ * * @author Mike Bostock */ +@NullUnmarked public class SynchronizedMultimapTest extends TestCase { public static Test suite() { diff --git a/android/guava-tests/test/com/google/common/collect/SynchronizedNavigableMapTest.java b/android/guava-tests/test/com/google/common/collect/SynchronizedNavigableMapTest.java index d92a94847711..0c414a269be6 100644 --- a/android/guava-tests/test/com/google/common/collect/SynchronizedNavigableMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/SynchronizedNavigableMapTest.java @@ -33,6 +33,7 @@ import java.util.NavigableSet; import java.util.SortedMap; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -40,6 +41,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class SynchronizedNavigableMapTest extends SynchronizedMapTest { @Override protected NavigableMap create() { diff --git a/android/guava-tests/test/com/google/common/collect/SynchronizedNavigableSetTest.java b/android/guava-tests/test/com/google/common/collect/SynchronizedNavigableSetTest.java index 73ee85fa2826..870cc12b0258 100644 --- a/android/guava-tests/test/com/google/common/collect/SynchronizedNavigableSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/SynchronizedNavigableSetTest.java @@ -32,6 +32,7 @@ import java.util.TreeSet; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -39,6 +40,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class SynchronizedNavigableSetTest extends TestCase { private static final Object MUTEX = new Object[0]; // something Serializable diff --git a/android/guava-tests/test/com/google/common/collect/SynchronizedQueueTest.java b/android/guava-tests/test/com/google/common/collect/SynchronizedQueueTest.java index e61905fe791e..8697239cd6f5 100644 --- a/android/guava-tests/test/com/google/common/collect/SynchronizedQueueTest.java +++ b/android/guava-tests/test/com/google/common/collect/SynchronizedQueueTest.java @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.Queue; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -28,6 +29,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class SynchronizedQueueTest extends TestCase { protected Queue create() { diff --git a/android/guava-tests/test/com/google/common/collect/SynchronizedSetTest.java b/android/guava-tests/test/com/google/common/collect/SynchronizedSetTest.java index 0bb2dee1173a..f202d6691673 100644 --- a/android/guava-tests/test/com/google/common/collect/SynchronizedSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/SynchronizedSetTest.java @@ -29,6 +29,7 @@ import java.util.Set; import junit.framework.Test; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -36,6 +37,7 @@ * * @author Mike Bostock */ +@NullUnmarked public class SynchronizedSetTest extends TestCase { public static final Object MUTEX = new Object[0]; // something Serializable diff --git a/android/guava-tests/test/com/google/common/collect/SynchronizedTableTest.java b/android/guava-tests/test/com/google/common/collect/SynchronizedTableTest.java index b0690f80a316..365ab36b8670 100644 --- a/android/guava-tests/test/com/google/common/collect/SynchronizedTableTest.java +++ b/android/guava-tests/test/com/google/common/collect/SynchronizedTableTest.java @@ -20,8 +20,10 @@ import java.util.Collection; import java.util.Map; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; +@NullUnmarked public class SynchronizedTableTest extends AbstractTableTest { private static final class TestTable implements Table, Serializable { final Table delegate = HashBasedTable.create(); diff --git a/android/guava-tests/test/com/google/common/collect/TestExceptions.java b/android/guava-tests/test/com/google/common/collect/TestExceptions.java index f7ca37fbd944..eb0025b49260 100644 --- a/android/guava-tests/test/com/google/common/collect/TestExceptions.java +++ b/android/guava-tests/test/com/google/common/collect/TestExceptions.java @@ -17,9 +17,11 @@ package com.google.common.collect; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; /** Exception classes for use in tests. */ @GwtCompatible +@NullUnmarked final class TestExceptions { static class SomeError extends Error {} diff --git a/android/guava-tests/test/com/google/common/collect/TopKSelectorTest.java b/android/guava-tests/test/com/google/common/collect/TopKSelectorTest.java index dc8ae30902c1..5f28508d8928 100644 --- a/android/guava-tests/test/com/google/common/collect/TopKSelectorTest.java +++ b/android/guava-tests/test/com/google/common/collect/TopKSelectorTest.java @@ -27,6 +27,7 @@ import java.util.Comparator; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code TopKSelector}. @@ -34,6 +35,7 @@ * @author Louis Wasserman */ @GwtCompatible +@NullUnmarked public class TopKSelectorTest extends TestCase { public void testNegativeK() { diff --git a/android/guava-tests/test/com/google/common/collect/TreeBasedTableRowMapInterfaceTest.java b/android/guava-tests/test/com/google/common/collect/TreeBasedTableRowMapInterfaceTest.java index dd8aec3aa444..70ed7faca268 100644 --- a/android/guava-tests/test/com/google/common/collect/TreeBasedTableRowMapInterfaceTest.java +++ b/android/guava-tests/test/com/google/common/collect/TreeBasedTableRowMapInterfaceTest.java @@ -19,8 +19,10 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.collect.testing.SortedMapInterfaceTest; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class TreeBasedTableRowMapInterfaceTest extends SortedMapInterfaceTest { public TreeBasedTableRowMapInterfaceTest() { super(false, false, true, true, true); diff --git a/android/guava-tests/test/com/google/common/collect/TreeRangeMapTest.java b/android/guava-tests/test/com/google/common/collect/TreeRangeMapTest.java index 1921cbff35ab..198f7d542d36 100644 --- a/android/guava-tests/test/com/google/common/collect/TreeRangeMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/TreeRangeMapTest.java @@ -33,6 +33,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code TreeRangeMap}. @@ -40,6 +41,7 @@ * @author Louis Wasserman */ @GwtIncompatible // NavigableMap +@NullUnmarked public class TreeRangeMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/android/guava-tests/test/com/google/common/collect/TreeRangeSetTest.java b/android/guava-tests/test/com/google/common/collect/TreeRangeSetTest.java index 29b94f157a72..892c988b7991 100644 --- a/android/guava-tests/test/com/google/common/collect/TreeRangeSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/TreeRangeSetTest.java @@ -23,6 +23,7 @@ import com.google.common.testing.SerializableTester; import java.util.List; import java.util.NavigableMap; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link TreeRangeSet}. @@ -31,6 +32,7 @@ * @author Chris Povirk */ @GwtIncompatible // TreeRangeSet +@NullUnmarked public class TreeRangeSetTest extends AbstractRangeSetTest { // TODO(cpovirk): test all of these with the ranges added in the reverse order diff --git a/android/guava-tests/test/com/google/common/collect/WriteReplaceOverridesTest.java b/android/guava-tests/test/com/google/common/collect/WriteReplaceOverridesTest.java index d19299220ed4..61c40de4a87c 100644 --- a/android/guava-tests/test/com/google/common/collect/WriteReplaceOverridesTest.java +++ b/android/guava-tests/test/com/google/common/collect/WriteReplaceOverridesTest.java @@ -28,6 +28,7 @@ import com.google.common.reflect.TypeToken; import java.lang.reflect.Method; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests that all package-private {@code writeReplace} methods are overridden in any existing @@ -36,6 +37,7 @@ * writeReplace} when serializing an instance of the subclass. For an example of this problem, see * b/310253115. */ +@NullUnmarked public class WriteReplaceOverridesTest extends TestCase { private static final ImmutableSet GUAVA_PACKAGES = FluentIterable.of( diff --git a/android/guava-tests/test/com/google/common/escape/ArrayBasedEscaperMapTest.java b/android/guava-tests/test/com/google/common/escape/ArrayBasedEscaperMapTest.java index 83b58ee94c8b..a327f549bed6 100644 --- a/android/guava-tests/test/com/google/common/escape/ArrayBasedEscaperMapTest.java +++ b/android/guava-tests/test/com/google/common/escape/ArrayBasedEscaperMapTest.java @@ -22,9 +22,13 @@ import com.google.common.collect.ImmutableMap; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author David Beaumont */ +/** + * @author David Beaumont + */ @GwtCompatible +@NullUnmarked public class ArrayBasedEscaperMapTest extends TestCase { public void testNullMap() { assertThrows(NullPointerException.class, () -> ArrayBasedEscaperMap.create(null)); diff --git a/android/guava-tests/test/com/google/common/escape/CharEscaperBuilderTest.java b/android/guava-tests/test/com/google/common/escape/CharEscaperBuilderTest.java index 087e3177ab7d..5f0ebea616ea 100644 --- a/android/guava-tests/test/com/google/common/escape/CharEscaperBuilderTest.java +++ b/android/guava-tests/test/com/google/common/escape/CharEscaperBuilderTest.java @@ -17,7 +17,9 @@ package com.google.common.escape; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public class CharEscaperBuilderTest extends TestCase { public void testAddEscapes() { diff --git a/android/guava-tests/test/com/google/common/escape/EscapersTest.java b/android/guava-tests/test/com/google/common/escape/EscapersTest.java index 7072ea7997a5..650203e548fc 100644 --- a/android/guava-tests/test/com/google/common/escape/EscapersTest.java +++ b/android/guava-tests/test/com/google/common/escape/EscapersTest.java @@ -22,9 +22,13 @@ import com.google.common.escape.testing.EscaperAsserts; import java.io.IOException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author David Beaumont */ +/** + * @author David Beaumont + */ @GwtCompatible +@NullUnmarked public class EscapersTest extends TestCase { public void testNullEscaper() throws IOException { Escaper escaper = Escapers.nullEscaper(); diff --git a/android/guava-tests/test/com/google/common/escape/PackageSanityTests.java b/android/guava-tests/test/com/google/common/escape/PackageSanityTests.java index c2af8b742d02..d284c28a6e54 100644 --- a/android/guava-tests/test/com/google/common/escape/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/escape/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.escape; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -24,4 +25,5 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests {} diff --git a/android/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java b/android/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java index a42af5cee91a..1817cdff8efa 100644 --- a/android/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java +++ b/android/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java @@ -20,6 +20,7 @@ import com.google.common.annotations.GwtCompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -28,6 +29,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked public class UnicodeEscaperTest extends TestCase { private static final String SMALLEST_SURROGATE = diff --git a/android/guava-tests/test/com/google/common/eventbus/AsyncEventBusTest.java b/android/guava-tests/test/com/google/common/eventbus/AsyncEventBusTest.java index 208667d213f3..ec84a0e368da 100644 --- a/android/guava-tests/test/com/google/common/eventbus/AsyncEventBusTest.java +++ b/android/guava-tests/test/com/google/common/eventbus/AsyncEventBusTest.java @@ -20,12 +20,14 @@ import java.util.List; import java.util.concurrent.Executor; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test case for {@link AsyncEventBus}. * * @author Cliff Biffle */ +@NullUnmarked public class AsyncEventBusTest extends TestCase { private static final String EVENT = "Hello"; diff --git a/android/guava-tests/test/com/google/common/eventbus/DispatcherTest.java b/android/guava-tests/test/com/google/common/eventbus/DispatcherTest.java index ec78c716fdc9..58c12be8b901 100644 --- a/android/guava-tests/test/com/google/common/eventbus/DispatcherTest.java +++ b/android/guava-tests/test/com/google/common/eventbus/DispatcherTest.java @@ -25,12 +25,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.CyclicBarrier; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Dispatcher} implementations. * * @author Colin Decker */ +@NullUnmarked public class DispatcherTest extends TestCase { private final EventBus bus = new EventBus(); diff --git a/android/guava-tests/test/com/google/common/eventbus/EventBusTest.java b/android/guava-tests/test/com/google/common/eventbus/EventBusTest.java index 661d40ae2d42..e81efa36bebb 100644 --- a/android/guava-tests/test/com/google/common/eventbus/EventBusTest.java +++ b/android/guava-tests/test/com/google/common/eventbus/EventBusTest.java @@ -26,12 +26,14 @@ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test case for {@link EventBus}. * * @author Cliff Biffle */ +@NullUnmarked public class EventBusTest extends TestCase { private static final String EVENT = "Hello"; private static final String BUS_IDENTIFIER = "test-bus"; diff --git a/android/guava-tests/test/com/google/common/eventbus/PackageSanityTests.java b/android/guava-tests/test/com/google/common/eventbus/PackageSanityTests.java index bb7de099b4bb..441e79a730fc 100644 --- a/android/guava-tests/test/com/google/common/eventbus/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/eventbus/PackageSanityTests.java @@ -18,6 +18,7 @@ import com.google.common.testing.AbstractPackageSanityTests; import java.lang.reflect.Method; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -26,6 +27,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() throws Exception { diff --git a/android/guava-tests/test/com/google/common/eventbus/ReentrantEventsTest.java b/android/guava-tests/test/com/google/common/eventbus/ReentrantEventsTest.java index f26f0c36f723..6ae77e5b15ab 100644 --- a/android/guava-tests/test/com/google/common/eventbus/ReentrantEventsTest.java +++ b/android/guava-tests/test/com/google/common/eventbus/ReentrantEventsTest.java @@ -19,12 +19,14 @@ import com.google.common.collect.Lists; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Validate that {@link EventBus} behaves carefully when listeners publish their own events. * * @author Jesse Wilson */ +@NullUnmarked public class ReentrantEventsTest extends TestCase { static final String FIRST = "one"; diff --git a/android/guava-tests/test/com/google/common/eventbus/StringCatcher.java b/android/guava-tests/test/com/google/common/eventbus/StringCatcher.java index 0fb9cecf1b57..56be3f2ac1ae 100644 --- a/android/guava-tests/test/com/google/common/eventbus/StringCatcher.java +++ b/android/guava-tests/test/com/google/common/eventbus/StringCatcher.java @@ -19,6 +19,7 @@ import com.google.common.collect.Lists; import java.util.List; import junit.framework.Assert; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -29,6 +30,7 @@ * * @author Cliff Biffle */ +@NullUnmarked public class StringCatcher { private List events = Lists.newArrayList(); diff --git a/android/guava-tests/test/com/google/common/eventbus/SubscriberRegistryTest.java b/android/guava-tests/test/com/google/common/eventbus/SubscriberRegistryTest.java index 901bb2b51e49..21ff84066d04 100644 --- a/android/guava-tests/test/com/google/common/eventbus/SubscriberRegistryTest.java +++ b/android/guava-tests/test/com/google/common/eventbus/SubscriberRegistryTest.java @@ -22,12 +22,14 @@ import com.google.common.collect.Iterators; import java.util.Iterator; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link SubscriberRegistry}. * * @author Colin Decker */ +@NullUnmarked public class SubscriberRegistryTest extends TestCase { private final SubscriberRegistry registry = new SubscriberRegistry(new EventBus()); diff --git a/android/guava-tests/test/com/google/common/eventbus/SubscriberTest.java b/android/guava-tests/test/com/google/common/eventbus/SubscriberTest.java index 6e02627feff6..4f9c7bdce788 100644 --- a/android/guava-tests/test/com/google/common/eventbus/SubscriberTest.java +++ b/android/guava-tests/test/com/google/common/eventbus/SubscriberTest.java @@ -23,6 +23,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -31,6 +32,7 @@ * @author Cliff Biffle * @author Colin Decker */ +@NullUnmarked public class SubscriberTest extends TestCase { private static final Object FIXTURE_ARGUMENT = new Object(); diff --git a/android/guava-tests/test/com/google/common/graph/AbstractGraphTest.java b/android/guava-tests/test/com/google/common/graph/AbstractGraphTest.java index 8b4b5076cdf7..bcf9cf6d7680 100644 --- a/android/guava-tests/test/com/google/common/graph/AbstractGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/AbstractGraphTest.java @@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableSet; import java.util.HashSet; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -47,6 +48,7 @@ * TODO(user): Make this class generic (using ) for all node and edge types. * TODO(user): Differentiate between directed and undirected edge strings. */ +@NullUnmarked public abstract class AbstractGraphTest { Graph graph; diff --git a/android/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java b/android/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java index 7313e8835ba8..98eaba7f012e 100644 --- a/android/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java +++ b/android/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java @@ -38,6 +38,7 @@ import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.After; import org.junit.Before; @@ -59,6 +60,7 @@ * TODO(user): Make this class generic (using ) for all node and edge types. * TODO(user): Differentiate between directed and undirected edge strings. */ +@NullUnmarked public abstract class AbstractNetworkTest { Network network; diff --git a/android/guava-tests/test/com/google/common/graph/AbstractStandardDirectedGraphTest.java b/android/guava-tests/test/com/google/common/graph/AbstractStandardDirectedGraphTest.java index 0079c1c46008..2e650a1fa378 100644 --- a/android/guava-tests/test/com/google/common/graph/AbstractStandardDirectedGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/AbstractStandardDirectedGraphTest.java @@ -23,11 +23,13 @@ import static org.junit.Assert.assertTrue; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; /** * Abstract base class for testing directed {@link Graph} implementations defined in this package. */ +@NullUnmarked public abstract class AbstractStandardDirectedGraphTest extends AbstractGraphTest { @Override diff --git a/android/guava-tests/test/com/google/common/graph/AbstractStandardDirectedNetworkTest.java b/android/guava-tests/test/com/google/common/graph/AbstractStandardDirectedNetworkTest.java index 19a28cd76d7c..eec759a2c31c 100644 --- a/android/guava-tests/test/com/google/common/graph/AbstractStandardDirectedNetworkTest.java +++ b/android/guava-tests/test/com/google/common/graph/AbstractStandardDirectedNetworkTest.java @@ -27,12 +27,14 @@ import com.google.common.collect.ImmutableSet; import java.util.Collections; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.After; import org.junit.Test; /** * Abstract base class for testing directed {@link Network} implementations defined in this package. */ +@NullUnmarked public abstract class AbstractStandardDirectedNetworkTest extends AbstractNetworkTest { @After diff --git a/android/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedGraphTest.java b/android/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedGraphTest.java index 521bc72bd13f..d0f8d38163da 100644 --- a/android/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedGraphTest.java @@ -23,12 +23,14 @@ import com.google.common.testing.EqualsTester; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.After; import org.junit.Test; /** * Abstract base class for testing undirected {@link Graph} implementations defined in this package. */ +@NullUnmarked public abstract class AbstractStandardUndirectedGraphTest extends AbstractGraphTest { @After diff --git a/android/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedNetworkTest.java b/android/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedNetworkTest.java index 286956472bc9..8adbaa40c360 100644 --- a/android/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedNetworkTest.java +++ b/android/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedNetworkTest.java @@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.testing.EqualsTester; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.After; import org.junit.Test; @@ -33,6 +34,7 @@ * Abstract base class for testing undirected {@link Network} implementations defined in this * package. */ +@NullUnmarked public abstract class AbstractStandardUndirectedNetworkTest extends AbstractNetworkTest { private static final EndpointPair ENDPOINTS_N1N2 = EndpointPair.ordered(N1, N2); private static final EndpointPair ENDPOINTS_N2N1 = EndpointPair.ordered(N2, N1); diff --git a/android/guava-tests/test/com/google/common/graph/DefaultNetworkImplementationsTest.java b/android/guava-tests/test/com/google/common/graph/DefaultNetworkImplementationsTest.java index 4f3cd6f9d56b..bf5a387b0290 100644 --- a/android/guava-tests/test/com/google/common/graph/DefaultNetworkImplementationsTest.java +++ b/android/guava-tests/test/com/google/common/graph/DefaultNetworkImplementationsTest.java @@ -26,6 +26,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -40,6 +41,7 @@ @AndroidIncompatible // TODO(cpovirk): Figure out Android JUnit 4 support. Does it work with Gingerbread? @RunWith? @RunWith(Parameterized.class) +@NullUnmarked public final class DefaultNetworkImplementationsTest { private MutableNetwork network; private NetworkForTest networkForTest; diff --git a/android/guava-tests/test/com/google/common/graph/ElementOrderTest.java b/android/guava-tests/test/com/google/common/graph/ElementOrderTest.java index 5e4c8d4d8a77..a50b0400fe45 100644 --- a/android/guava-tests/test/com/google/common/graph/ElementOrderTest.java +++ b/android/guava-tests/test/com/google/common/graph/ElementOrderTest.java @@ -23,12 +23,14 @@ import com.google.common.collect.Ordering; import java.util.Comparator; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Tests for ordering the elements of graphs. */ @RunWith(JUnit4.class) +@NullUnmarked public final class ElementOrderTest { // Node order tests diff --git a/android/guava-tests/test/com/google/common/graph/EndpointPairTest.java b/android/guava-tests/test/com/google/common/graph/EndpointPairTest.java index 391f4c83814f..a304ed7b8c43 100644 --- a/android/guava-tests/test/com/google/common/graph/EndpointPairTest.java +++ b/android/guava-tests/test/com/google/common/graph/EndpointPairTest.java @@ -24,12 +24,14 @@ import com.google.common.testing.EqualsTester; import java.util.Collection; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Tests for {@link EndpointPair} and {@link Graph#edges()}. */ @RunWith(JUnit4.class) +@NullUnmarked public final class EndpointPairTest { private static final Integer N0 = 0; private static final Integer N1 = 1; diff --git a/android/guava-tests/test/com/google/common/graph/GraphEquivalenceTest.java b/android/guava-tests/test/com/google/common/graph/GraphEquivalenceTest.java index 87247d5b56ec..7d45f55913d5 100644 --- a/android/guava-tests/test/com/google/common/graph/GraphEquivalenceTest.java +++ b/android/guava-tests/test/com/google/common/graph/GraphEquivalenceTest.java @@ -23,6 +23,7 @@ import com.google.common.graph.TestUtil.EdgeType; import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -31,6 +32,7 @@ @AndroidIncompatible // TODO(cpovirk): Figure out Android JUnit 4 support. Does it work with Gingerbread? @RunWith? @RunWith(Parameterized.class) +@NullUnmarked public final class GraphEquivalenceTest { private static final Integer N1 = 1; private static final Integer N2 = 2; diff --git a/android/guava-tests/test/com/google/common/graph/GraphMutationTest.java b/android/guava-tests/test/com/google/common/graph/GraphMutationTest.java index 82ff96756723..3d8d51d04466 100644 --- a/android/guava-tests/test/com/google/common/graph/GraphMutationTest.java +++ b/android/guava-tests/test/com/google/common/graph/GraphMutationTest.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Random; import java.util.RandomAccess; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -30,6 +31,7 @@ /** Tests for repeated node and edge addition and removal in a {@link Graph}. */ @RunWith(JUnit4.class) +@NullUnmarked public final class GraphMutationTest { private static final int NUM_TRIALS = 50; private static final int NUM_NODES = 100; diff --git a/android/guava-tests/test/com/google/common/graph/GraphPropertiesTest.java b/android/guava-tests/test/com/google/common/graph/GraphPropertiesTest.java index a6860929048e..bb1d25e77f99 100644 --- a/android/guava-tests/test/com/google/common/graph/GraphPropertiesTest.java +++ b/android/guava-tests/test/com/google/common/graph/GraphPropertiesTest.java @@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat; import com.google.common.collect.ImmutableList; +import org.jspecify.annotations.NullUnmarked; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -28,6 +29,7 @@ /** Tests for {@link Graphs#hasCycle(Graph)} and {@link Graphs#hasCycle(Network)}. */ // TODO(user): Consider moving this to GraphsTest. @RunWith(JUnit4.class) +@NullUnmarked public class GraphPropertiesTest { ImmutableList> graphsToTest; Graph directedGraph; diff --git a/android/guava-tests/test/com/google/common/graph/GraphsTest.java b/android/guava-tests/test/com/google/common/graph/GraphsTest.java index 859066695ffa..20199ee8feb3 100644 --- a/android/guava-tests/test/com/google/common/graph/GraphsTest.java +++ b/android/guava-tests/test/com/google/common/graph/GraphsTest.java @@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableSet; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -35,6 +36,7 @@ * the missing nodes to the graph, then adds the edge between them. */ @RunWith(JUnit4.class) +@NullUnmarked public class GraphsTest { private static final Integer N1 = 1; private static final Integer N2 = 2; diff --git a/android/guava-tests/test/com/google/common/graph/ImmutableNetworkTest.java b/android/guava-tests/test/com/google/common/graph/ImmutableNetworkTest.java index 5de3cf751f8e..9d4889fd2634 100644 --- a/android/guava-tests/test/com/google/common/graph/ImmutableNetworkTest.java +++ b/android/guava-tests/test/com/google/common/graph/ImmutableNetworkTest.java @@ -18,12 +18,14 @@ import static com.google.common.truth.Truth.assertThat; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Tests for {@link ImmutableNetwork}. */ @RunWith(JUnit4.class) +@NullUnmarked public class ImmutableNetworkTest { @Test diff --git a/android/guava-tests/test/com/google/common/graph/ImmutableValueGraphTest.java b/android/guava-tests/test/com/google/common/graph/ImmutableValueGraphTest.java index 8e5e67f3046e..43f48d91c986 100644 --- a/android/guava-tests/test/com/google/common/graph/ImmutableValueGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/ImmutableValueGraphTest.java @@ -18,12 +18,14 @@ import static com.google.common.truth.Truth.assertThat; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Tests for {@link ImmutableValueGraph} . */ @RunWith(JUnit4.class) +@NullUnmarked public class ImmutableValueGraphTest { @Test diff --git a/android/guava-tests/test/com/google/common/graph/InvalidatableSetTest.java b/android/guava-tests/test/com/google/common/graph/InvalidatableSetTest.java index 1af877f39f87..1f393acd25ce 100644 --- a/android/guava-tests/test/com/google/common/graph/InvalidatableSetTest.java +++ b/android/guava-tests/test/com/google/common/graph/InvalidatableSetTest.java @@ -6,12 +6,14 @@ import com.google.common.collect.ImmutableSet; import java.util.HashSet; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) +@NullUnmarked public final class InvalidatableSetTest { Set wrappedSet; Set copyOfWrappedSet; diff --git a/android/guava-tests/test/com/google/common/graph/MapCacheTest.java b/android/guava-tests/test/com/google/common/graph/MapCacheTest.java index f04f010c84c9..e129443530f8 100644 --- a/android/guava-tests/test/com/google/common/graph/MapCacheTest.java +++ b/android/guava-tests/test/com/google/common/graph/MapCacheTest.java @@ -24,6 +24,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.TreeMap; +import org.jspecify.annotations.NullUnmarked; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,6 +35,7 @@ @AndroidIncompatible // TODO(cpovirk): Figure out Android JUnit 4 support. Does it work with Gingerbread? @RunWith? @RunWith(Parameterized.class) +@NullUnmarked public final class MapCacheTest { private final MapIteratorCache mapCache; diff --git a/android/guava-tests/test/com/google/common/graph/NetworkEquivalenceTest.java b/android/guava-tests/test/com/google/common/graph/NetworkEquivalenceTest.java index 69d18fa1b039..de8ff654c9fb 100644 --- a/android/guava-tests/test/com/google/common/graph/NetworkEquivalenceTest.java +++ b/android/guava-tests/test/com/google/common/graph/NetworkEquivalenceTest.java @@ -23,6 +23,7 @@ import com.google.common.graph.TestUtil.EdgeType; import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -31,6 +32,7 @@ @AndroidIncompatible // TODO(cpovirk): Figure out Android JUnit 4 support. Does it work with Gingerbread? @RunWith? @RunWith(Parameterized.class) +@NullUnmarked public final class NetworkEquivalenceTest { private static final Integer N1 = 1; private static final Integer N2 = 2; diff --git a/android/guava-tests/test/com/google/common/graph/NetworkMutationTest.java b/android/guava-tests/test/com/google/common/graph/NetworkMutationTest.java index 5be0ae02b895..f3629370c9e5 100644 --- a/android/guava-tests/test/com/google/common/graph/NetworkMutationTest.java +++ b/android/guava-tests/test/com/google/common/graph/NetworkMutationTest.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Random; import java.util.RandomAccess; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -30,6 +31,7 @@ /** Tests for repeated node and edge addition and removal in a {@link Network}. */ @RunWith(JUnit4.class) +@NullUnmarked public final class NetworkMutationTest { private static final int NUM_TRIALS = 5; private static final int NUM_NODES = 20; diff --git a/android/guava-tests/test/com/google/common/graph/PackageSanityTests.java b/android/guava-tests/test/com/google/common/graph/PackageSanityTests.java index 97753f7ab671..8b241a2ab123 100644 --- a/android/guava-tests/test/com/google/common/graph/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/graph/PackageSanityTests.java @@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertWithMessage; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Covers basic sanity checks for the entire package. @@ -27,6 +28,7 @@ * @author Kurt Alfred Kluever */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { private static final AbstractGraphBuilder GRAPH_BUILDER_A = diff --git a/android/guava-tests/test/com/google/common/graph/StandardImmutableDirectedGraphTest.java b/android/guava-tests/test/com/google/common/graph/StandardImmutableDirectedGraphTest.java index d89baa0634bc..710f7890526b 100644 --- a/android/guava-tests/test/com/google/common/graph/StandardImmutableDirectedGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/StandardImmutableDirectedGraphTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -25,6 +26,7 @@ /** Tests for a directed {@link StandardMutableGraph}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public final class StandardImmutableDirectedGraphTest extends AbstractStandardDirectedGraphTest { @Parameters(name = "allowsSelfLoops={0}") diff --git a/android/guava-tests/test/com/google/common/graph/StandardImmutableDirectedNetworkTest.java b/android/guava-tests/test/com/google/common/graph/StandardImmutableDirectedNetworkTest.java index b237ff91f07c..bc3e194d969b 100644 --- a/android/guava-tests/test/com/google/common/graph/StandardImmutableDirectedNetworkTest.java +++ b/android/guava-tests/test/com/google/common/graph/StandardImmutableDirectedNetworkTest.java @@ -19,6 +19,7 @@ import com.google.common.collect.Ordering; import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -26,6 +27,7 @@ /** Tests for a directed {@link ImmutableNetwork}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public class StandardImmutableDirectedNetworkTest extends AbstractStandardDirectedNetworkTest { @Parameters(name = "allowsSelfLoops={0}, allowsParallelEdges={1}, nodeOrder={2}, edgeOrder={3}") diff --git a/android/guava-tests/test/com/google/common/graph/StandardImmutableGraphAdditionalTest.java b/android/guava-tests/test/com/google/common/graph/StandardImmutableGraphAdditionalTest.java index 47cd6a037426..1a709ac6a227 100644 --- a/android/guava-tests/test/com/google/common/graph/StandardImmutableGraphAdditionalTest.java +++ b/android/guava-tests/test/com/google/common/graph/StandardImmutableGraphAdditionalTest.java @@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -27,6 +28,7 @@ * {@link StandardImmutableDirectedGraphTest}. */ @RunWith(JUnit4.class) +@NullUnmarked public class StandardImmutableGraphAdditionalTest { @Test diff --git a/android/guava-tests/test/com/google/common/graph/StandardImmutableUndirectedGraphTest.java b/android/guava-tests/test/com/google/common/graph/StandardImmutableUndirectedGraphTest.java index 7f580a6db80d..290306d4a09d 100644 --- a/android/guava-tests/test/com/google/common/graph/StandardImmutableUndirectedGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/StandardImmutableUndirectedGraphTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -25,6 +26,7 @@ /** Tests for an undirected {@link StandardMutableGraph}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public final class StandardImmutableUndirectedGraphTest extends AbstractStandardUndirectedGraphTest { diff --git a/android/guava-tests/test/com/google/common/graph/StandardMutableDirectedGraphTest.java b/android/guava-tests/test/com/google/common/graph/StandardMutableDirectedGraphTest.java index 191010e48f40..8b849a8cd2c6 100644 --- a/android/guava-tests/test/com/google/common/graph/StandardMutableDirectedGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/StandardMutableDirectedGraphTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -25,6 +26,7 @@ /** Tests for a directed {@link StandardMutableGraph}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public final class StandardMutableDirectedGraphTest extends AbstractStandardDirectedGraphTest { @Parameters(name = "allowsSelfLoops={0}, incidentEdgeOrder={1}") diff --git a/android/guava-tests/test/com/google/common/graph/StandardMutableDirectedNetworkTest.java b/android/guava-tests/test/com/google/common/graph/StandardMutableDirectedNetworkTest.java index fb8be1d34d7a..1e8960a39c86 100644 --- a/android/guava-tests/test/com/google/common/graph/StandardMutableDirectedNetworkTest.java +++ b/android/guava-tests/test/com/google/common/graph/StandardMutableDirectedNetworkTest.java @@ -19,6 +19,7 @@ import com.google.common.collect.Ordering; import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -26,6 +27,7 @@ /** Tests for a directed {@link StandardMutableNetwork} allowing self-loops. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public class StandardMutableDirectedNetworkTest extends AbstractStandardDirectedNetworkTest { @Parameters(name = "allowsSelfLoops={0}, allowsParallelEdges={1}, nodeOrder={2}, edgeOrder={3}") diff --git a/android/guava-tests/test/com/google/common/graph/StandardMutableUndirectedGraphTest.java b/android/guava-tests/test/com/google/common/graph/StandardMutableUndirectedGraphTest.java index aa0372aa8aae..fdb3bef224e6 100644 --- a/android/guava-tests/test/com/google/common/graph/StandardMutableUndirectedGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/StandardMutableUndirectedGraphTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -25,6 +26,7 @@ /** Tests for an undirected {@link StandardMutableGraph}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public class StandardMutableUndirectedGraphTest extends AbstractStandardUndirectedGraphTest { @Parameters(name = "allowsSelfLoops={0}, incidentEdgeOrder={1}") diff --git a/android/guava-tests/test/com/google/common/graph/StandardMutableUndirectedNetworkTest.java b/android/guava-tests/test/com/google/common/graph/StandardMutableUndirectedNetworkTest.java index c021b5d17354..f5e12b33f7ef 100644 --- a/android/guava-tests/test/com/google/common/graph/StandardMutableUndirectedNetworkTest.java +++ b/android/guava-tests/test/com/google/common/graph/StandardMutableUndirectedNetworkTest.java @@ -19,6 +19,7 @@ import com.google.common.collect.Ordering; import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -26,6 +27,7 @@ /** Tests for an undirected {@link StandardMutableNetwork}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public final class StandardMutableUndirectedNetworkTest extends AbstractStandardUndirectedNetworkTest { diff --git a/android/guava-tests/test/com/google/common/graph/TestUtil.java b/android/guava-tests/test/com/google/common/graph/TestUtil.java index 95fc75296c3a..8a7dfbef6665 100644 --- a/android/guava-tests/test/com/google/common/graph/TestUtil.java +++ b/android/guava-tests/test/com/google/common/graph/TestUtil.java @@ -22,8 +22,10 @@ import com.google.common.collect.Iterators; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; /** Utility methods used in various common.graph tests. */ +@NullUnmarked final class TestUtil { static final String ERROR_ELEMENT_NOT_IN_GRAPH = "not an element of this graph"; static final String ERROR_NODE_NOT_IN_GRAPH = diff --git a/android/guava-tests/test/com/google/common/graph/TraverserTest.java b/android/guava-tests/test/com/google/common/graph/TraverserTest.java index a941b95290c1..5694d7f69ad8 100644 --- a/android/guava-tests/test/com/google/common/graph/TraverserTest.java +++ b/android/guava-tests/test/com/google/common/graph/TraverserTest.java @@ -30,11 +30,13 @@ import com.google.common.collect.Multiset; import com.google.common.collect.Ordering; import com.google.common.primitives.Chars; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) +@NullUnmarked public class TraverserTest { /** diff --git a/android/guava-tests/test/com/google/common/graph/ValueGraphTest.java b/android/guava-tests/test/com/google/common/graph/ValueGraphTest.java index caf7ed984c39..0a17427a8c6c 100644 --- a/android/guava-tests/test/com/google/common/graph/ValueGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/ValueGraphTest.java @@ -28,6 +28,7 @@ import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.After; import org.junit.Test; @@ -37,6 +38,7 @@ /** Tests for {@link StandardMutableValueGraph} and related functionality. */ // TODO(user): Expand coverage and move to proper test suite. @RunWith(JUnit4.class) +@NullUnmarked public final class ValueGraphTest { private static final String DEFAULT = "default"; diff --git a/android/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java b/android/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java index 9bd2b4b90fee..fe35bf3d9820 100644 --- a/android/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java +++ b/android/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java @@ -21,12 +21,14 @@ import java.io.ByteArrayOutputStream; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for AbstractByteHasher. * * @author Colin Decker */ +@NullUnmarked public class AbstractByteHasherTest extends TestCase { public void testBytes() { diff --git a/android/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java b/android/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java index 754147152fd9..281ec4fef5a4 100644 --- a/android/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java +++ b/android/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java @@ -24,8 +24,10 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for AbstractNonStreamingHashFunction. */ +@NullUnmarked public class AbstractNonStreamingHashFunctionTest extends TestCase { /** * Constructs two trivial HashFunctions (output := input), one streaming and one non-streaming, diff --git a/android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java b/android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java index 9373681c1f9e..2a93936a90ef 100644 --- a/android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java +++ b/android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java @@ -30,12 +30,14 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for AbstractStreamingHasher. * * @author Dimitris Andreou */ +@NullUnmarked public class AbstractStreamingHasherTest extends TestCase { public void testBytes() { Sink sink = new Sink(4); // byte order insignificant here diff --git a/android/guava-tests/test/com/google/common/hash/BloomFilterTest.java b/android/guava-tests/test/com/google/common/hash/BloomFilterTest.java index 91c183c6322d..06b28eee645f 100644 --- a/android/guava-tests/test/com/google/common/hash/BloomFilterTest.java +++ b/android/guava-tests/test/com/google/common/hash/BloomFilterTest.java @@ -38,6 +38,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -45,6 +46,7 @@ * * @author Dimitris Andreou */ +@NullUnmarked public class BloomFilterTest extends TestCase { private static final int NUM_PUTS = 100_000; private static final ThreadLocal random = diff --git a/android/guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java b/android/guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java index 14a106a62825..1cdc8cdfcf8c 100644 --- a/android/guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java +++ b/android/guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java @@ -19,12 +19,14 @@ import java.util.zip.Checksum; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for ChecksumHashFunction. * * @author Colin Decker */ +@NullUnmarked public class ChecksumHashFunctionTest extends TestCase { public void testCrc32_equalsChecksumValue() throws Exception { diff --git a/android/guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java b/android/guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java index af0481ae5b79..03a0cf1490cf 100644 --- a/android/guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java +++ b/android/guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Crc32c}. Known test values are from RFC 3720, Section B.4. @@ -26,6 +27,7 @@ * @author Patrick Costello * @author Kurt Alfred Kluever */ +@NullUnmarked public class Crc32cHashFunctionTest extends TestCase { public void testEmpty() { assertCrc(0, new byte[0]); diff --git a/android/guava-tests/test/com/google/common/hash/FarmHashFingerprint64Test.java b/android/guava-tests/test/com/google/common/hash/FarmHashFingerprint64Test.java index 3a27f1109ee8..ec7023a16cd7 100644 --- a/android/guava-tests/test/com/google/common/hash/FarmHashFingerprint64Test.java +++ b/android/guava-tests/test/com/google/common/hash/FarmHashFingerprint64Test.java @@ -23,6 +23,7 @@ import com.google.common.base.Strings; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for FarmHashFingerprint64. @@ -30,6 +31,7 @@ * @author Kyle Maddison * @author Geoff Pike */ +@NullUnmarked public class FarmHashFingerprint64Test extends TestCase { private static final HashFunction HASH_FN = Hashing.farmHashFingerprint64(); diff --git a/android/guava-tests/test/com/google/common/hash/Fingerprint2011Test.java b/android/guava-tests/test/com/google/common/hash/Fingerprint2011Test.java index 7aafe77ced2c..d8db779ceda9 100644 --- a/android/guava-tests/test/com/google/common/hash/Fingerprint2011Test.java +++ b/android/guava-tests/test/com/google/common/hash/Fingerprint2011Test.java @@ -12,12 +12,14 @@ import com.google.common.primitives.UnsignedLong; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for Fingerprint2011. * * @author kylemaddison@google.com (Kyle Maddison) */ +@NullUnmarked public class Fingerprint2011Test extends TestCase { // Length of the sample string to produce diff --git a/android/guava-tests/test/com/google/common/hash/FunnelsTest.java b/android/guava-tests/test/com/google/common/hash/FunnelsTest.java index 653f0a81d1fa..862ddcb6d153 100644 --- a/android/guava-tests/test/com/google/common/hash/FunnelsTest.java +++ b/android/guava-tests/test/com/google/common/hash/FunnelsTest.java @@ -29,6 +29,7 @@ import java.nio.charset.Charset; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.mockito.InOrder; /** @@ -36,6 +37,7 @@ * * @author Dimitris Andreou */ +@NullUnmarked public class FunnelsTest extends TestCase { public void testForBytes() { PrimitiveSink primitiveSink = mock(PrimitiveSink.class); diff --git a/android/guava-tests/test/com/google/common/hash/HashCodeTest.java b/android/guava-tests/test/com/google/common/hash/HashCodeTest.java index 3de5fd043011..7e2b051ccbe0 100644 --- a/android/guava-tests/test/com/google/common/hash/HashCodeTest.java +++ b/android/guava-tests/test/com/google/common/hash/HashCodeTest.java @@ -25,6 +25,7 @@ import com.google.common.testing.ClassSanityTester; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -33,6 +34,7 @@ * @author Dimitris Andreou * @author Kurt Alfred Kluever */ +@NullUnmarked public class HashCodeTest extends TestCase { // note: asInt(), asLong() are in little endian private static final ImmutableList expectedHashCodes = diff --git a/android/guava-tests/test/com/google/common/hash/HashFunctionEnum.java b/android/guava-tests/test/com/google/common/hash/HashFunctionEnum.java index 34717477e645..fde53a30d6a1 100644 --- a/android/guava-tests/test/com/google/common/hash/HashFunctionEnum.java +++ b/android/guava-tests/test/com/google/common/hash/HashFunctionEnum.java @@ -16,12 +16,14 @@ package com.google.common.hash; +import org.jspecify.annotations.NullUnmarked; /** * An enum that contains all of the known hash functions. * * @author Kurt Alfred Kluever */ +@NullUnmarked enum HashFunctionEnum { ADLER32(Hashing.adler32()), CRC32(Hashing.crc32()), diff --git a/android/guava-tests/test/com/google/common/hash/HashTestUtils.java b/android/guava-tests/test/com/google/common/hash/HashTestUtils.java index 668119458790..85096df34df9 100644 --- a/android/guava-tests/test/com/google/common/hash/HashTestUtils.java +++ b/android/guava-tests/test/com/google/common/hash/HashTestUtils.java @@ -36,6 +36,7 @@ import java.util.Arrays; import java.util.Random; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Assert; /** @@ -44,6 +45,7 @@ * @author Dimitris Andreou * @author Kurt Alfred Kluever */ +@NullUnmarked final class HashTestUtils { private HashTestUtils() {} diff --git a/android/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java b/android/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java index 05351d94cdde..51c65cb5f78e 100644 --- a/android/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java +++ b/android/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java @@ -23,12 +23,14 @@ import java.io.ByteArrayInputStream; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link HashingInputStream}. * * @author Qian Huang */ +@NullUnmarked public class HashingInputStreamTest extends TestCase { private Hasher hasher; private HashFunction hashFunction; diff --git a/android/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java b/android/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java index 60eef10f0a60..9f4bf00f848d 100644 --- a/android/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java +++ b/android/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java @@ -22,12 +22,14 @@ import com.google.common.testing.NullPointerTester; import java.io.ByteArrayOutputStream; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link HashingOutputStream}. * * @author Zoe Piepmeier */ +@NullUnmarked public class HashingOutputStreamTest extends TestCase { private Hasher hasher; private HashFunction hashFunction; diff --git a/android/guava-tests/test/com/google/common/hash/HashingTest.java b/android/guava-tests/test/com/google/common/hash/HashingTest.java index bb71d1fbc848..a9d4433b3ea8 100644 --- a/android/guava-tests/test/com/google/common/hash/HashingTest.java +++ b/android/guava-tests/test/com/google/common/hash/HashingTest.java @@ -37,6 +37,7 @@ import java.util.Locale; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Hashing}. @@ -47,6 +48,7 @@ * @author Dimitris Andreou * @author Kurt Alfred Kluever */ +@NullUnmarked public class HashingTest extends TestCase { public void testMd5() { HashTestUtils.checkAvalanche(Hashing.md5(), 100, 0.4); diff --git a/android/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java b/android/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java index 2b118783c9c9..5d9d6489a458 100644 --- a/android/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java +++ b/android/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java @@ -30,6 +30,7 @@ import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import sun.security.jca.ProviderList; import sun.security.jca.Providers; @@ -39,6 +40,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class MacHashFunctionTest extends TestCase { private static final ImmutableSet INPUTS = ImmutableSet.of("", "Z", "foobar"); diff --git a/android/guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java b/android/guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java index c58d50d54352..127b0e7eeac7 100644 --- a/android/guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java +++ b/android/guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java @@ -25,12 +25,14 @@ import java.security.NoSuchAlgorithmException; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the MessageDigestHashFunction. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class MessageDigestHashFunctionTest extends TestCase { private static final ImmutableSet INPUTS = ImmutableSet.of("", "Z", "foobar"); diff --git a/android/guava-tests/test/com/google/common/hash/Murmur3Hash128Test.java b/android/guava-tests/test/com/google/common/hash/Murmur3Hash128Test.java index 35d423b45638..be1d5fb548f9 100644 --- a/android/guava-tests/test/com/google/common/hash/Murmur3Hash128Test.java +++ b/android/guava-tests/test/com/google/common/hash/Murmur3Hash128Test.java @@ -23,8 +23,10 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link Murmur3_128HashFunction}. */ +@NullUnmarked public class Murmur3Hash128Test extends TestCase { public void testKnownValues() { assertHash(0, 0x629942693e10f867L, 0x92db0b82baeb5347L, "hell"); diff --git a/android/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java b/android/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java index 704d9dbd4fc5..3728b44b5bf7 100644 --- a/android/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java +++ b/android/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java @@ -26,8 +26,10 @@ import java.nio.charset.Charset; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link Murmur3_32HashFunction}. */ +@NullUnmarked public class Murmur3Hash32Test extends TestCase { public void testKnownIntegerInputs() { assertHash(593689054, murmur3_32().hashInt(0)); diff --git a/android/guava-tests/test/com/google/common/hash/PackageSanityTests.java b/android/guava-tests/test/com/google/common/hash/PackageSanityTests.java index d2b0ef5261bb..e81d60515839 100644 --- a/android/guava-tests/test/com/google/common/hash/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/hash/PackageSanityTests.java @@ -18,6 +18,7 @@ import com.google.common.hash.BloomFilterStrategies.LockFreeBitArray; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -25,6 +26,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { setDefault(LockFreeBitArray.class, new LockFreeBitArray(1)); diff --git a/android/guava-tests/test/com/google/common/hash/SipHashFunctionTest.java b/android/guava-tests/test/com/google/common/hash/SipHashFunctionTest.java index 8effde04576f..64ff4e20c99d 100644 --- a/android/guava-tests/test/com/google/common/hash/SipHashFunctionTest.java +++ b/android/guava-tests/test/com/google/common/hash/SipHashFunctionTest.java @@ -18,12 +18,14 @@ import com.google.common.collect.ImmutableSet; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link SipHashFunction}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class SipHashFunctionTest extends TestCase { // From https://131002.net/siphash/siphash24.c diff --git a/android/guava-tests/test/com/google/common/html/HtmlEscapersTest.java b/android/guava-tests/test/com/google/common/html/HtmlEscapersTest.java index 776aa4c75eff..3f7b4a5b0805 100644 --- a/android/guava-tests/test/com/google/common/html/HtmlEscapersTest.java +++ b/android/guava-tests/test/com/google/common/html/HtmlEscapersTest.java @@ -18,6 +18,7 @@ import com.google.common.annotations.GwtCompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the {@link HtmlEscapers} class. @@ -25,6 +26,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked public class HtmlEscapersTest extends TestCase { public void testHtmlEscaper() throws Exception { diff --git a/android/guava-tests/test/com/google/common/io/AppendableWriterTest.java b/android/guava-tests/test/com/google/common/io/AppendableWriterTest.java index bfc6a082fa3d..7784e2d6b4bc 100644 --- a/android/guava-tests/test/com/google/common/io/AppendableWriterTest.java +++ b/android/guava-tests/test/com/google/common/io/AppendableWriterTest.java @@ -22,12 +22,14 @@ import java.io.Flushable; import java.io.IOException; import java.io.Writer; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link AppendableWriter}. * * @author Alan Green */ +@NullUnmarked public class AppendableWriterTest extends IoTestCase { /** Helper class for testing behavior with Flushable and Closeable targets. */ diff --git a/android/guava-tests/test/com/google/common/io/BaseEncodingTest.java b/android/guava-tests/test/com/google/common/io/BaseEncodingTest.java index 25b9787235cd..93d62cbe8553 100644 --- a/android/guava-tests/test/com/google/common/io/BaseEncodingTest.java +++ b/android/guava-tests/test/com/google/common/io/BaseEncodingTest.java @@ -37,6 +37,7 @@ import java.io.StringReader; import java.io.StringWriter; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -45,6 +46,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class BaseEncodingTest extends TestCase { public void testSeparatorsExplicitly() { diff --git a/android/guava-tests/test/com/google/common/io/ByteSinkTest.java b/android/guava-tests/test/com/google/common/io/ByteSinkTest.java index 4ce3981c0304..6fd8b634750a 100644 --- a/android/guava-tests/test/com/google/common/io/ByteSinkTest.java +++ b/android/guava-tests/test/com/google/common/io/ByteSinkTest.java @@ -27,12 +27,14 @@ import java.io.IOException; import java.io.OutputStream; import java.util.EnumSet; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the default implementations of {@code ByteSink} methods. * * @author Colin Decker */ +@NullUnmarked public class ByteSinkTest extends IoTestCase { private final byte[] bytes = newPreFilledByteArray(10000); diff --git a/android/guava-tests/test/com/google/common/io/ByteSinkTester.java b/android/guava-tests/test/com/google/common/io/ByteSinkTester.java index 18869eaa8b15..ebbaf5c1080f 100644 --- a/android/guava-tests/test/com/google/common/io/ByteSinkTester.java +++ b/android/guava-tests/test/com/google/common/io/ByteSinkTester.java @@ -28,6 +28,7 @@ import java.lang.reflect.Method; import java.util.Map.Entry; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * A generator of {@code TestSuite} instances for testing {@code ByteSink} implementations. @@ -37,6 +38,7 @@ * @author Colin Decker */ @AndroidIncompatible // TODO(b/230620681): Make this available (even though we won't run it). +@NullUnmarked public class ByteSinkTester extends SourceSinkTester { private static final ImmutableList testMethods = getTestMethods(ByteSinkTester.class); diff --git a/android/guava-tests/test/com/google/common/io/ByteSourceTest.java b/android/guava-tests/test/com/google/common/io/ByteSourceTest.java index 9a8f25fb4bc4..723224717d99 100644 --- a/android/guava-tests/test/com/google/common/io/ByteSourceTest.java +++ b/android/guava-tests/test/com/google/common/io/ByteSourceTest.java @@ -42,6 +42,7 @@ import java.util.Arrays; import java.util.EnumSet; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -49,6 +50,7 @@ * * @author Colin Decker */ +@NullUnmarked public class ByteSourceTest extends IoTestCase { @AndroidIncompatible // Android doesn't understand suites whose tests lack default constructors. diff --git a/android/guava-tests/test/com/google/common/io/ByteSourceTester.java b/android/guava-tests/test/com/google/common/io/ByteSourceTester.java index cbd7286c133b..4404ada69f6a 100644 --- a/android/guava-tests/test/com/google/common/io/ByteSourceTester.java +++ b/android/guava-tests/test/com/google/common/io/ByteSourceTester.java @@ -35,6 +35,7 @@ import java.util.Map.Entry; import java.util.Random; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * A generator of {@code TestSuite} instances for testing {@code ByteSource} implementations. @@ -45,6 +46,7 @@ * @author Colin Decker */ @AndroidIncompatible // TODO(b/230620681): Make this available (even though we won't run it). +@NullUnmarked public class ByteSourceTester extends SourceSinkTester { private static final ImmutableList testMethods = getTestMethods(ByteSourceTester.class); diff --git a/android/guava-tests/test/com/google/common/io/ByteStreamsTest.java b/android/guava-tests/test/com/google/common/io/ByteStreamsTest.java index c5f552dd0924..9c0048f0ca5d 100644 --- a/android/guava-tests/test/com/google/common/io/ByteStreamsTest.java +++ b/android/guava-tests/test/com/google/common/io/ByteStreamsTest.java @@ -37,12 +37,14 @@ import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ByteStreams}. * * @author Chris Nokleberg */ +@NullUnmarked public class ByteStreamsTest extends IoTestCase { public void testCopyChannel() throws IOException { diff --git a/android/guava-tests/test/com/google/common/io/CharSequenceReaderTest.java b/android/guava-tests/test/com/google/common/io/CharSequenceReaderTest.java index 6a4b3c472208..bb97b591ffd7 100644 --- a/android/guava-tests/test/com/google/common/io/CharSequenceReaderTest.java +++ b/android/guava-tests/test/com/google/common/io/CharSequenceReaderTest.java @@ -21,12 +21,14 @@ import java.io.IOException; import java.nio.CharBuffer; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link CharSequenceReader}. * * @author Colin Decker */ +@NullUnmarked public class CharSequenceReaderTest extends TestCase { public void testReadEmptyString() throws IOException { diff --git a/android/guava-tests/test/com/google/common/io/CharSinkTest.java b/android/guava-tests/test/com/google/common/io/CharSinkTest.java index 3718c278d58d..d2d59d35be0f 100644 --- a/android/guava-tests/test/com/google/common/io/CharSinkTest.java +++ b/android/guava-tests/test/com/google/common/io/CharSinkTest.java @@ -28,12 +28,14 @@ import java.io.StringReader; import java.io.Writer; import java.util.EnumSet; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the default implementations of {@code CharSink} methods. * * @author Colin Decker */ +@NullUnmarked public class CharSinkTest extends IoTestCase { private static final String STRING = ASCII + I18N; diff --git a/android/guava-tests/test/com/google/common/io/CharSinkTester.java b/android/guava-tests/test/com/google/common/io/CharSinkTester.java index 58a75498ca4e..fb1fbd59b81e 100644 --- a/android/guava-tests/test/com/google/common/io/CharSinkTester.java +++ b/android/guava-tests/test/com/google/common/io/CharSinkTester.java @@ -25,6 +25,7 @@ import java.lang.reflect.Method; import java.util.Map.Entry; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * A generator of {@code TestSuite} instances for testing {@code CharSink} implementations. @@ -33,6 +34,7 @@ * @author Colin Decker */ @AndroidIncompatible // TODO(b/230620681): Make this available (even though we won't run it). +@NullUnmarked public class CharSinkTester extends SourceSinkTester { private static final ImmutableList testMethods = getTestMethods(CharSinkTester.class); diff --git a/android/guava-tests/test/com/google/common/io/CharSourceTest.java b/android/guava-tests/test/com/google/common/io/CharSourceTest.java index e59bfcb6448c..165f27f887e3 100644 --- a/android/guava-tests/test/com/google/common/io/CharSourceTest.java +++ b/android/guava-tests/test/com/google/common/io/CharSourceTest.java @@ -37,12 +37,14 @@ import java.util.List; import java.util.stream.Stream; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the default implementations of {@code CharSource} methods. * * @author Colin Decker */ +@NullUnmarked public class CharSourceTest extends IoTestCase { @AndroidIncompatible // Android doesn't understand suites whose tests lack default constructors. diff --git a/android/guava-tests/test/com/google/common/io/CharSourceTester.java b/android/guava-tests/test/com/google/common/io/CharSourceTester.java index aec3e6ff0d19..7d72a818f49c 100644 --- a/android/guava-tests/test/com/google/common/io/CharSourceTester.java +++ b/android/guava-tests/test/com/google/common/io/CharSourceTester.java @@ -31,6 +31,7 @@ import java.util.List; import java.util.Map.Entry; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * A generator of {@code TestSuite} instances for testing {@code CharSource} implementations. @@ -40,6 +41,7 @@ * @author Colin Decker */ @AndroidIncompatible // TODO(b/230620681): Make this available (even though we won't run it). +@NullUnmarked public class CharSourceTester extends SourceSinkTester { private static final ImmutableList testMethods = getTestMethods(CharSourceTester.class); diff --git a/android/guava-tests/test/com/google/common/io/CharStreamsTest.java b/android/guava-tests/test/com/google/common/io/CharStreamsTest.java index e33574e45834..f36a1dcc74a4 100644 --- a/android/guava-tests/test/com/google/common/io/CharStreamsTest.java +++ b/android/guava-tests/test/com/google/common/io/CharStreamsTest.java @@ -29,12 +29,14 @@ import java.io.Writer; import java.nio.CharBuffer; import java.util.List; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link CharStreams}. * * @author Chris Nokleberg */ +@NullUnmarked public class CharStreamsTest extends IoTestCase { private static final String TEXT = "The quick brown fox jumped over the lazy dog."; diff --git a/android/guava-tests/test/com/google/common/io/CloseablesTest.java b/android/guava-tests/test/com/google/common/io/CloseablesTest.java index 34648b46e88d..2ac954c11f34 100644 --- a/android/guava-tests/test/com/google/common/io/CloseablesTest.java +++ b/android/guava-tests/test/com/google/common/io/CloseablesTest.java @@ -26,6 +26,7 @@ import java.io.InputStream; import java.io.Reader; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Closeables}. @@ -35,6 +36,7 @@ * * @author Michael Lancaster */ +@NullUnmarked public class CloseablesTest extends TestCase { private Closeable mockCloseable; diff --git a/android/guava-tests/test/com/google/common/io/CloserTest.java b/android/guava-tests/test/com/google/common/io/CloserTest.java index 6dce40fda390..f906c4c793f8 100644 --- a/android/guava-tests/test/com/google/common/io/CloserTest.java +++ b/android/guava-tests/test/com/google/common/io/CloserTest.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -36,6 +37,7 @@ * * @author Colin Decker */ +@NullUnmarked public class CloserTest extends TestCase { private TestSuppressor suppressor; diff --git a/android/guava-tests/test/com/google/common/io/CountingInputStreamTest.java b/android/guava-tests/test/com/google/common/io/CountingInputStreamTest.java index 945f5d023386..20212ae40955 100644 --- a/android/guava-tests/test/com/google/common/io/CountingInputStreamTest.java +++ b/android/guava-tests/test/com/google/common/io/CountingInputStreamTest.java @@ -22,12 +22,14 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link CountingInputStream}. * * @author Chris Nokleberg */ +@NullUnmarked public class CountingInputStreamTest extends IoTestCase { private CountingInputStream counter; diff --git a/android/guava-tests/test/com/google/common/io/CountingOutputStreamTest.java b/android/guava-tests/test/com/google/common/io/CountingOutputStreamTest.java index d5023492b381..6a1a1e70180d 100644 --- a/android/guava-tests/test/com/google/common/io/CountingOutputStreamTest.java +++ b/android/guava-tests/test/com/google/common/io/CountingOutputStreamTest.java @@ -19,12 +19,14 @@ import static org.junit.Assert.assertThrows; import java.io.ByteArrayOutputStream; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link CountingOutputStream}. * * @author Chris Nokleberg */ +@NullUnmarked public class CountingOutputStreamTest extends IoTestCase { public void testCount() throws Exception { diff --git a/android/guava-tests/test/com/google/common/io/FileBackedOutputStreamAndroidIncompatibleTest.java b/android/guava-tests/test/com/google/common/io/FileBackedOutputStreamAndroidIncompatibleTest.java index 4ecdcf8d5688..1386de3c45b6 100644 --- a/android/guava-tests/test/com/google/common/io/FileBackedOutputStreamAndroidIncompatibleTest.java +++ b/android/guava-tests/test/com/google/common/io/FileBackedOutputStreamAndroidIncompatibleTest.java @@ -20,6 +20,7 @@ import com.google.common.testing.GcFinalization; import java.io.File; +import org.jspecify.annotations.NullUnmarked; /** * Android-incompatible tests for {@link FileBackedOutputStream}. @@ -27,6 +28,7 @@ * @author Chris Nokleberg */ @AndroidIncompatible // Finalization probably just doesn't happen fast enough? +@NullUnmarked public class FileBackedOutputStreamAndroidIncompatibleTest extends IoTestCase { public void testFinalizeDeletesFile() throws Exception { diff --git a/android/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java b/android/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java index 2561e2b5c5ed..3cbf5a1028a7 100644 --- a/android/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java +++ b/android/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java @@ -30,6 +30,7 @@ import java.nio.file.attribute.PosixFileAttributeView; import java.nio.file.attribute.PosixFileAttributes; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link FileBackedOutputStream}. @@ -38,6 +39,7 @@ * * @author Chris Nokleberg */ +@NullUnmarked public class FileBackedOutputStreamTest extends IoTestCase { diff --git a/android/guava-tests/test/com/google/common/io/FilesCreateTempDirTest.java b/android/guava-tests/test/com/google/common/io/FilesCreateTempDirTest.java index 381eef258425..1b15f3c8569b 100644 --- a/android/guava-tests/test/com/google/common/io/FilesCreateTempDirTest.java +++ b/android/guava-tests/test/com/google/common/io/FilesCreateTempDirTest.java @@ -30,6 +30,7 @@ import java.nio.file.attribute.PosixFileAttributeView; import java.nio.file.attribute.PosixFileAttributes; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Files#createTempDir}. @@ -38,6 +39,7 @@ */ @SuppressWarnings("deprecation") // tests of a deprecated method +@NullUnmarked public class FilesCreateTempDirTest extends TestCase { public void testCreateTempDir() throws IOException { if (JAVA_IO_TMPDIR.value().equals("/sdcard")) { diff --git a/android/guava-tests/test/com/google/common/io/FilesFileTraverserTest.java b/android/guava-tests/test/com/google/common/io/FilesFileTraverserTest.java index 9409d216df62..5353bd709a7b 100644 --- a/android/guava-tests/test/com/google/common/io/FilesFileTraverserTest.java +++ b/android/guava-tests/test/com/google/common/io/FilesFileTraverserTest.java @@ -22,6 +22,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.io.File; import java.io.IOException; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Files#fileTraverser()}. @@ -29,6 +30,7 @@ * @author Jens Nyman */ +@NullUnmarked public class FilesFileTraverserTest extends IoTestCase { private File rootDir; diff --git a/android/guava-tests/test/com/google/common/io/FilesSimplifyPathTest.java b/android/guava-tests/test/com/google/common/io/FilesSimplifyPathTest.java index 2afd5bf2a843..eb87be285ead 100644 --- a/android/guava-tests/test/com/google/common/io/FilesSimplifyPathTest.java +++ b/android/guava-tests/test/com/google/common/io/FilesSimplifyPathTest.java @@ -25,12 +25,14 @@ import java.net.URL; import java.util.Iterator; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Files#simplifyPath}. * * @author Pablo Bellver */ +@NullUnmarked public class FilesSimplifyPathTest extends TestCase { public void testSimplifyEmptyString() { diff --git a/android/guava-tests/test/com/google/common/io/FilesTest.java b/android/guava-tests/test/com/google/common/io/FilesTest.java index 6f6603edbdf5..1111471e185e 100644 --- a/android/guava-tests/test/com/google/common/io/FilesTest.java +++ b/android/guava-tests/test/com/google/common/io/FilesTest.java @@ -41,6 +41,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Files}. @@ -56,6 +57,7 @@ */ @SuppressWarnings("InlineMeInliner") // many tests of deprecated methods +@NullUnmarked public class FilesTest extends IoTestCase { @AndroidIncompatible // suites, ByteSourceTester (b/230620681) diff --git a/android/guava-tests/test/com/google/common/io/FlushablesTest.java b/android/guava-tests/test/com/google/common/io/FlushablesTest.java index b45150a43d44..ddb8bdeace43 100644 --- a/android/guava-tests/test/com/google/common/io/FlushablesTest.java +++ b/android/guava-tests/test/com/google/common/io/FlushablesTest.java @@ -23,6 +23,7 @@ import java.io.Flushable; import java.io.IOException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Flushables}. @@ -32,6 +33,7 @@ * * @author Michael Lancaster */ +@NullUnmarked public class FlushablesTest extends TestCase { private Flushable mockFlushable; diff --git a/android/guava-tests/test/com/google/common/io/IoTestCase.java b/android/guava-tests/test/com/google/common/io/IoTestCase.java index a5aa6dd44eaa..d188ccf43185 100644 --- a/android/guava-tests/test/com/google/common/io/IoTestCase.java +++ b/android/guava-tests/test/com/google/common/io/IoTestCase.java @@ -28,6 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -36,6 +37,7 @@ * @author Chris Nokleberg * @author Colin Decker */ +@NullUnmarked public abstract class IoTestCase extends TestCase { private static final Logger logger = Logger.getLogger(IoTestCase.class.getName()); diff --git a/android/guava-tests/test/com/google/common/io/LineBufferTest.java b/android/guava-tests/test/com/google/common/io/LineBufferTest.java index 159d9252728b..eea7686917d6 100644 --- a/android/guava-tests/test/com/google/common/io/LineBufferTest.java +++ b/android/guava-tests/test/com/google/common/io/LineBufferTest.java @@ -29,6 +29,7 @@ import java.nio.CharBuffer; import java.util.Arrays; import java.util.List; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link LineBuffer} and {@link LineReader}. @@ -36,6 +37,7 @@ * @author Chris Nokleberg */ @AndroidIncompatible // occasionally very slow +@NullUnmarked public class LineBufferTest extends IoTestCase { public void testProcess() throws IOException { diff --git a/android/guava-tests/test/com/google/common/io/LittleEndianDataInputStreamTest.java b/android/guava-tests/test/com/google/common/io/LittleEndianDataInputStreamTest.java index faa0b9549835..e5280bc90aee 100644 --- a/android/guava-tests/test/com/google/common/io/LittleEndianDataInputStreamTest.java +++ b/android/guava-tests/test/com/google/common/io/LittleEndianDataInputStreamTest.java @@ -27,12 +27,14 @@ import java.io.EOFException; import java.io.IOException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test class for {@link LittleEndianDataInputStream}. * * @author Chris Nokleberg */ +@NullUnmarked public class LittleEndianDataInputStreamTest extends TestCase { private byte[] data; diff --git a/android/guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java b/android/guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java index 8f2f02e7f14f..a1643a62a8b2 100644 --- a/android/guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java +++ b/android/guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java @@ -25,12 +25,14 @@ import java.io.DataInputStream; import java.io.IOException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test class for {@link LittleEndianDataOutputStream}. * * @author Keith Bottner */ +@NullUnmarked public class LittleEndianDataOutputStreamTest extends TestCase { private ByteArrayOutputStream baos = new ByteArrayOutputStream(); diff --git a/android/guava-tests/test/com/google/common/io/MoreFilesTest.java b/android/guava-tests/test/com/google/common/io/MoreFilesTest.java index a8c041bab6f8..8028759ff971 100644 --- a/android/guava-tests/test/com/google/common/io/MoreFilesTest.java +++ b/android/guava-tests/test/com/google/common/io/MoreFilesTest.java @@ -46,6 +46,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link MoreFiles}. @@ -55,6 +56,7 @@ * @author Colin Decker */ +@NullUnmarked public class MoreFilesTest extends TestCase { /* diff --git a/android/guava-tests/test/com/google/common/io/MultiInputStreamTest.java b/android/guava-tests/test/com/google/common/io/MultiInputStreamTest.java index 2b68595201af..d9e30620ea62 100644 --- a/android/guava-tests/test/com/google/common/io/MultiInputStreamTest.java +++ b/android/guava-tests/test/com/google/common/io/MultiInputStreamTest.java @@ -23,12 +23,14 @@ import java.io.InputStream; import java.util.Collections; import java.util.List; +import org.jspecify.annotations.NullUnmarked; /** * Test class for {@link MultiInputStream}. * * @author Chris Nokleberg */ +@NullUnmarked public class MultiInputStreamTest extends IoTestCase { public void testJoin() throws Exception { diff --git a/android/guava-tests/test/com/google/common/io/MultiReaderTest.java b/android/guava-tests/test/com/google/common/io/MultiReaderTest.java index 20b4042b6c24..0b335d9da3ac 100644 --- a/android/guava-tests/test/com/google/common/io/MultiReaderTest.java +++ b/android/guava-tests/test/com/google/common/io/MultiReaderTest.java @@ -22,8 +22,12 @@ import java.io.Reader; import java.io.StringReader; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author ricebin */ +/** + * @author ricebin + */ +@NullUnmarked public class MultiReaderTest extends TestCase { public void testOnlyOneOpen() throws Exception { diff --git a/android/guava-tests/test/com/google/common/io/PackageSanityTests.java b/android/guava-tests/test/com/google/common/io/PackageSanityTests.java index cae49682e796..3beef50c6bae 100644 --- a/android/guava-tests/test/com/google/common/io/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/io/PackageSanityTests.java @@ -22,6 +22,7 @@ import java.lang.reflect.Method; import java.nio.channels.FileChannel.MapMode; import java.nio.charset.CharsetEncoder; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -29,6 +30,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { setDefault(BaseEncoding.class, BaseEncoding.base64()); diff --git a/android/guava-tests/test/com/google/common/io/PatternFilenameFilterTest.java b/android/guava-tests/test/com/google/common/io/PatternFilenameFilterTest.java index 699b2a458999..ecd914ae1821 100644 --- a/android/guava-tests/test/com/google/common/io/PatternFilenameFilterTest.java +++ b/android/guava-tests/test/com/google/common/io/PatternFilenameFilterTest.java @@ -24,12 +24,14 @@ import java.io.FilenameFilter; import java.util.regex.PatternSyntaxException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link PatternFilenameFilter}. * * @author Chris Nokleberg */ +@NullUnmarked public class PatternFilenameFilterTest extends TestCase { public void testSyntaxException() { diff --git a/android/guava-tests/test/com/google/common/io/RandomAmountInputStream.java b/android/guava-tests/test/com/google/common/io/RandomAmountInputStream.java index d457ec7dcf8c..468db514b4cd 100644 --- a/android/guava-tests/test/com/google/common/io/RandomAmountInputStream.java +++ b/android/guava-tests/test/com/google/common/io/RandomAmountInputStream.java @@ -22,8 +22,10 @@ import java.io.IOException; import java.io.InputStream; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** Returns a random portion of the requested bytes on each call. */ +@NullUnmarked class RandomAmountInputStream extends FilterInputStream { private final Random random; diff --git a/android/guava-tests/test/com/google/common/io/ResourcesTest.java b/android/guava-tests/test/com/google/common/io/ResourcesTest.java index c5f3e26c2a8f..1e8a3026d7c1 100644 --- a/android/guava-tests/test/com/google/common/io/ResourcesTest.java +++ b/android/guava-tests/test/com/google/common/io/ResourcesTest.java @@ -33,6 +33,7 @@ import java.util.ArrayList; import java.util.List; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Resources}. @@ -40,6 +41,7 @@ * @author Chris Nokleberg */ +@NullUnmarked public class ResourcesTest extends IoTestCase { @AndroidIncompatible // wouldn't run anyway, but strip the source entirely because of b/230620681 diff --git a/android/guava-tests/test/com/google/common/io/SourceSinkFactories.java b/android/guava-tests/test/com/google/common/io/SourceSinkFactories.java index 43dea7f8b293..bf654242d8f9 100644 --- a/android/guava-tests/test/com/google/common/io/SourceSinkFactories.java +++ b/android/guava-tests/test/com/google/common/io/SourceSinkFactories.java @@ -38,6 +38,7 @@ import java.nio.CharBuffer; import java.util.Arrays; import java.util.logging.Logger; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -45,6 +46,7 @@ * * @author Colin Decker */ +@NullUnmarked public class SourceSinkFactories { private SourceSinkFactories() {} diff --git a/android/guava-tests/test/com/google/common/io/SourceSinkFactory.java b/android/guava-tests/test/com/google/common/io/SourceSinkFactory.java index b8cbc919ecf5..9d086c0d4ae3 100644 --- a/android/guava-tests/test/com/google/common/io/SourceSinkFactory.java +++ b/android/guava-tests/test/com/google/common/io/SourceSinkFactory.java @@ -18,6 +18,7 @@ import java.io.File; import java.io.IOException; +import org.jspecify.annotations.NullUnmarked; /** * A test factory for byte or char sources or sinks. In addition to creating sources or sinks, the @@ -32,6 +33,7 @@ * @param the data type (byte[] or String) * @author Colin Decker */ +@NullUnmarked public interface SourceSinkFactory { /** diff --git a/android/guava-tests/test/com/google/common/io/SourceSinkTester.java b/android/guava-tests/test/com/google/common/io/SourceSinkTester.java index 544467f9dfc4..28bf66f853d3 100644 --- a/android/guava-tests/test/com/google/common/io/SourceSinkTester.java +++ b/android/guava-tests/test/com/google/common/io/SourceSinkTester.java @@ -28,6 +28,7 @@ import java.lang.reflect.Modifier; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * @param the source or sink type @@ -36,6 +37,7 @@ * @author Colin Decker */ @AndroidIncompatible // TODO(b/230620681): Make this available (even though we won't run it). +@NullUnmarked public class SourceSinkTester> extends TestCase { static final String LOREM_IPSUM = diff --git a/android/guava-tests/test/com/google/common/io/TestByteSink.java b/android/guava-tests/test/com/google/common/io/TestByteSink.java index b7eeef0d7ac8..756fdd133d9f 100644 --- a/android/guava-tests/test/com/google/common/io/TestByteSink.java +++ b/android/guava-tests/test/com/google/common/io/TestByteSink.java @@ -20,12 +20,14 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; +import org.jspecify.annotations.NullUnmarked; /** * A byte sink for testing that has configurable behavior. * * @author Colin Decker */ +@NullUnmarked public class TestByteSink extends ByteSink implements TestStreamSupplier { private final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); diff --git a/android/guava-tests/test/com/google/common/io/TestByteSource.java b/android/guava-tests/test/com/google/common/io/TestByteSource.java index 54ee982dad5e..1f068c423b23 100644 --- a/android/guava-tests/test/com/google/common/io/TestByteSource.java +++ b/android/guava-tests/test/com/google/common/io/TestByteSource.java @@ -23,12 +23,14 @@ import java.io.IOException; import java.io.InputStream; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * A byte source for testing that has configurable behavior. * * @author Colin Decker */ +@NullUnmarked public final class TestByteSource extends ByteSource implements TestStreamSupplier { private final byte[] bytes; diff --git a/android/guava-tests/test/com/google/common/io/TestCharSink.java b/android/guava-tests/test/com/google/common/io/TestCharSink.java index f98deed59faf..e87642cab8a6 100644 --- a/android/guava-tests/test/com/google/common/io/TestCharSink.java +++ b/android/guava-tests/test/com/google/common/io/TestCharSink.java @@ -22,12 +22,14 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; +import org.jspecify.annotations.NullUnmarked; /** * A char sink for testing that has configurable behavior. * * @author Colin Decker */ +@NullUnmarked public class TestCharSink extends CharSink implements TestStreamSupplier { private final TestByteSink byteSink; diff --git a/android/guava-tests/test/com/google/common/io/TestCharSource.java b/android/guava-tests/test/com/google/common/io/TestCharSource.java index 8b414db01324..f7c589a33624 100644 --- a/android/guava-tests/test/com/google/common/io/TestCharSource.java +++ b/android/guava-tests/test/com/google/common/io/TestCharSource.java @@ -21,12 +21,14 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; +import org.jspecify.annotations.NullUnmarked; /** * A char source for testing that has configurable options. * * @author Colin Decker */ +@NullUnmarked public class TestCharSource extends CharSource implements TestStreamSupplier { private final TestByteSource byteSource; diff --git a/android/guava-tests/test/com/google/common/io/TestInputStream.java b/android/guava-tests/test/com/google/common/io/TestInputStream.java index c885cf75f4cf..18fa18e8ba60 100644 --- a/android/guava-tests/test/com/google/common/io/TestInputStream.java +++ b/android/guava-tests/test/com/google/common/io/TestInputStream.java @@ -27,8 +27,12 @@ import java.io.IOException; import java.io.InputStream; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; -/** @author Colin Decker */ +/** + * @author Colin Decker + */ +@NullUnmarked public class TestInputStream extends FilterInputStream { private final ImmutableSet options; diff --git a/android/guava-tests/test/com/google/common/io/TestOption.java b/android/guava-tests/test/com/google/common/io/TestOption.java index 5ebd1f1f6c6e..b370476161d4 100644 --- a/android/guava-tests/test/com/google/common/io/TestOption.java +++ b/android/guava-tests/test/com/google/common/io/TestOption.java @@ -16,11 +16,14 @@ package com.google.common.io; +import org.jspecify.annotations.NullUnmarked; + /** * Options controlling the behavior of sources/sinks/streams for testing. * * @author Colin Decker */ +@NullUnmarked public enum TestOption { OPEN_THROWS, SKIP_THROWS, diff --git a/android/guava-tests/test/com/google/common/io/TestOutputStream.java b/android/guava-tests/test/com/google/common/io/TestOutputStream.java index 1a40b837cfed..56847e360b55 100644 --- a/android/guava-tests/test/com/google/common/io/TestOutputStream.java +++ b/android/guava-tests/test/com/google/common/io/TestOutputStream.java @@ -26,8 +26,12 @@ import java.io.IOException; import java.io.OutputStream; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; -/** @author Colin Decker */ +/** + * @author Colin Decker + */ +@NullUnmarked public class TestOutputStream extends FilterOutputStream { private final ImmutableSet options; diff --git a/android/guava-tests/test/com/google/common/io/TestReader.java b/android/guava-tests/test/com/google/common/io/TestReader.java index b45ede0aab08..9f41cbdc8312 100644 --- a/android/guava-tests/test/com/google/common/io/TestReader.java +++ b/android/guava-tests/test/com/google/common/io/TestReader.java @@ -23,8 +23,12 @@ import java.io.FilterReader; import java.io.IOException; import java.io.InputStreamReader; +import org.jspecify.annotations.NullUnmarked; -/** @author Colin Decker */ +/** + * @author Colin Decker + */ +@NullUnmarked public class TestReader extends FilterReader { private final TestInputStream in; diff --git a/android/guava-tests/test/com/google/common/io/TestStreamSupplier.java b/android/guava-tests/test/com/google/common/io/TestStreamSupplier.java index dcaa20b8944b..e5beeed6f8aa 100644 --- a/android/guava-tests/test/com/google/common/io/TestStreamSupplier.java +++ b/android/guava-tests/test/com/google/common/io/TestStreamSupplier.java @@ -16,6 +16,8 @@ package com.google.common.io; +import org.jspecify.annotations.NullUnmarked; + /** * Interface for a supplier of streams that can report whether a stream was opened and whether that * stream was closed. Intended for use in a test where only a single stream should be opened and @@ -23,6 +25,7 @@ * * @author Colin Decker */ +@NullUnmarked public interface TestStreamSupplier { /** Returns whether or not a new stream was opened. */ diff --git a/android/guava-tests/test/com/google/common/io/TestWriter.java b/android/guava-tests/test/com/google/common/io/TestWriter.java index 4f73f50dcb86..50f5fe9608c5 100644 --- a/android/guava-tests/test/com/google/common/io/TestWriter.java +++ b/android/guava-tests/test/com/google/common/io/TestWriter.java @@ -22,8 +22,12 @@ import java.io.FilterWriter; import java.io.IOException; import java.io.OutputStreamWriter; +import org.jspecify.annotations.NullUnmarked; -/** @author Colin Decker */ +/** + * @author Colin Decker + */ +@NullUnmarked public class TestWriter extends FilterWriter { private final TestOutputStream out; diff --git a/android/guava-tests/test/com/google/common/math/BigDecimalMathTest.java b/android/guava-tests/test/com/google/common/math/BigDecimalMathTest.java index b200a3840673..bb383a0d891d 100644 --- a/android/guava-tests/test/com/google/common/math/BigDecimalMathTest.java +++ b/android/guava-tests/test/com/google/common/math/BigDecimalMathTest.java @@ -35,8 +35,10 @@ import java.util.EnumSet; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible +@NullUnmarked public class BigDecimalMathTest extends TestCase { private static final class RoundToDoubleTester { private final BigDecimal input; diff --git a/android/guava-tests/test/com/google/common/math/DoubleMathTest.java b/android/guava-tests/test/com/google/common/math/DoubleMathTest.java index 70ae02c6e540..48e72054023f 100644 --- a/android/guava-tests/test/com/google/common/math/DoubleMathTest.java +++ b/android/guava-tests/test/com/google/common/math/DoubleMathTest.java @@ -53,6 +53,7 @@ import java.util.Arrays; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code DoubleMath}. @@ -60,6 +61,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class DoubleMathTest extends TestCase { private static final BigDecimal MAX_INT_AS_BIG_DECIMAL = BigDecimal.valueOf(Integer.MAX_VALUE); diff --git a/android/guava-tests/test/com/google/common/math/DoubleUtilsTest.java b/android/guava-tests/test/com/google/common/math/DoubleUtilsTest.java index d3014731ef18..94c6c5a625a5 100644 --- a/android/guava-tests/test/com/google/common/math/DoubleUtilsTest.java +++ b/android/guava-tests/test/com/google/common/math/DoubleUtilsTest.java @@ -25,12 +25,14 @@ import java.lang.reflect.Method; import java.math.BigInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link DoubleUtils}. * * @author Louis Wasserman */ +@NullUnmarked public class DoubleUtilsTest extends TestCase { @AndroidIncompatible // no FpUtils and no Math.nextDown in old versions public void testNextDown() throws Exception { diff --git a/android/guava-tests/test/com/google/common/math/IntMathTest.java b/android/guava-tests/test/com/google/common/math/IntMathTest.java index 320992478d3e..cd78b28b97e2 100644 --- a/android/guava-tests/test/com/google/common/math/IntMathTest.java +++ b/android/guava-tests/test/com/google/common/math/IntMathTest.java @@ -39,6 +39,7 @@ import java.math.RoundingMode; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link IntMath}. @@ -46,6 +47,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class IntMathTest extends TestCase { public void testMaxSignedPowerOfTwo() { assertTrue(IntMath.isPowerOfTwo(IntMath.MAX_SIGNED_POWER_OF_TWO)); diff --git a/android/guava-tests/test/com/google/common/math/LinearTransformationTest.java b/android/guava-tests/test/com/google/common/math/LinearTransformationTest.java index a9d028980245..c18b7d6360a5 100644 --- a/android/guava-tests/test/com/google/common/math/LinearTransformationTest.java +++ b/android/guava-tests/test/com/google/common/math/LinearTransformationTest.java @@ -24,12 +24,14 @@ import static org.junit.Assert.assertThrows; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link LinearTransformation}. * * @author Pete Gillin */ +@NullUnmarked public class LinearTransformationTest extends TestCase { private static final double ALLOWED_ERROR = 1e-10; diff --git a/android/guava-tests/test/com/google/common/math/LongMathTest.java b/android/guava-tests/test/com/google/common/math/LongMathTest.java index 2b783840a8c2..85270faf2fa3 100644 --- a/android/guava-tests/test/com/google/common/math/LongMathTest.java +++ b/android/guava-tests/test/com/google/common/math/LongMathTest.java @@ -42,6 +42,7 @@ import java.util.EnumSet; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for LongMath. @@ -49,6 +50,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class LongMathTest extends TestCase { @SuppressWarnings("ConstantOverflow") public void testMaxSignedPowerOfTwo() { diff --git a/android/guava-tests/test/com/google/common/math/MathBenchmarking.java b/android/guava-tests/test/com/google/common/math/MathBenchmarking.java index 0c2aecfbba33..6f46dfe6c2a8 100644 --- a/android/guava-tests/test/com/google/common/math/MathBenchmarking.java +++ b/android/guava-tests/test/com/google/common/math/MathBenchmarking.java @@ -18,6 +18,7 @@ import java.math.BigInteger; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Utilities for benchmarks. @@ -28,6 +29,7 @@ * * @author Louis Wasserman */ +@NullUnmarked final class MathBenchmarking { static final int ARRAY_SIZE = 0x10000; static final int ARRAY_MASK = 0x0ffff; diff --git a/android/guava-tests/test/com/google/common/math/MathPreconditionsTest.java b/android/guava-tests/test/com/google/common/math/MathPreconditionsTest.java index 8a50627ce53b..8f7b396d2c2c 100644 --- a/android/guava-tests/test/com/google/common/math/MathPreconditionsTest.java +++ b/android/guava-tests/test/com/google/common/math/MathPreconditionsTest.java @@ -23,6 +23,7 @@ import java.math.BigInteger; import java.math.RoundingMode; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link MathPreconditions}. @@ -30,6 +31,7 @@ * @author Ben Yu */ @GwtCompatible +@NullUnmarked public class MathPreconditionsTest extends TestCase { public void testCheckPositive_zeroInt() { diff --git a/android/guava-tests/test/com/google/common/math/MathTesting.java b/android/guava-tests/test/com/google/common/math/MathTesting.java index 0e49835d8ce7..7e2fdc4a5737 100644 --- a/android/guava-tests/test/com/google/common/math/MathTesting.java +++ b/android/guava-tests/test/com/google/common/math/MathTesting.java @@ -36,6 +36,7 @@ import com.google.common.primitives.Doubles; import java.math.BigInteger; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** * Exhaustive input sets for every integral type. @@ -43,6 +44,7 @@ * @author Louis Wasserman */ @GwtCompatible +@NullUnmarked public class MathTesting { static final ImmutableSet ALL_ROUNDING_MODES = ImmutableSet.copyOf(RoundingMode.values()); diff --git a/android/guava-tests/test/com/google/common/math/PackageSanityTests.java b/android/guava-tests/test/com/google/common/math/PackageSanityTests.java index 1fc7cc7c23bf..a46527b6c2c2 100644 --- a/android/guava-tests/test/com/google/common/math/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/math/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.math; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -24,6 +25,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { publicApiOnly(); diff --git a/android/guava-tests/test/com/google/common/math/PairedStatsAccumulatorTest.java b/android/guava-tests/test/com/google/common/math/PairedStatsAccumulatorTest.java index 3f0d28e9a4da..326ea0c70ea1 100644 --- a/android/guava-tests/test/com/google/common/math/PairedStatsAccumulatorTest.java +++ b/android/guava-tests/test/com/google/common/math/PairedStatsAccumulatorTest.java @@ -49,6 +49,7 @@ import com.google.common.math.StatsTesting.ManyValues; import java.util.Collections; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link PairedStatsAccumulator}. This tests the stats methods for instances built with @@ -58,6 +59,7 @@ * * @author Pete Gillin */ +@NullUnmarked public class PairedStatsAccumulatorTest extends TestCase { private PairedStatsAccumulator emptyAccumulator; diff --git a/android/guava-tests/test/com/google/common/math/PairedStatsTest.java b/android/guava-tests/test/com/google/common/math/PairedStatsTest.java index 95ca1241b772..307ed451fefc 100644 --- a/android/guava-tests/test/com/google/common/math/PairedStatsTest.java +++ b/android/guava-tests/test/com/google/common/math/PairedStatsTest.java @@ -57,6 +57,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link PairedStats}. This tests instances created by {@link @@ -64,6 +65,7 @@ * * @author Pete Gillin */ +@NullUnmarked public class PairedStatsTest extends TestCase { public void testCount() { diff --git a/android/guava-tests/test/com/google/common/math/QuantilesAlgorithm.java b/android/guava-tests/test/com/google/common/math/QuantilesAlgorithm.java index ddb2064e20b6..9a6fe1d39cd4 100644 --- a/android/guava-tests/test/com/google/common/math/QuantilesAlgorithm.java +++ b/android/guava-tests/test/com/google/common/math/QuantilesAlgorithm.java @@ -21,6 +21,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; /** * Enumerates several algorithms providing equivalent functionality to {@link Quantiles}, for use in @@ -31,6 +32,7 @@ * @author Pete Gillin * @since 20.0 */ +@NullUnmarked enum QuantilesAlgorithm { /** diff --git a/android/guava-tests/test/com/google/common/math/QuantilesAlgorithmTest.java b/android/guava-tests/test/com/google/common/math/QuantilesAlgorithmTest.java index 87a962a61299..cd4179dd3a89 100644 --- a/android/guava-tests/test/com/google/common/math/QuantilesAlgorithmTest.java +++ b/android/guava-tests/test/com/google/common/math/QuantilesAlgorithmTest.java @@ -25,11 +25,13 @@ import java.util.Random; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests that the different algorithms benchmarked in {@link QuantilesBenchmark} are actually all * returning more-or-less the same answers. */ +@NullUnmarked public class QuantilesAlgorithmTest extends TestCase { private static final Random RNG = new Random(82674067L); diff --git a/android/guava-tests/test/com/google/common/math/QuantilesTest.java b/android/guava-tests/test/com/google/common/math/QuantilesTest.java index 788abb7f7c23..aed6208630a4 100644 --- a/android/guava-tests/test/com/google/common/math/QuantilesTest.java +++ b/android/guava-tests/test/com/google/common/math/QuantilesTest.java @@ -43,6 +43,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -50,6 +51,7 @@ * * @author Pete Gillin */ +@NullUnmarked public class QuantilesTest extends TestCase { /* diff --git a/android/guava-tests/test/com/google/common/math/StatsAccumulatorTest.java b/android/guava-tests/test/com/google/common/math/StatsAccumulatorTest.java index 1ecc1e82da2e..7a160315b710 100644 --- a/android/guava-tests/test/com/google/common/math/StatsAccumulatorTest.java +++ b/android/guava-tests/test/com/google/common/math/StatsAccumulatorTest.java @@ -62,6 +62,7 @@ import com.google.common.primitives.Doubles; import com.google.common.primitives.Longs; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link StatsAccumulator}. This tests the stats methods for instances built with {@link @@ -71,6 +72,7 @@ * * @author Pete Gillin */ +@NullUnmarked public class StatsAccumulatorTest extends TestCase { private StatsAccumulator emptyAccumulator; diff --git a/android/guava-tests/test/com/google/common/math/StatsTest.java b/android/guava-tests/test/com/google/common/math/StatsTest.java index 357b6ea5e61b..252066589ce1 100644 --- a/android/guava-tests/test/com/google/common/math/StatsTest.java +++ b/android/guava-tests/test/com/google/common/math/StatsTest.java @@ -90,6 +90,7 @@ import java.nio.ByteOrder; import java.util.DoubleSummaryStatistics; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Stats}. This tests instances created by both {@link Stats#of} and {@link @@ -97,6 +98,7 @@ * * @author Pete Gillin */ +@NullUnmarked public class StatsTest extends TestCase { public void testCount() { diff --git a/android/guava-tests/test/com/google/common/math/StatsTesting.java b/android/guava-tests/test/com/google/common/math/StatsTesting.java index 7f4fb1f2f336..8203efc81cfd 100644 --- a/android/guava-tests/test/com/google/common/math/StatsTesting.java +++ b/android/guava-tests/test/com/google/common/math/StatsTesting.java @@ -33,6 +33,7 @@ import java.math.BigInteger; import java.util.List; import java.util.stream.DoubleStream; +import org.jspecify.annotations.NullUnmarked; /** * Inputs, expected outputs, and helper methods for tests of {@link StatsAccumulator}, {@link @@ -40,6 +41,7 @@ * * @author Pete Gillin */ +@NullUnmarked class StatsTesting { // TODO(cpovirk): Convince myself that this larger error makes sense. static final double ALLOWED_ERROR = isAndroid() ? .25 : 1e-10; diff --git a/android/guava-tests/test/com/google/common/math/TestPlatform.java b/android/guava-tests/test/com/google/common/math/TestPlatform.java index 86d8e50a6a7b..ba05ce7294bf 100644 --- a/android/guava-tests/test/com/google/common/math/TestPlatform.java +++ b/android/guava-tests/test/com/google/common/math/TestPlatform.java @@ -17,9 +17,13 @@ package com.google.common.math; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; -/** @author Chris Povirk */ +/** + * @author Chris Povirk + */ @GwtCompatible(emulated = true) +@NullUnmarked class TestPlatform { static boolean intsCanGoOutOfRange() { return false; diff --git a/android/guava-tests/test/com/google/common/net/HostAndPortTest.java b/android/guava-tests/test/com/google/common/net/HostAndPortTest.java index 46d5a1158a2e..0396cef709e6 100644 --- a/android/guava-tests/test/com/google/common/net/HostAndPortTest.java +++ b/android/guava-tests/test/com/google/common/net/HostAndPortTest.java @@ -22,6 +22,7 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.SerializableTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -30,6 +31,7 @@ * @author Paul Marks */ @GwtCompatible +@NullUnmarked public class HostAndPortTest extends TestCase { public void testFromStringWellFormed() { diff --git a/android/guava-tests/test/com/google/common/net/HostSpecifierTest.java b/android/guava-tests/test/com/google/common/net/HostSpecifierTest.java index 8112879a86d9..6b7ca2f39902 100644 --- a/android/guava-tests/test/com/google/common/net/HostSpecifierTest.java +++ b/android/guava-tests/test/com/google/common/net/HostSpecifierTest.java @@ -23,6 +23,7 @@ import com.google.common.testing.NullPointerTester; import java.text.ParseException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * {@link TestCase} for {@link HostSpecifier}. This is a relatively cursory test, as HostSpecifier @@ -32,6 +33,7 @@ * * @author Craig Berry */ +@NullUnmarked public final class HostSpecifierTest extends TestCase { private static final ImmutableList GOOD_IPS = diff --git a/android/guava-tests/test/com/google/common/net/HttpHeadersTest.java b/android/guava-tests/test/com/google/common/net/HttpHeadersTest.java index 2a18eabf364b..b89202ec9347 100644 --- a/android/guava-tests/test/com/google/common/net/HttpHeadersTest.java +++ b/android/guava-tests/test/com/google/common/net/HttpHeadersTest.java @@ -25,12 +25,14 @@ import java.lang.reflect.Field; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the HttpHeaders class. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class HttpHeadersTest extends TestCase { public void testConstantNameMatchesString() throws Exception { diff --git a/android/guava-tests/test/com/google/common/net/InetAddressesTest.java b/android/guava-tests/test/com/google/common/net/InetAddressesTest.java index 5bf1ee861a16..3f442deaab98 100644 --- a/android/guava-tests/test/com/google/common/net/InetAddressesTest.java +++ b/android/guava-tests/test/com/google/common/net/InetAddressesTest.java @@ -30,12 +30,14 @@ import java.net.UnknownHostException; import java.util.Enumeration; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link InetAddresses}. * * @author Erik Kline */ +@NullUnmarked public class InetAddressesTest extends TestCase { public void testNulls() { diff --git a/android/guava-tests/test/com/google/common/net/InternetDomainNameTest.java b/android/guava-tests/test/com/google/common/net/InternetDomainNameTest.java index 77c06ea13530..aece7235ebb7 100644 --- a/android/guava-tests/test/com/google/common/net/InternetDomainNameTest.java +++ b/android/guava-tests/test/com/google/common/net/InternetDomainNameTest.java @@ -28,6 +28,7 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.NullPointerTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * {@link TestCase} for {@link InternetDomainName}. @@ -35,6 +36,7 @@ * @author Craig Berry */ @GwtCompatible(emulated = true) +@NullUnmarked public final class InternetDomainNameTest extends TestCase { private static final InternetDomainName UNICODE_EXAMPLE = InternetDomainName.from("j\u00f8rpeland.no"); diff --git a/android/guava-tests/test/com/google/common/net/MediaTypeTest.java b/android/guava-tests/test/com/google/common/net/MediaTypeTest.java index e22a316382be..da6c4914b0b6 100644 --- a/android/guava-tests/test/com/google/common/net/MediaTypeTest.java +++ b/android/guava-tests/test/com/google/common/net/MediaTypeTest.java @@ -51,6 +51,7 @@ import java.nio.charset.UnsupportedCharsetException; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link MediaType}. @@ -58,6 +59,7 @@ * @author Gregory Kick */ @GwtCompatible(emulated = true) +@NullUnmarked public class MediaTypeTest extends TestCase { @J2ktIncompatible @GwtIncompatible // reflection diff --git a/android/guava-tests/test/com/google/common/net/PackageSanityTests.java b/android/guava-tests/test/com/google/common/net/PackageSanityTests.java index 3d18ad6dee6b..1a0a4c452f7a 100644 --- a/android/guava-tests/test/com/google/common/net/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/net/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.net; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -24,6 +25,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { setDefault(InternetDomainName.class, InternetDomainName.from("google.com")); diff --git a/android/guava-tests/test/com/google/common/net/PercentEscaperTest.java b/android/guava-tests/test/com/google/common/net/PercentEscaperTest.java index f5ce13541894..6f33ba1078be 100644 --- a/android/guava-tests/test/com/google/common/net/PercentEscaperTest.java +++ b/android/guava-tests/test/com/google/common/net/PercentEscaperTest.java @@ -26,6 +26,7 @@ import com.google.common.base.Preconditions; import com.google.common.escape.UnicodeEscaper; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link PercentEscaper}. @@ -33,6 +34,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked public class PercentEscaperTest extends TestCase { /** Tests that the simple escaper treats 0-9, a-z and A-Z as safe */ diff --git a/android/guava-tests/test/com/google/common/net/UrlEscaperTesting.java b/android/guava-tests/test/com/google/common/net/UrlEscaperTesting.java index 4aad01f8c3e5..9992a1898ce1 100644 --- a/android/guava-tests/test/com/google/common/net/UrlEscaperTesting.java +++ b/android/guava-tests/test/com/google/common/net/UrlEscaperTesting.java @@ -24,6 +24,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.escape.UnicodeEscaper; +import org.jspecify.annotations.NullUnmarked; /** * Testing utilities for {@link UrlEscapers} and {@link LegacyUrlEscapersTest}. @@ -31,6 +32,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked final class UrlEscaperTesting { /** * Helper to assert common expected behaviour of uri escapers. You should call diff --git a/android/guava-tests/test/com/google/common/net/UrlEscapersTest.java b/android/guava-tests/test/com/google/common/net/UrlEscapersTest.java index fefd50d76bee..e9c0cd0a85d2 100644 --- a/android/guava-tests/test/com/google/common/net/UrlEscapersTest.java +++ b/android/guava-tests/test/com/google/common/net/UrlEscapersTest.java @@ -27,6 +27,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.escape.UnicodeEscaper; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the {@link UrlEscapers} class. @@ -34,6 +35,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked public class UrlEscapersTest extends TestCase { public void testUrlFormParameterEscaper() { UnicodeEscaper e = (UnicodeEscaper) urlFormParameterEscaper(); diff --git a/android/guava-tests/test/com/google/common/primitives/ByteArrayAsListTest.java b/android/guava-tests/test/com/google/common/primitives/ByteArrayAsListTest.java index c7e693655f78..12388907e8c4 100644 --- a/android/guava-tests/test/com/google/common/primitives/ByteArrayAsListTest.java +++ b/android/guava-tests/test/com/google/common/primitives/ByteArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Bytes#asList(byte[])}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class ByteArrayAsListTest extends TestCase { private static List asList(Byte[] values) { diff --git a/android/guava-tests/test/com/google/common/primitives/CharArrayAsListTest.java b/android/guava-tests/test/com/google/common/primitives/CharArrayAsListTest.java index 7e521f1a75fd..162d03358dfc 100644 --- a/android/guava-tests/test/com/google/common/primitives/CharArrayAsListTest.java +++ b/android/guava-tests/test/com/google/common/primitives/CharArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Chars#asList(char[])}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class CharArrayAsListTest extends TestCase { private static List asList(Character[] values) { diff --git a/android/guava-tests/test/com/google/common/primitives/DoubleArrayAsListTest.java b/android/guava-tests/test/com/google/common/primitives/DoubleArrayAsListTest.java index e7cd4f38edcb..7515073fce9b 100644 --- a/android/guava-tests/test/com/google/common/primitives/DoubleArrayAsListTest.java +++ b/android/guava-tests/test/com/google/common/primitives/DoubleArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Doubles#asList(double[])}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class DoubleArrayAsListTest extends TestCase { private static List asList(Double[] values) { diff --git a/android/guava-tests/test/com/google/common/primitives/FloatArrayAsListTest.java b/android/guava-tests/test/com/google/common/primitives/FloatArrayAsListTest.java index c70a8b5d031c..9fee9033ce08 100644 --- a/android/guava-tests/test/com/google/common/primitives/FloatArrayAsListTest.java +++ b/android/guava-tests/test/com/google/common/primitives/FloatArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Floats#asList(float[])})}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class FloatArrayAsListTest extends TestCase { private static List asList(Float[] values) { diff --git a/android/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java b/android/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java index 789b6de6d694..7cbb29d71fcc 100644 --- a/android/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java +++ b/android/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java @@ -43,11 +43,13 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class ImmutableDoubleArrayTest extends TestCase { // Test all creation paths very lazily: by assuming asList() works diff --git a/android/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java b/android/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java index 7d7a83f3fe85..184ae1e15206 100644 --- a/android/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java +++ b/android/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java @@ -43,9 +43,13 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; -/** @author Kevin Bourrillion */ +/** + * @author Kevin Bourrillion + */ @GwtCompatible(emulated = true) +@NullUnmarked public class ImmutableIntArrayTest extends TestCase { // Test all creation paths very lazily: by assuming asList() works diff --git a/android/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java b/android/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java index d351335cabdb..f8e32747fbb4 100644 --- a/android/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java +++ b/android/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java @@ -43,9 +43,13 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; -/** @author Kevin Bourrillion */ +/** + * @author Kevin Bourrillion + */ @GwtCompatible(emulated = true) +@NullUnmarked public class ImmutableLongArrayTest extends TestCase { // Test all creation paths very lazily: by assuming asList() works diff --git a/android/guava-tests/test/com/google/common/primitives/IntArrayAsListTest.java b/android/guava-tests/test/com/google/common/primitives/IntArrayAsListTest.java index 46611f388f80..8f5732ff22c0 100644 --- a/android/guava-tests/test/com/google/common/primitives/IntArrayAsListTest.java +++ b/android/guava-tests/test/com/google/common/primitives/IntArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Ints#asList(int[])}. @@ -40,6 +41,7 @@ */ @GwtCompatible(emulated = true) @SuppressWarnings("cast") // redundant casts are intentional and harmless +@NullUnmarked public class IntArrayAsListTest extends TestCase { private static List asList(Integer[] values) { diff --git a/android/guava-tests/test/com/google/common/primitives/LongArrayAsListTest.java b/android/guava-tests/test/com/google/common/primitives/LongArrayAsListTest.java index 4a63251532fb..76c54bdbf1ba 100644 --- a/android/guava-tests/test/com/google/common/primitives/LongArrayAsListTest.java +++ b/android/guava-tests/test/com/google/common/primitives/LongArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Longs#asList(long[])}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class LongArrayAsListTest extends TestCase { private static List asList(Long[] values) { diff --git a/android/guava-tests/test/com/google/common/primitives/PackageSanityTests.java b/android/guava-tests/test/com/google/common/primitives/PackageSanityTests.java index 3f3e74539dac..eaa6ba09a51e 100644 --- a/android/guava-tests/test/com/google/common/primitives/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/primitives/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.primitives; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Tests basic sanity for each class in the package. @@ -24,6 +25,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { setDefault(String.class, "string"); diff --git a/android/guava-tests/test/com/google/common/primitives/PrimitivesTest.java b/android/guava-tests/test/com/google/common/primitives/PrimitivesTest.java index 621e7bcdb3ee..d3bd1cc84241 100644 --- a/android/guava-tests/test/com/google/common/primitives/PrimitivesTest.java +++ b/android/guava-tests/test/com/google/common/primitives/PrimitivesTest.java @@ -25,6 +25,7 @@ import com.google.common.testing.NullPointerTester; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Primitives}. @@ -32,6 +33,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class PrimitivesTest extends TestCase { public void testIsWrapperType() { assertThat(Primitives.isWrapperType(Void.class)).isTrue(); diff --git a/android/guava-tests/test/com/google/common/primitives/ShortArrayAsListTest.java b/android/guava-tests/test/com/google/common/primitives/ShortArrayAsListTest.java index a79211a316bd..c6c4dea4d304 100644 --- a/android/guava-tests/test/com/google/common/primitives/ShortArrayAsListTest.java +++ b/android/guava-tests/test/com/google/common/primitives/ShortArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Shorts#asList(short[])}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class ShortArrayAsListTest extends TestCase { private static List asList(Short[] values) { diff --git a/android/guava-tests/test/com/google/common/primitives/TestPlatform.java b/android/guava-tests/test/com/google/common/primitives/TestPlatform.java index 094c9d7fc09d..944b1f3dc39c 100644 --- a/android/guava-tests/test/com/google/common/primitives/TestPlatform.java +++ b/android/guava-tests/test/com/google/common/primitives/TestPlatform.java @@ -17,8 +17,10 @@ package com.google.common.primitives; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible(emulated = true) +@NullUnmarked class TestPlatform { static int reduceIterationsIfGwt(int iterations) { return iterations; diff --git a/android/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java b/android/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java index 823be04f3392..da00a4274088 100644 --- a/android/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java +++ b/android/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link UnsignedBytes}. @@ -37,6 +38,7 @@ * @author Kevin Bourrillion * @author Louis Wasserman */ +@NullUnmarked public class UnsignedBytesTest extends TestCase { private static final byte LEAST = 0; private static final byte GREATEST = (byte) 255; diff --git a/android/guava-tests/test/com/google/common/primitives/UnsignedIntegerTest.java b/android/guava-tests/test/com/google/common/primitives/UnsignedIntegerTest.java index 9eddfe51b740..4116438a58ca 100644 --- a/android/guava-tests/test/com/google/common/primitives/UnsignedIntegerTest.java +++ b/android/guava-tests/test/com/google/common/primitives/UnsignedIntegerTest.java @@ -27,6 +27,7 @@ import com.google.common.testing.SerializableTester; import java.math.BigInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code UnsignedInteger}. @@ -34,6 +35,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class UnsignedIntegerTest extends TestCase { private static final ImmutableSet TEST_INTS; private static final ImmutableSet TEST_LONGS; diff --git a/android/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java b/android/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java index 448f3f780905..bd2376afc3cc 100644 --- a/android/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java +++ b/android/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for UnsignedInts @@ -36,6 +37,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class UnsignedIntsTest extends TestCase { private static final long[] UNSIGNED_INTS = { 0L, diff --git a/android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java b/android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java index 9dfc75f97875..8bbe2cac52da 100644 --- a/android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java +++ b/android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java @@ -27,6 +27,7 @@ import com.google.common.testing.SerializableTester; import java.math.BigInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code UnsignedLong}. @@ -34,6 +35,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class UnsignedLongTest extends TestCase { private static final ImmutableSet TEST_LONGS; private static final ImmutableSet TEST_BIG_INTEGERS; diff --git a/android/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java b/android/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java index 8cd171bd86ab..3993a416a57f 100644 --- a/android/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java +++ b/android/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java @@ -31,6 +31,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for UnsignedLongs @@ -39,6 +40,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class UnsignedLongsTest extends TestCase { private static final long LEAST = 0L; private static final long GREATEST = 0xffffffffffffffffL; diff --git a/android/guava-tests/test/com/google/common/reflect/AbstractInvocationHandlerTest.java b/android/guava-tests/test/com/google/common/reflect/AbstractInvocationHandlerTest.java index 310878f98283..17a45870e71b 100644 --- a/android/guava-tests/test/com/google/common/reflect/AbstractInvocationHandlerTest.java +++ b/android/guava-tests/test/com/google/common/reflect/AbstractInvocationHandlerTest.java @@ -26,6 +26,7 @@ import java.lang.reflect.Proxy; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -33,6 +34,7 @@ * * @author Ben Yu */ +@NullUnmarked public class AbstractInvocationHandlerTest extends TestCase { private static final ImmutableList LIST1 = ImmutableList.of("one", "two"); diff --git a/android/guava-tests/test/com/google/common/reflect/ClassPathTest.java b/android/guava-tests/test/com/google/common/reflect/ClassPathTest.java index 923a18e1afa1..7f3ca3631eec 100644 --- a/android/guava-tests/test/com/google/common/reflect/ClassPathTest.java +++ b/android/guava-tests/test/com/google/common/reflect/ClassPathTest.java @@ -46,9 +46,11 @@ import java.util.logging.Logger; import java.util.zip.ZipEntry; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; /** Functional tests of {@link ClassPath}. */ +@NullUnmarked public class ClassPathTest extends TestCase { private static final Logger log = Logger.getLogger(ClassPathTest.class.getName()); private static final File FILE = new File("."); diff --git a/android/guava-tests/test/com/google/common/reflect/ImmutableTypeToInstanceMapTest.java b/android/guava-tests/test/com/google/common/reflect/ImmutableTypeToInstanceMapTest.java index 3c9304527abd..56493b56e483 100644 --- a/android/guava-tests/test/com/google/common/reflect/ImmutableTypeToInstanceMapTest.java +++ b/android/guava-tests/test/com/google/common/reflect/ImmutableTypeToInstanceMapTest.java @@ -33,12 +33,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ImmutableTypeToInstanceMap}. * * @author Ben Yu */ +@NullUnmarked public class ImmutableTypeToInstanceMapTest extends TestCase { @AndroidIncompatible // problem with suite builders on Android diff --git a/android/guava-tests/test/com/google/common/reflect/InvokableTest.java b/android/guava-tests/test/com/google/common/reflect/InvokableTest.java index f4b7f9dc8669..5a96126489bc 100644 --- a/android/guava-tests/test/com/google/common/reflect/InvokableTest.java +++ b/android/guava-tests/test/com/google/common/reflect/InvokableTest.java @@ -35,6 +35,7 @@ import java.lang.reflect.TypeVariable; import java.util.Collections; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -43,6 +44,7 @@ * @author Ben Yu */ @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class InvokableTest extends TestCase { // Historically Invokable inherited from java.lang.reflect.AccessibleObject. That's no longer the // case, but we do check that its API still has the same public methods. We exclude some methods diff --git a/android/guava-tests/test/com/google/common/reflect/MutableTypeToInstanceMapTest.java b/android/guava-tests/test/com/google/common/reflect/MutableTypeToInstanceMapTest.java index 10b4f2ecabf1..42dc61a9f2db 100644 --- a/android/guava-tests/test/com/google/common/reflect/MutableTypeToInstanceMapTest.java +++ b/android/guava-tests/test/com/google/common/reflect/MutableTypeToInstanceMapTest.java @@ -32,12 +32,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Unit test of {@link MutableTypeToInstanceMap}. * * @author Ben Yu */ +@NullUnmarked public class MutableTypeToInstanceMapTest extends TestCase { @AndroidIncompatible // problem with suite builders on Android diff --git a/android/guava-tests/test/com/google/common/reflect/PackageSanityTests.java b/android/guava-tests/test/com/google/common/reflect/PackageSanityTests.java index ba11fe80c778..9d3a4a2cf3b6 100644 --- a/android/guava-tests/test/com/google/common/reflect/PackageSanityTests.java +++ b/android/guava-tests/test/com/google/common/reflect/PackageSanityTests.java @@ -17,7 +17,9 @@ package com.google.common.reflect; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** Tests nulls for the entire package. */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests {} diff --git a/android/guava-tests/test/com/google/common/reflect/ParameterTest.java b/android/guava-tests/test/com/google/common/reflect/ParameterTest.java index 86ea0104fa93..890ae32a0313 100644 --- a/android/guava-tests/test/com/google/common/reflect/ParameterTest.java +++ b/android/guava-tests/test/com/google/common/reflect/ParameterTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.NullPointerTester; import java.lang.reflect.Method; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Parameter}. * * @author Ben Yu */ +@NullUnmarked public class ParameterTest extends TestCase { public void testNulls() { diff --git a/android/guava-tests/test/com/google/common/reflect/ReflectionTest.java b/android/guava-tests/test/com/google/common/reflect/ReflectionTest.java index 83d0168a63ea..6a0a7ce34b18 100644 --- a/android/guava-tests/test/com/google/common/reflect/ReflectionTest.java +++ b/android/guava-tests/test/com/google/common/reflect/ReflectionTest.java @@ -23,8 +23,10 @@ import java.lang.reflect.Method; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link Reflection} */ +@NullUnmarked public class ReflectionTest extends TestCase { public void testGetPackageName() throws Exception { diff --git a/android/guava-tests/test/com/google/common/reflect/SubtypeTester.java b/android/guava-tests/test/com/google/common/reflect/SubtypeTester.java index 7cd61c129dad..5caca8c420b8 100644 --- a/android/guava-tests/test/com/google/common/reflect/SubtypeTester.java +++ b/android/guava-tests/test/com/google/common/reflect/SubtypeTester.java @@ -30,6 +30,7 @@ import java.util.Arrays; import java.util.Comparator; import javax.lang.model.element.Modifier; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -65,6 +66,7 @@ *

The declaration methods must be public. */ @AndroidIncompatible // only used by android incompatible tests. +@NullUnmarked abstract class SubtypeTester implements Cloneable { /** Annotates a public method that declares subtype assertion. */ diff --git a/android/guava-tests/test/com/google/common/reflect/TypeParameterTest.java b/android/guava-tests/test/com/google/common/reflect/TypeParameterTest.java index ca49283a6c6e..e1d2cb021c50 100644 --- a/android/guava-tests/test/com/google/common/reflect/TypeParameterTest.java +++ b/android/guava-tests/test/com/google/common/reflect/TypeParameterTest.java @@ -23,12 +23,14 @@ import java.lang.reflect.Method; import java.lang.reflect.TypeVariable; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link TypeParameter}. * * @author Ben Yu */ +@NullUnmarked public class TypeParameterTest extends TestCase { public void testCaptureTypeParameter() throws Exception { diff --git a/android/guava-tests/test/com/google/common/reflect/TypeResolverTest.java b/android/guava-tests/test/com/google/common/reflect/TypeResolverTest.java index 5eba7052debe..464eebdd466c 100644 --- a/android/guava-tests/test/com/google/common/reflect/TypeResolverTest.java +++ b/android/guava-tests/test/com/google/common/reflect/TypeResolverTest.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests of {@link TypeResolver}. @@ -30,6 +31,7 @@ * @author Ben Yu */ @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class TypeResolverTest extends TestCase { public void testWhere_noMapping() { diff --git a/android/guava-tests/test/com/google/common/reflect/TypeTokenResolutionTest.java b/android/guava-tests/test/com/google/common/reflect/TypeTokenResolutionTest.java index 0a7a9da321f8..72e452beee43 100644 --- a/android/guava-tests/test/com/google/common/reflect/TypeTokenResolutionTest.java +++ b/android/guava-tests/test/com/google/common/reflect/TypeTokenResolutionTest.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link TypeToken} and {@link TypeResolver}. @@ -37,6 +38,7 @@ * @author Ben Yu */ @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class TypeTokenResolutionTest extends TestCase { private static class Foo { diff --git a/android/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java b/android/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java index 067f03c37dc2..542d77f61df5 100644 --- a/android/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java +++ b/android/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java @@ -23,8 +23,10 @@ import java.util.Comparator; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class TypeTokenSubtypeTest extends TestCase { public void testOwnerTypeSubtypes() throws Exception { diff --git a/android/guava-tests/test/com/google/common/reflect/TypeTokenTest.java b/android/guava-tests/test/com/google/common/reflect/TypeTokenTest.java index 5022e2802bb2..4acb5a1086ed 100644 --- a/android/guava-tests/test/com/google/common/reflect/TypeTokenTest.java +++ b/android/guava-tests/test/com/google/common/reflect/TypeTokenTest.java @@ -45,6 +45,7 @@ import java.util.List; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test cases for {@link TypeToken}. @@ -53,6 +54,7 @@ * @author Ben Yu */ @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class TypeTokenTest extends TestCase { private abstract static class StringList implements List {} diff --git a/android/guava-tests/test/com/google/common/reflect/TypeVisitorTest.java b/android/guava-tests/test/com/google/common/reflect/TypeVisitorTest.java index 4cb53cfee481..d466067c8970 100644 --- a/android/guava-tests/test/com/google/common/reflect/TypeVisitorTest.java +++ b/android/guava-tests/test/com/google/common/reflect/TypeVisitorTest.java @@ -24,12 +24,14 @@ import java.util.ArrayList; import java.util.EnumSet; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests of {@link TypeVisitor}. * * @author Ben Yu */ +@NullUnmarked public class TypeVisitorTest extends TestCase { public void testVisitNull() { diff --git a/android/guava-tests/test/com/google/common/reflect/TypesTest.java b/android/guava-tests/test/com/google/common/reflect/TypesTest.java index f1f4ae3f4e48..42ac44f5bbda 100644 --- a/android/guava-tests/test/com/google/common/reflect/TypesTest.java +++ b/android/guava-tests/test/com/google/common/reflect/TypesTest.java @@ -37,6 +37,7 @@ import java.util.Map; import java.util.Map.Entry; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Types}. @@ -44,6 +45,7 @@ * @author Ben Yu */ @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class TypesTest extends TestCase { public void testNewParameterizedType_ownerTypeImplied() throws Exception { ParameterizedType jvmType = diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java index c1297abc2fae..8f690b60c682 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java @@ -36,6 +36,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -43,6 +44,7 @@ * different "source Future" for {@link AbstractFuture#setFuture} calls. */ @GwtCompatible(emulated = true) +@NullUnmarked abstract class AbstractAbstractFutureTest extends TestCase { private TestedFuture future; private AbstractFuture delegate; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractChainedListenableFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractChainedListenableFutureTest.java index 83c193cd9935..261c14637992 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractChainedListenableFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractChainedListenableFutureTest.java @@ -23,6 +23,7 @@ import com.google.common.util.concurrent.testing.MockFutureListener; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for any listenable future that chains other listenable futures. Unit tests need only @@ -30,6 +31,7 @@ * * @author Nishant Thakkar */ +@NullUnmarked public abstract class AbstractChainedListenableFutureTest extends TestCase { protected static final int EXCEPTION_DATA = -1; protected static final int VALID_INPUT_DATA = 1; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractClosingFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractClosingFutureTest.java index cf04413f6aea..10e6942ab7de 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractClosingFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractClosingFutureTest.java @@ -75,6 +75,7 @@ import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.mockito.Mockito; /** @@ -83,6 +84,7 @@ * ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a * {@link ClosingFuture} pipeline. */ +@NullUnmarked public abstract class AbstractClosingFutureTest extends TestCase { // TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4. final List failures = new ArrayList<>(); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java index cd7fc344ae05..82126ef425b0 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java @@ -31,12 +31,14 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link AbstractExecutionThreadService}. * * @author Jesse Wilson */ +@NullUnmarked public class AbstractExecutionThreadServiceTest extends TestCase { private final TearDownStack tearDownStack = new TearDownStack(true); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java index c9c2038a5f27..a4d53d778573 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java @@ -25,9 +25,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.locks.AbstractQueuedSynchronizer; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** Utilities for the AbstractFutureBenchmarks */ +@NullUnmarked final class AbstractFutureBenchmarks { private AbstractFutureBenchmarks() {} diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureCancellationCauseTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureCancellationCauseTest.java index d00f95f311db..a5eb4f792bff 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureCancellationCauseTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureCancellationCauseTest.java @@ -29,10 +29,12 @@ import java.util.concurrent.TimeUnit; import javax.annotation.concurrent.GuardedBy; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link AbstractFuture} with the cancellation cause system property set */ @AndroidIncompatible // custom classloading +@NullUnmarked public class AbstractFutureCancellationCauseTest extends TestCase { private ClassLoader oldClassLoader; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java index f106dee2e074..bd56df06c1b5 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java @@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import sun.misc.Unsafe; /** @@ -45,6 +46,7 @@ * test methods in these degenerate classloaders. */ +@NullUnmarked public class AbstractFutureFallbackAtomicHelperTest extends TestCase { // stash these in static fields to avoid loading them over and over again (speeds up test diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java index f66383e198a8..d955501aabd3 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java @@ -58,6 +58,7 @@ import java.util.concurrent.locks.LockSupport; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -65,6 +66,7 @@ * * @author Brian Stoler */ +@NullUnmarked public class AbstractFutureTest extends TestCase { public void testSuccess() throws ExecutionException, InterruptedException { final Object value = new Object(); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractIdleServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractIdleServiceTest.java index 4f3252649765..f46960f55a2a 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractIdleServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractIdleServiceTest.java @@ -26,6 +26,7 @@ import java.util.concurrent.Executor; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link AbstractIdleService}. @@ -33,6 +34,7 @@ * @author Chris Nokleberg * @author Ben Yu */ +@NullUnmarked public class AbstractIdleServiceTest extends TestCase { public void testStart() { TestService service = new TestService(); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractListeningExecutorServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractListeningExecutorServiceTest.java index 139581f7c1dd..bd2c95b0e520 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractListeningExecutorServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractListeningExecutorServiceTest.java @@ -23,12 +23,14 @@ import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link AbstractListeningExecutorService}. * * @author Colin Decker */ +@NullUnmarked public class AbstractListeningExecutorServiceTest extends TestCase { public void testSubmit() throws Exception { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java index 13335631ad06..fd33281c0037 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java @@ -44,6 +44,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -51,6 +52,7 @@ * * @author Luke Sandberg */ +@NullUnmarked public class AbstractScheduledServiceTest extends TestCase { volatile Scheduler configuration = newFixedDelaySchedule(0, 10, MILLISECONDS); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractServiceTest.java index a3fc96aeb3e9..f3828d7dacaa 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractServiceTest.java @@ -35,12 +35,14 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link AbstractService}. * * @author Jesse Wilson */ +@NullUnmarked public class AbstractServiceTest extends TestCase { private static final long LONG_TIMEOUT_MILLIS = 10000; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java index 9ddcea9b7132..1ed1d10d77d6 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests our AtomicHelper fallback strategy in AggregateFutureState. @@ -45,6 +46,7 @@ * test methods in these degenerate classloaders. */ +@NullUnmarked public class AggregateFutureStateFallbackAtomicHelperTest extends TestCase { /** diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java index 0a6cb907dad4..7e3d63320af5 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java @@ -19,8 +19,10 @@ import com.google.common.annotations.J2ktIncompatible; import com.google.common.testing.NullPointerTester; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; /** Unit test for {@link AtomicDoubleArray}. */ +@NullUnmarked public class AtomicDoubleArrayTest extends JSR166TestCase { private static final double[] VALUES = { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java index 76f297814926..73d6025a26e6 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java @@ -15,7 +15,10 @@ import static com.google.common.truth.Truth.assertThat; +import org.jspecify.annotations.NullUnmarked; + /** Unit test for {@link AtomicDouble}. */ +@NullUnmarked public class AtomicDoubleTest extends JSR166TestCase { private static final double[] VALUES = { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java index 44212922a0a1..994ddaca9906 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java @@ -27,6 +27,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Basher test for {@link AtomicLongMap}. @@ -35,6 +36,7 @@ */ @J2ktIncompatible // threads @GwtIncompatible // threads +@NullUnmarked public class AtomicLongMapBasherTest extends TestCase { private final Random random = new Random(301); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java index aa37eae1898c..0eccd0c43be0 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java @@ -27,6 +27,7 @@ import java.util.Random; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link AtomicLongMap}. @@ -34,6 +35,7 @@ * @author mike nonemacher */ @GwtCompatible(emulated = true) +@NullUnmarked public class AtomicLongMapTest extends TestCase { private static final int ITERATIONS = 100; private static final int MAX_ADDEND = 100; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AtomicsTest.java b/android/guava-tests/test/com/google/common/util/concurrent/AtomicsTest.java index 90f0f6f76b8f..1cb9fd8c4c00 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AtomicsTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AtomicsTest.java @@ -21,12 +21,14 @@ import com.google.common.testing.NullPointerTester; import java.util.concurrent.atomic.AtomicReferenceArray; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Atomics}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class AtomicsTest extends TestCase { private static final Object OBJECT = new Object(); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/CallablesTest.java b/android/guava-tests/test/com/google/common/util/concurrent/CallablesTest.java index f7537369e0c9..dccd36366f88 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/CallablesTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/CallablesTest.java @@ -29,6 +29,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -37,6 +38,7 @@ * @author Isaac Shum */ @GwtCompatible(emulated = true) +@NullUnmarked public class CallablesTest extends TestCase { @J2ktIncompatible // TODO(b/324550390): Enable diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ClassPathUtil.java b/android/guava-tests/test/com/google/common/util/concurrent/ClassPathUtil.java index a36aa34e4e56..16e88a5df94c 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ClassPathUtil.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ClassPathUtil.java @@ -23,9 +23,11 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; +import org.jspecify.annotations.NullUnmarked; // TODO(b/65488446): Make this a public API. /** Utility method to parse the system class path. */ +@NullUnmarked final class ClassPathUtil { private ClassPathUtil() {} diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java index 29ce341e1077..c42357cac0b2 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java @@ -26,8 +26,10 @@ import com.google.common.util.concurrent.ClosingFuture.DeferredCloser; import java.io.Closeable; import java.util.concurrent.ExecutionException; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link ClosingFuture} that exercise {@link ClosingFuture#finishToFuture()}. */ +@NullUnmarked public class ClosingFutureFinishToFutureTest extends AbstractClosingFutureTest { public void testFinishToFuture_throwsIfCalledTwice() throws Exception { ClosingFuture closingFuture = diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java index c249eca34073..c03230315189 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java @@ -33,11 +33,13 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ClosingFuture} that exercise {@link * ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)}. */ +@NullUnmarked public class ClosingFutureFinishToValueAndCloserTest extends AbstractClosingFutureTest { private final ExecutorService finishToValueAndCloserExecutor = newSingleThreadExecutor(); private volatile ValueAndCloser valueAndCloser; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java b/android/guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java index 050609af25f5..ba7d11ef8f67 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java @@ -29,12 +29,14 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantReadWriteLock; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unittests for {@link CycleDetectingLockFactory}. * * @author Darick Tong */ +@NullUnmarked public class CycleDetectingLockFactoryTest extends TestCase { private ReentrantLock lockA; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java index 8d2920610087..da262806a3ec 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link ExecutionList}. @@ -32,6 +33,7 @@ * @author Nishant Thakkar * @author Sven Mawson */ +@NullUnmarked public class ExecutionListTest extends TestCase { private final ExecutionList list = new ExecutionList(); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java index b09f35fa4700..4a07ef071959 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java @@ -37,9 +37,11 @@ import java.util.concurrent.Future; import java.util.logging.Logger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** Tests for {@link ExecutionSequencer} */ +@NullUnmarked public class ExecutionSequencerTest extends TestCase { ExecutorService executor; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java b/android/guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java index 78f4374d7b03..922e02747e4f 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java @@ -23,12 +23,14 @@ import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link FakeTimeLimiter}. * * @author Jens Nyman */ +@NullUnmarked public class FakeTimeLimiterTest extends TestCase { private static final int DELAY_MS = 50; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingDequeTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingDequeTest.java index 35cecee71e2a..002ad8581176 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingDequeTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingDequeTest.java @@ -17,12 +17,14 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test for {@link ForwardingBlockingDeque} * * @author Emily Soldal */ +@NullUnmarked public class ForwardingBlockingDequeTest extends TestCase { public void testForwarding() { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingQueueTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingQueueTest.java index eda852f6cedc..0c7c1b4c45b1 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingQueueTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingQueueTest.java @@ -17,8 +17,10 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link ForwardingBlockingQueue} */ +@NullUnmarked public class ForwardingBlockingQueueTest extends TestCase { public void testForwarding() { ForwardingObjectTester.testForwardingObject(ForwardingBlockingQueue.class); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingExecutorServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingExecutorServiceTest.java index ccd3eb8000e9..f2474e7f6ff3 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingExecutorServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingExecutorServiceTest.java @@ -17,8 +17,10 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link ForwardingExecutorService} */ +@NullUnmarked public class ForwardingExecutorServiceTest extends TestCase { public void testForwarding() { ForwardingObjectTester.testForwardingObject(ForwardingExecutorService.class); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingFutureTest.java index f5d282a141f9..eaf8e964ff70 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingFutureTest.java @@ -17,8 +17,10 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link ForwardingFuture} */ +@NullUnmarked public class ForwardingFutureTest extends TestCase { public void testForwarding() { ForwardingObjectTester.testForwardingObject(ForwardingFuture.class); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingListenableFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingListenableFutureTest.java index 827f50ea55d1..435d17d49d1d 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingListenableFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingListenableFutureTest.java @@ -17,12 +17,14 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ForwardingListenableFuture}. * * @author Ben Yu */ +@NullUnmarked public class ForwardingListenableFutureTest extends TestCase { public void testForwarding() { ForwardingObjectTester.testForwardingObject(ForwardingListenableFuture.class); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingListeningExecutorServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingListeningExecutorServiceTest.java index ecfa7ddb32bb..1eabe021238d 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingListeningExecutorServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingListeningExecutorServiceTest.java @@ -17,8 +17,10 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link ForwardingListeningExecutorService} */ +@NullUnmarked public class ForwardingListeningExecutorServiceTest extends TestCase { public void testForwarding() { ForwardingObjectTester.testForwardingObject(ForwardingListeningExecutorService.class); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTester.java b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTester.java index ad391efdc5d1..24eff3ef47b3 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTester.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTester.java @@ -26,12 +26,14 @@ import com.google.common.testing.ForwardingWrapperTester; import java.lang.reflect.Method; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; /** * Tester for typical subclass of {@link ForwardingObject} by using Mockito. * * @author Ben Yu */ +@NullUnmarked final class ForwardingObjectTester { private static final Method DELEGATE_METHOD; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTesterTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTesterTest.java index 51a0842af36d..d96ef1e2ddbe 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTesterTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTesterTest.java @@ -18,12 +18,14 @@ import com.google.common.collect.ForwardingObject; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ForwardingObjectTester}. * * @author Ben Yu */ +@NullUnmarked public class ForwardingObjectTesterTest extends TestCase { public void testFailsToForward() { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java b/android/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java index df112c169776..107af768917b 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java @@ -26,6 +26,7 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.Executor; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -34,6 +35,7 @@ * @author Anthony Zana */ @GwtCompatible +@NullUnmarked public class FutureCallbackTest extends TestCase { public void testSameThreadSuccess() { SettableFuture f = SettableFuture.create(); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedInputs.java b/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedInputs.java index 0ae248837af5..d2b7a3f400db 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedInputs.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedInputs.java @@ -19,11 +19,13 @@ import com.google.common.annotations.GwtCompatible; import java.util.concurrent.Future; import javax.annotation.CheckForNull; +import org.jspecify.annotations.NullUnmarked; /** * Classes and futures used in {@link FuturesGetCheckedTest} and {@link FuturesGetUncheckedTest}. */ @GwtCompatible +@NullUnmarked final class FuturesGetCheckedInputs { static final Exception CHECKED_EXCEPTION = new Exception("mymessage"); static final Future FAILED_FUTURE_CHECKED_EXCEPTION = diff --git a/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java b/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java index c08881620245..7a9e818df755 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java @@ -49,8 +49,10 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link Futures#getChecked(Future, Class)}. */ +@NullUnmarked public class FuturesGetCheckedTest extends TestCase { // Boring untimed-get tests: diff --git a/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetDoneTest.java b/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetDoneTest.java index c19f62d8cbb6..9a8b1e6dff74 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetDoneTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetDoneTest.java @@ -25,10 +25,12 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** Unit tests for {@link Futures#getDone}. */ @GwtCompatible +@NullUnmarked public class FuturesGetDoneTest extends TestCase { public void testSuccessful() throws ExecutionException { assertThat(getDone(immediateFuture("a"))).isEqualTo("a"); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java b/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java index 3d2e1673986b..b2cb616bd710 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java @@ -36,9 +36,11 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.Future; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link Futures#getUnchecked(Future)}. */ @GwtCompatible(emulated = true) +@NullUnmarked public class FuturesGetUncheckedTest extends TestCase { public void testGetUnchecked_success() { assertEquals("foo", getUnchecked(immediateFuture("foo"))); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java b/android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java index 133bd37d97fb..9c58e89c1e6d 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java @@ -27,12 +27,14 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Futures#transformAsync(ListenableFuture, AsyncFunction, Executor)}. * * @author Nishant Thakkar */ +@NullUnmarked public class FuturesTransformAsyncTest extends AbstractChainedListenableFutureTest { protected static final int SLOW_OUTPUT_VALID_INPUT_DATA = 2; protected static final int SLOW_FUNC_VALID_INPUT_DATA = 3; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformTest.java b/android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformTest.java index 9f211dd8b8b2..301bdb6a6fc0 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformTest.java @@ -21,12 +21,14 @@ import com.google.common.base.Function; import java.lang.reflect.UndeclaredThrowableException; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Futures#transform(ListenableFuture, Function, Executor)}. * * @author Nishant Thakkar */ +@NullUnmarked public class FuturesTransformTest extends AbstractChainedListenableFutureTest { private static final String RESULT_DATA = "SUCCESS"; private static final UndeclaredThrowableException WRAPPED_EXCEPTION = diff --git a/android/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java b/android/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java index 5276b189fafe..bda4dcac5e85 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java @@ -34,6 +34,7 @@ import java.util.concurrent.TimeUnit; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -46,6 +47,7 @@ * * @author Justin T. Sampson */ +@NullUnmarked public class GeneratedMonitorTest extends TestCase { public static TestSuite suite() { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleMonitorTest.java b/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleMonitorTest.java index bb3b43b9d16b..44126f5fed51 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleMonitorTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleMonitorTest.java @@ -16,12 +16,14 @@ package com.google.common.util.concurrent; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Monitor}'s interruptible methods. * * @author Justin T. Sampson */ +@NullUnmarked public class InterruptibleMonitorTest extends MonitorTestCase { public InterruptibleMonitorTest() { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java b/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java index 2cf436524be3..cdeb907d8207 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java @@ -24,8 +24,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.locks.LockSupport; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; +@NullUnmarked public final class InterruptibleTaskTest extends TestCase { // Regression test for a deadlock where a task could be stuck busy waiting for the task to diff --git a/android/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java b/android/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java index 919b0c8cec62..7460daad43cf 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java @@ -25,6 +25,7 @@ import com.google.common.testing.TearDownAccepter; import java.util.concurrent.TimeUnit; import java.util.logging.Logger; +import org.jspecify.annotations.NullUnmarked; /** * Utilities for performing thread interruption in tests @@ -32,6 +33,7 @@ * @author Kevin Bourrillion * @author Chris Povirk */ +@NullUnmarked final class InterruptionUtil { private static final Logger logger = Logger.getLogger(InterruptionUtil.class.getName()); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java b/android/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java index 5c0ad33f9e4b..d95939b56c0f 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java @@ -48,6 +48,7 @@ import java.util.concurrent.atomic.AtomicReference; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Base class for JSR166 Junit TCK tests. Defines some constants, utility methods and classes, as @@ -101,6 +102,7 @@ */ // We call threadUnexpectedException, which does the right thing for errors. @SuppressWarnings("AssertionFailureIgnored") +@NullUnmarked abstract class JSR166TestCase extends TestCase { private static final boolean useSecurityManager = Boolean.getBoolean("jsr166.useSecurityManager"); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java b/android/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java index a702606d2303..d762292408f9 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java @@ -33,6 +33,7 @@ import java.util.concurrent.TimeUnit; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link JdkFutureAdapters}. @@ -40,6 +41,7 @@ * @author Sven Mawson * @author Kurt Alfred Kluever */ +@NullUnmarked public class JdkFutureAdaptersTest extends TestCase { private static final String DATA1 = "data"; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java index a0911e09119d..4661e1df9a3f 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java @@ -26,12 +26,14 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test case for {@link ListenableFutureTask}. * * @author Sven Mawson */ +@NullUnmarked public class ListenableFutureTaskTest extends TestCase { private ExecutorService exec; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTest.java index 5c12696abe83..e9efc76df802 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTest.java @@ -21,8 +21,10 @@ import java.util.concurrent.Executor; import java.util.concurrent.Future; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Test for {@link ListenableFuture}. */ +@NullUnmarked public class ListenableFutureTest extends TestCase { public void testNoNewApis() throws Exception { assertWithMessage( diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java b/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java index cadfce5224a7..96bf05887b96 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java @@ -30,6 +30,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -37,6 +38,7 @@ * * @author Sven Mawson */ +@NullUnmarked public class ListenableFutureTester { private final ExecutorService exec; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java index e0eb32e6a54f..7cf21dd72298 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java @@ -31,8 +31,10 @@ import java.util.logging.Level; import java.util.logging.Logger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link ListenerCallQueue}. */ +@NullUnmarked public class ListenerCallQueueTest extends TestCase { private static final ListenerCallQueue.Event THROWING_EVENT = diff --git a/android/guava-tests/test/com/google/common/util/concurrent/MonitorTestCase.java b/android/guava-tests/test/com/google/common/util/concurrent/MonitorTestCase.java index e355d35d7f81..88299c24c217 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/MonitorTestCase.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/MonitorTestCase.java @@ -20,12 +20,14 @@ import com.google.common.testing.TearDownStack; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Monitor}, either interruptible or uninterruptible. * * @author Justin T. Sampson */ +@NullUnmarked public abstract class MonitorTestCase extends TestCase { public class TestGuard extends Monitor.Guard { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java b/android/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java index 0687e287acbb..f592e7995afb 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java @@ -75,6 +75,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import org.mockito.InOrder; import org.mockito.Mockito; @@ -84,6 +85,7 @@ * * @author Kyle Littlefield (klittle) */ +@NullUnmarked public class MoreExecutorsTest extends JSR166TestCase { private static final Runnable EMPTY_RUNNABLE = diff --git a/android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java b/android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java index 08dfa6514fb6..a73e127916c4 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java @@ -38,6 +38,7 @@ import java.util.Random; import java.util.concurrent.TimeUnit; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.mockito.Mockito; /** @@ -45,6 +46,7 @@ * * @author Dimitris Andreou */ +@NullUnmarked public class RateLimiterTest extends TestCase { private static final double EPSILON = 1e-8; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/RunnablesTest.java b/android/guava-tests/test/com/google/common/util/concurrent/RunnablesTest.java index c4bd1c7c4ec6..6203761caf15 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/RunnablesTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/RunnablesTest.java @@ -18,6 +18,7 @@ import com.google.common.annotations.GwtCompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Runnables}. @@ -25,6 +26,7 @@ * @author Olivier Pernet */ @GwtCompatible +@NullUnmarked public class RunnablesTest extends TestCase { public void testDoNothingRunnableIsSingleton() { assertSame(Runnables.doNothing(), Runnables.doNothing()); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java b/android/guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java index 7e7d4ea6e3df..3b4ac0383381 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java @@ -38,12 +38,14 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests {@link SequentialExecutor}. * * @author JJ Furman */ +@NullUnmarked public class SequentialExecutorTest extends TestCase { private static class FakeExecutor implements Executor { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java index 12052571452a..be35f06ad917 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java @@ -48,6 +48,7 @@ import java.util.logging.LogRecord; import java.util.logging.Logger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ServiceManager}. @@ -55,6 +56,7 @@ * @author Luke Sandberg * @author Chris Nokleberg */ +@NullUnmarked public class ServiceManagerTest extends TestCase { private static class NoOpService extends AbstractService { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ServiceTest.java index 98b8033d901b..53e299c70dc3 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ServiceTest.java @@ -25,8 +25,10 @@ import java.util.Locale; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link Service} */ +@NullUnmarked public class ServiceTest extends TestCase { /** Assert on the comparison ordering of the State enum since we guarantee it. */ diff --git a/android/guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java index 5934fd9df998..23c39af8effe 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java @@ -24,12 +24,14 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test cases for {@link SettableFuture}. * * @author Sven Mawson */ +@NullUnmarked public class SettableFutureTest extends TestCase { private SettableFuture future; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java b/android/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java index 314b754aa833..88d12176d8e7 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java @@ -28,6 +28,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link SimpleTimeLimiter}. @@ -35,6 +36,7 @@ * @author kevinb * @author Jens Nyman */ +@NullUnmarked public class SimpleTimeLimiterTest extends TestCase { private static final long DELAY_MS = 50; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java b/android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java index ff826c32e32b..dadba8cc3ec5 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java @@ -37,12 +37,14 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantReadWriteLock; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for Striped. * * @author Dimitris Andreou */ +@NullUnmarked public class StripedTest extends TestCase { private static List> strongImplementations() { return ImmutableList.of( diff --git a/android/guava-tests/test/com/google/common/util/concurrent/SupplementalMonitorTest.java b/android/guava-tests/test/com/google/common/util/concurrent/SupplementalMonitorTest.java index 62b69aec7bca..1fcbf03b280d 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/SupplementalMonitorTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/SupplementalMonitorTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Supplemental tests for {@link Monitor}. @@ -34,6 +35,7 @@ * * @author Justin T. Sampson */ +@NullUnmarked public class SupplementalMonitorTest extends TestCase { public void testLeaveWithoutEnterThrowsIMSE() { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/TestExceptions.java b/android/guava-tests/test/com/google/common/util/concurrent/TestExceptions.java index 4f71d8e2a860..3a0496818fbe 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/TestExceptions.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/TestExceptions.java @@ -17,9 +17,11 @@ package com.google.common.util.concurrent; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; /** Exception classes for use in tests. */ @GwtCompatible +@NullUnmarked final class TestExceptions { static class SomeError extends Error {} diff --git a/android/guava-tests/test/com/google/common/util/concurrent/TestThread.java b/android/guava-tests/test/com/google/common/util/concurrent/TestThread.java index d615f929eafd..7c3186da5fc5 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/TestThread.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/TestThread.java @@ -29,6 +29,7 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.TimeoutException; import junit.framework.AssertionFailedError; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -48,6 +49,7 @@ * @param the type of the lock-like object to be used * @author Justin T. Sampson */ +@NullUnmarked public final class TestThread extends Thread implements TearDown { private static final long DUE_DILIGENCE_MILLIS = 100; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/ThreadFactoryBuilderTest.java b/android/guava-tests/test/com/google/common/util/concurrent/ThreadFactoryBuilderTest.java index 09b3ec7ee7af..c29e8cb04f99 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/ThreadFactoryBuilderTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/ThreadFactoryBuilderTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for ThreadFactoryBuilder. @@ -32,6 +33,7 @@ * @author Kurt Alfred Kluever * @author Martin Buchholz */ +@NullUnmarked public class ThreadFactoryBuilderTest extends TestCase { private final Runnable monitoredRunnable = new Runnable() { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java index 1f2eccad932d..f2934358cbc0 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java @@ -19,12 +19,14 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.util.concurrent.AbstractFuture.TrustedFuture; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link AbstractFuture} that use a {@link TrustedFuture} for {@link * AbstractFuture#setFuture} calls. */ @GwtCompatible +@NullUnmarked public class TrustedInputFutureTest extends AbstractAbstractFutureTest { @Override AbstractFuture newDelegate() { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/UncaughtExceptionHandlersTest.java b/android/guava-tests/test/com/google/common/util/concurrent/UncaughtExceptionHandlersTest.java index 4a26b4976578..f488040b8d1d 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/UncaughtExceptionHandlersTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/UncaughtExceptionHandlersTest.java @@ -21,8 +21,12 @@ import com.google.common.util.concurrent.UncaughtExceptionHandlers.Exiter; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author Gregory Kick */ +/** + * @author Gregory Kick + */ +@NullUnmarked public class UncaughtExceptionHandlersTest extends TestCase { private Runtime runtimeMock; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java b/android/guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java index 405772279512..52975562a499 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java @@ -23,6 +23,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import org.jspecify.annotations.NullUnmarked; /** * A {@link Future} implementation which always throws directly from calls to {@code get()} (i.e. @@ -34,6 +35,7 @@ * @author Anthony Zana */ @GwtCompatible +@NullUnmarked final class UncheckedThrowingFuture extends AbstractFuture { public static ListenableFuture throwingError(Error error) { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java index 7ddaf9952c99..512de121e264 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java @@ -33,6 +33,7 @@ import java.util.concurrent.FutureTask; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; // TODO(cpovirk): Should this be merged into UninterruptiblesTest? /** @@ -41,6 +42,7 @@ * @author Kevin Bourrillion * @author Chris Povirk */ +@NullUnmarked public class UninterruptibleFutureTest extends TestCase { private SleepingRunnable sleeper; private Future delayedFuture; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleMonitorTest.java b/android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleMonitorTest.java index 3e775bab5676..29c881126056 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleMonitorTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleMonitorTest.java @@ -16,12 +16,14 @@ package com.google.common.util.concurrent; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Monitor}'s uninterruptible methods. * * @author Justin T. Sampson */ +@NullUnmarked public class UninterruptibleMonitorTest extends MonitorTestCase { public UninterruptibleMonitorTest() { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java b/android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java index a7ce880c0440..366dc00017f6 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java @@ -49,12 +49,14 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Uninterruptibles}. * * @author Anthony Zana */ +@NullUnmarked public class UninterruptiblesTest extends TestCase { private static final String EXPECTED_TAKE = "expectedTake"; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java index a6241d2e7120..df673a8cf7f0 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java @@ -19,12 +19,14 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.util.concurrent.AbstractFuture.TrustedFuture; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link AbstractFuture} that use a non-{@link TrustedFuture} for {@link * AbstractFuture#setFuture} calls. */ @GwtCompatible +@NullUnmarked public class UntrustedInputFutureTest extends AbstractAbstractFutureTest { @Override AbstractFuture newDelegate() { diff --git a/android/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java index 4b4d2afb129f..941acc6a8b2a 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java @@ -36,12 +36,14 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test for {@link WrappingExecutorService} * * @author Chris Nokleberg */ +@NullUnmarked public class WrappingExecutorServiceTest extends TestCase { private static final String RESULT_VALUE = "ran"; // Uninteresting delegations diff --git a/android/guava-tests/test/com/google/common/util/concurrent/WrappingScheduledExecutorServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/WrappingScheduledExecutorServiceTest.java index 9eefb61e7fe4..548a45273a1b 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/WrappingScheduledExecutorServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/WrappingScheduledExecutorServiceTest.java @@ -31,12 +31,14 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test for {@link WrappingScheduledExecutorService} * * @author Luke Sandberg */ +@NullUnmarked public class WrappingScheduledExecutorServiceTest extends TestCase { private static final Runnable DO_NOTHING = new Runnable() { diff --git a/android/guava-tests/test/com/google/common/xml/XmlEscapersTest.java b/android/guava-tests/test/com/google/common/xml/XmlEscapersTest.java index 00b5cf16b60b..d491115b19e1 100644 --- a/android/guava-tests/test/com/google/common/xml/XmlEscapersTest.java +++ b/android/guava-tests/test/com/google/common/xml/XmlEscapersTest.java @@ -22,6 +22,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.escape.CharEscaper; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the {@link XmlEscapers} class. @@ -30,6 +31,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked public class XmlEscapersTest extends TestCase { public void testXmlContentEscaper() throws Exception { diff --git a/android/guava/src/com/google/common/cache/LocalCache.java b/android/guava/src/com/google/common/cache/LocalCache.java index f4df3a99b6fb..9e98a76fbcd1 100644 --- a/android/guava/src/com/google/common/cache/LocalCache.java +++ b/android/guava/src/com/google/common/cache/LocalCache.java @@ -84,6 +84,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; +import org.jspecify.annotations.NullUnmarked; /** * The concurrent hash map implementation built by {@link CacheBuilder}. @@ -100,7 +101,7 @@ "nullness", // too much trouble for the payoff }) @GwtCompatible(emulated = true) -// TODO(cpovirk): Annotate for nullness. +@NullUnmarked // TODO(cpovirk): Annotate for nullness. class LocalCache extends AbstractMap implements ConcurrentMap { /* diff --git a/android/guava/src/com/google/common/collect/MapMakerInternalMap.java b/android/guava/src/com/google/common/collect/MapMakerInternalMap.java index 44e64ebc2629..fbdae74af5a7 100644 --- a/android/guava/src/com/google/common/collect/MapMakerInternalMap.java +++ b/android/guava/src/com/google/common/collect/MapMakerInternalMap.java @@ -51,6 +51,7 @@ import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.concurrent.locks.ReentrantLock; import javax.annotation.CheckForNull; +import org.jspecify.annotations.NullUnmarked; /** * The concurrent hash map implementation built by {@link MapMaker}. @@ -73,7 +74,7 @@ "GuardedBy", // TODO(b/35466881): Fix or suppress. "nullness", // too much trouble for the payoff }) -// TODO(cpovirk): Annotate for nullness. +@NullUnmarked // TODO(cpovirk): Annotate for nullness. class MapMakerInternalMap< K, V, diff --git a/guava-testlib/src/com/google/common/testing/ClassSanityTester.java b/guava-testlib/src/com/google/common/testing/ClassSanityTester.java index 12933eaeaee7..e2b04431d4f5 100644 --- a/guava-testlib/src/com/google/common/testing/ClassSanityTester.java +++ b/guava-testlib/src/com/google/common/testing/ClassSanityTester.java @@ -53,6 +53,7 @@ import javax.annotation.CheckForNull; import junit.framework.Assert; import junit.framework.AssertionFailedError; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -81,6 +82,8 @@ */ @GwtIncompatible @J2ktIncompatible +@NullUnmarked +@SuppressWarnings("nullness") public final class ClassSanityTester { private static final Ordering> BY_METHOD_NAME = diff --git a/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java b/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java index fe465ffc62ee..8ff58aec5f97 100644 --- a/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java +++ b/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java @@ -125,6 +125,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Pattern; import javax.annotation.CheckForNull; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -134,6 +135,8 @@ */ @GwtIncompatible @J2ktIncompatible +@NullUnmarked +@SuppressWarnings("nullness") class FreshValueGenerator { private static final ImmutableMap, Method> GENERATORS; diff --git a/guava-testlib/test/com/google/common/testing/AbstractPackageSanityTestsTest.java b/guava-testlib/test/com/google/common/testing/AbstractPackageSanityTestsTest.java index cb6ba6abf457..6ddcde40c359 100644 --- a/guava-testlib/test/com/google/common/testing/AbstractPackageSanityTestsTest.java +++ b/guava-testlib/test/com/google/common/testing/AbstractPackageSanityTestsTest.java @@ -23,12 +23,14 @@ import java.util.Arrays; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link AbstractPackageSanityTests}. * * @author Ben Yu */ +@NullUnmarked public class AbstractPackageSanityTestsTest extends TestCase { /* * This is a public type so that the Android test runner can create an instance directly as it diff --git a/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java b/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java index 341787dfa716..72046c845a9a 100644 --- a/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java +++ b/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java @@ -133,6 +133,7 @@ import java.util.regex.MatchResult; import java.util.regex.Pattern; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -140,6 +141,7 @@ * * @author Ben Yu */ +@NullUnmarked public class ArbitraryInstancesTest extends TestCase { public void testGet_primitives() { diff --git a/guava-testlib/test/com/google/common/testing/ClassSanityTesterTest.java b/guava-testlib/test/com/google/common/testing/ClassSanityTesterTest.java index 9cc625f2b02d..490a1c4a40d6 100644 --- a/guava-testlib/test/com/google/common/testing/ClassSanityTesterTest.java +++ b/guava-testlib/test/com/google/common/testing/ClassSanityTesterTest.java @@ -38,6 +38,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -45,6 +46,7 @@ * * @author Ben Yu */ +@NullUnmarked public class ClassSanityTesterTest extends TestCase { private final ClassSanityTester tester = new ClassSanityTester(); diff --git a/guava-testlib/test/com/google/common/testing/EqualsTesterTest.java b/guava-testlib/test/com/google/common/testing/EqualsTesterTest.java index f777efa31048..039ae877ecb7 100644 --- a/guava-testlib/test/com/google/common/testing/EqualsTesterTest.java +++ b/guava-testlib/test/com/google/common/testing/EqualsTesterTest.java @@ -26,6 +26,7 @@ import java.util.Set; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -35,6 +36,7 @@ */ @GwtCompatible @SuppressWarnings("MissingTestCall") +@NullUnmarked public class EqualsTesterTest extends TestCase { private ValidTestObject reference; private EqualsTester equalsTester; diff --git a/guava-testlib/test/com/google/common/testing/EquivalenceTesterTest.java b/guava-testlib/test/com/google/common/testing/EquivalenceTesterTest.java index 7e9649090289..00bdb2aa4457 100644 --- a/guava-testlib/test/com/google/common/testing/EquivalenceTesterTest.java +++ b/guava-testlib/test/com/google/common/testing/EquivalenceTesterTest.java @@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableTable; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link EquivalenceTester}. @@ -34,6 +35,7 @@ * @author Gregory Kick */ @GwtCompatible +@NullUnmarked public class EquivalenceTesterTest extends TestCase { private EquivalenceTester tester; private MockEquivalence equivalenceMock; diff --git a/guava-testlib/test/com/google/common/testing/FakeTickerTest.java b/guava-testlib/test/com/google/common/testing/FakeTickerTest.java index 55ed48269cd4..460a2d65d3f0 100644 --- a/guava-testlib/test/com/google/common/testing/FakeTickerTest.java +++ b/guava-testlib/test/com/google/common/testing/FakeTickerTest.java @@ -31,6 +31,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -41,6 +42,7 @@ @GwtCompatible(emulated = true) // We also want to test the TimeUnit overload (especially under GWT, where it's the only option). @SuppressWarnings("SetAutoIncrementStep_Nanos") +@NullUnmarked public class FakeTickerTest extends TestCase { @GwtIncompatible // NullPointerTester diff --git a/guava-testlib/test/com/google/common/testing/FreshValueGeneratorTest.java b/guava-testlib/test/com/google/common/testing/FreshValueGeneratorTest.java index baf653697fb8..b86f6f1185f8 100644 --- a/guava-testlib/test/com/google/common/testing/FreshValueGeneratorTest.java +++ b/guava-testlib/test/com/google/common/testing/FreshValueGeneratorTest.java @@ -110,12 +110,14 @@ import java.util.regex.MatchResult; import java.util.regex.Pattern; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link FreshValueGenerator}. * * @author Ben Yu */ +@NullUnmarked public class FreshValueGeneratorTest extends TestCase { @AndroidIncompatible // problem with equality of Type objects? diff --git a/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java b/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java index bda3916c1834..7a83cc740a9c 100644 --- a/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java +++ b/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java @@ -26,6 +26,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -36,6 +37,7 @@ */ @AndroidIncompatible // depends on details of gc +@NullUnmarked public class GcFinalizationTest extends TestCase { // ---------------------------------------------------------------- diff --git a/guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java b/guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java index 3210b7aab67b..e82997a5062e 100644 --- a/guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java +++ b/guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java @@ -48,6 +48,7 @@ import java.util.SortedSet; import javax.annotation.CheckForNull; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -60,6 +61,7 @@ "CheckReturnValue", "unused", // many methods tested reflectively -- maybe prefer local @Keep annotations? }) +@NullUnmarked public class NullPointerTesterTest extends TestCase { /** Non-NPE RuntimeException. */ diff --git a/guava-testlib/test/com/google/common/testing/PackageSanityTests.java b/guava-testlib/test/com/google/common/testing/PackageSanityTests.java index d5483d36f092..1770e3376685 100644 --- a/guava-testlib/test/com/google/common/testing/PackageSanityTests.java +++ b/guava-testlib/test/com/google/common/testing/PackageSanityTests.java @@ -16,7 +16,9 @@ package com.google.common.testing; +import org.jspecify.annotations.NullUnmarked; /** Test nulls for the entire package. */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests {} diff --git a/guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java b/guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java index 943c2951e3a0..e5c597892fb8 100644 --- a/guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java +++ b/guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java @@ -18,12 +18,14 @@ import com.google.common.testing.RelationshipTester.ItemReporter; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link RelationshipTester}. * * @author Ben Yu */ +@NullUnmarked public class RelationshipTesterTest extends TestCase { public void testNulls() { diff --git a/guava-testlib/test/com/google/common/testing/SerializableTesterTest.java b/guava-testlib/test/com/google/common/testing/SerializableTesterTest.java index e950c9968cd1..dbab0b6c5a5b 100644 --- a/guava-testlib/test/com/google/common/testing/SerializableTesterTest.java +++ b/guava-testlib/test/com/google/common/testing/SerializableTesterTest.java @@ -19,6 +19,7 @@ import java.io.Serializable; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -26,6 +27,7 @@ * * @author Nick Kralevich */ +@NullUnmarked public class SerializableTesterTest extends TestCase { public void testStringAssertions() { String original = "hello world"; diff --git a/guava-testlib/test/com/google/common/testing/TearDownStackTest.java b/guava-testlib/test/com/google/common/testing/TearDownStackTest.java index 369563e04755..1e23183baf3c 100644 --- a/guava-testlib/test/com/google/common/testing/TearDownStackTest.java +++ b/guava-testlib/test/com/google/common/testing/TearDownStackTest.java @@ -20,10 +20,14 @@ import com.google.common.annotations.GwtCompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; -/** @author Luiz-Otavio "Z" Zorzella */ +/** + * @author Luiz-Otavio "Z" Zorzella + */ @GwtCompatible +@NullUnmarked public class TearDownStackTest extends TestCase { private TearDownStack tearDownStack = new TearDownStack(); diff --git a/guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java b/guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java index 212f6af9f0e9..4af6b6b3ed94 100644 --- a/guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java +++ b/guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java @@ -20,12 +20,14 @@ import java.util.logging.LogRecord; import java.util.logging.Logger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link TestLogHandler}. * * @author kevinb */ +@NullUnmarked public class TestLogHandlerTest extends TestCase { private TestLogHandler handler; diff --git a/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java b/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java index 6ed8006ee903..2727d3723fe6 100644 --- a/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java @@ -25,12 +25,14 @@ import java.util.List; import java.util.Locale; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the ASCII class. * * @author Kevin Bourrillion */ +@NullUnmarked public class AsciiBenchmark { private static final String ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; private static final String NONALPHA = "0123456789`~-_=+[]{}|;:',.<>/?!@#$%^&*()\"\\"; diff --git a/guava-tests/benchmark/com/google/common/base/CharMatcherBenchmark.java b/guava-tests/benchmark/com/google/common/base/CharMatcherBenchmark.java index f5667d89b27d..dcc5532ea7bd 100644 --- a/guava-tests/benchmark/com/google/common/base/CharMatcherBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/CharMatcherBenchmark.java @@ -25,6 +25,7 @@ import java.util.Collections; import java.util.List; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmark for the {@link CharMatcher} class. @@ -33,6 +34,7 @@ * @author Kevin Bourrillion * @author David Richter */ +@NullUnmarked public class CharMatcherBenchmark { // Caliper injects params automatically diff --git a/guava-tests/benchmark/com/google/common/base/EnumsBenchmark.java b/guava-tests/benchmark/com/google/common/base/EnumsBenchmark.java index 0acb562a0b53..79143409d672 100644 --- a/guava-tests/benchmark/com/google/common/base/EnumsBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/EnumsBenchmark.java @@ -22,8 +22,10 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.jspecify.annotations.NullUnmarked; @SuppressWarnings("unused") // Nested enums used reflectively in setUp. +@NullUnmarked public class EnumsBenchmark { @Param({"Small", "Medium", "Large"}) diff --git a/guava-tests/benchmark/com/google/common/base/JoinerBenchmark.java b/guava-tests/benchmark/com/google/common/base/JoinerBenchmark.java index 99728327e9bb..8b3b5afd02d3 100644 --- a/guava-tests/benchmark/com/google/common/base/JoinerBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/JoinerBenchmark.java @@ -21,12 +21,14 @@ import com.google.caliper.Param; import java.util.Arrays; import java.util.Iterator; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks {@link Joiner} against some common implementations of delimiter-based string joining. * * @author Adomas Paltanavicius */ +@NullUnmarked public class JoinerBenchmark { private static final String DELIMITER_STRING = ","; diff --git a/guava-tests/benchmark/com/google/common/base/LazyStackTraceBenchmark.java b/guava-tests/benchmark/com/google/common/base/LazyStackTraceBenchmark.java index 5f79d0c42366..f4843bddcaef 100644 --- a/guava-tests/benchmark/com/google/common/base/LazyStackTraceBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/LazyStackTraceBenchmark.java @@ -24,11 +24,13 @@ import com.google.caliper.Param; import com.google.caliper.api.SkipThisScenarioException; import java.util.List; +import org.jspecify.annotations.NullUnmarked; /** * Quick and dirty benchmark of {@link Throwables#lazyStackTrace(Throwable)}. We benchmark a "caller * finder" implementation that might be used in a logging framework. */ +@NullUnmarked public class LazyStackTraceBenchmark { @Param({"20", "200", "2000"}) int stackDepth; diff --git a/guava-tests/benchmark/com/google/common/base/ObjectsBenchmark.java b/guava-tests/benchmark/com/google/common/base/ObjectsBenchmark.java index 561f76dca98b..82385daa3725 100644 --- a/guava-tests/benchmark/com/google/common/base/ObjectsBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/ObjectsBenchmark.java @@ -17,12 +17,14 @@ package com.google.common.base; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Some microbenchmarks for the {@link com.google.common.base.Objects} class. * * @author Ben L. Titzer */ +@NullUnmarked public class ObjectsBenchmark { private static final Integer I0 = -45; diff --git a/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java b/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java index 5c3ced36e8bc..4d23cc20fc68 100644 --- a/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java @@ -20,12 +20,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import com.google.common.collect.Iterables; +import org.jspecify.annotations.NullUnmarked; /** * Microbenchmark for {@link Splitter#on} with char vs String with length == 1. * * @author Paul Lindner */ +@NullUnmarked public class SplitterBenchmark { // overall size of string @Param({"1", "10", "100", "1000"}) diff --git a/guava-tests/benchmark/com/google/common/base/StopwatchBenchmark.java b/guava-tests/benchmark/com/google/common/base/StopwatchBenchmark.java index 0351e94fcfa1..21e71774391e 100644 --- a/guava-tests/benchmark/com/google/common/base/StopwatchBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/StopwatchBenchmark.java @@ -19,6 +19,7 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Simple benchmark: create, start, read. This does not currently report the most useful result @@ -26,6 +27,7 @@ * * @author Kevin Bourrillion */ +@NullUnmarked public class StopwatchBenchmark { @Benchmark long stopwatch(int reps) { diff --git a/guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java b/guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java index 16e00ef3d2e2..9f350cf68c78 100644 --- a/guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java @@ -19,12 +19,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; import com.google.caliper.Param; +import org.jspecify.annotations.NullUnmarked; /** * Microbenchmark for {@link com.google.common.base.Strings#repeat} * * @author Mike Cripps */ +@NullUnmarked public class StringsRepeatBenchmark { @Param({"1", "5", "25", "125"}) int count; diff --git a/guava-tests/benchmark/com/google/common/base/ToStringHelperBenchmark.java b/guava-tests/benchmark/com/google/common/base/ToStringHelperBenchmark.java index 2150c3386dee..22a720fac769 100644 --- a/guava-tests/benchmark/com/google/common/base/ToStringHelperBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/ToStringHelperBenchmark.java @@ -20,12 +20,14 @@ import com.google.caliper.Param; import java.util.Arrays; import java.util.Collections; +import org.jspecify.annotations.NullUnmarked; /** * Some microbenchmarks for the {@link MoreObjects.ToStringHelper} class. * * @author Osvaldo Doederlein */ +@NullUnmarked public class ToStringHelperBenchmark { @Param({"0", "1", "5"}) diff --git a/guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java b/guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java index fd3c9c4dc255..2793fc5e08d4 100644 --- a/guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java @@ -21,8 +21,10 @@ import com.google.caliper.Param; import java.util.BitSet; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** Benchmark for the {@link CharMatcher#whitespace} implementation. */ +@NullUnmarked public class WhitespaceMatcherBenchmark { private static final int STRING_LENGTH = 10000; diff --git a/guava-tests/benchmark/com/google/common/cache/ChainBenchmark.java b/guava-tests/benchmark/com/google/common/cache/ChainBenchmark.java index 592e80b64ae8..4ffc712078d6 100644 --- a/guava-tests/benchmark/com/google/common/cache/ChainBenchmark.java +++ b/guava-tests/benchmark/com/google/common/cache/ChainBenchmark.java @@ -20,6 +20,7 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import com.google.common.cache.LocalCache.Segment; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -28,6 +29,7 @@ * @author Charles Fry */ @SuppressWarnings("CheckReturnValue") +@NullUnmarked public class ChainBenchmark { @Param({"1", "2", "3", "4", "5", "6"}) diff --git a/guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java b/guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java index b15de8f8892e..3383b407b448 100644 --- a/guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java +++ b/guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java @@ -23,12 +23,14 @@ import com.google.common.primitives.Ints; import java.util.Random; import java.util.concurrent.atomic.AtomicLong; +import org.jspecify.annotations.NullUnmarked; /** * Single-threaded benchmark for {@link LoadingCache}. * * @author Charles Fry */ +@NullUnmarked public class LoadingCacheSingleThreadBenchmark { @Param({"1000", "2000"}) int maximumSize; diff --git a/guava-tests/benchmark/com/google/common/cache/MapMakerComparisonBenchmark.java b/guava-tests/benchmark/com/google/common/cache/MapMakerComparisonBenchmark.java index 7641ce42455d..1e7ded9d92b9 100644 --- a/guava-tests/benchmark/com/google/common/cache/MapMakerComparisonBenchmark.java +++ b/guava-tests/benchmark/com/google/common/cache/MapMakerComparisonBenchmark.java @@ -20,6 +20,7 @@ import com.google.caliper.Benchmark; import com.google.common.collect.MapMaker; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; /** * Compare CacheBuilder and MapMaker performance, ensuring that they remain on par with each other. @@ -27,6 +28,7 @@ * @author Nikita Sidorov */ @SuppressWarnings("CheckReturnValue") +@NullUnmarked public class MapMakerComparisonBenchmark { private static final String TEST_KEY = "test key"; private static final String TEST_VALUE = "test value"; diff --git a/guava-tests/benchmark/com/google/common/cache/SegmentBenchmark.java b/guava-tests/benchmark/com/google/common/cache/SegmentBenchmark.java index a473d75e585d..e50da889645e 100644 --- a/guava-tests/benchmark/com/google/common/cache/SegmentBenchmark.java +++ b/guava-tests/benchmark/com/google/common/cache/SegmentBenchmark.java @@ -23,12 +23,14 @@ import com.google.caliper.Param; import com.google.common.cache.LocalCache.Segment; import java.util.concurrent.atomic.AtomicReferenceArray; +import org.jspecify.annotations.NullUnmarked; /** * Benchmark for {@code LocalCache.Segment.expand()}. * * @author Charles Fry */ +@NullUnmarked public class SegmentBenchmark { @Param({"16", "32", "64", "128", "256", "512", "1024", "2048", "4096", "8192"}) diff --git a/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java b/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java index 75fc1f90d2ef..76e04fddfc81 100644 --- a/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java @@ -21,12 +21,14 @@ import com.google.common.primitives.Ints; import java.util.List; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the {@code TreeTraverser} operations on binary trees. * * @author Louis Wasserman */ +@NullUnmarked public class BinaryTreeTraverserBenchmark { private static class BinaryNode { final int x; diff --git a/guava-tests/benchmark/com/google/common/collect/ComparatorDelegationOverheadBenchmark.java b/guava-tests/benchmark/com/google/common/collect/ComparatorDelegationOverheadBenchmark.java index 11e4b80a6204..9d618b5fb9d3 100644 --- a/guava-tests/benchmark/com/google/common/collect/ComparatorDelegationOverheadBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/ComparatorDelegationOverheadBenchmark.java @@ -22,6 +22,7 @@ import java.util.Arrays; import java.util.Comparator; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * A benchmark to determine the overhead of sorting with {@link Ordering#from(Comparator)}, or with @@ -30,6 +31,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class ComparatorDelegationOverheadBenchmark { private final Integer[][] inputArrays = new Integer[0x100][]; diff --git a/guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java b/guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java index 3fd9be87980d..4a70a0e07988 100644 --- a/guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java @@ -38,6 +38,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -45,6 +46,7 @@ * * @author mike nonemacher */ +@NullUnmarked public class ConcurrentHashMultisetBenchmark { @Param({"1", "2", "4", "8"}) int threads; diff --git a/guava-tests/benchmark/com/google/common/collect/HashMultisetAddPresentBenchmark.java b/guava-tests/benchmark/com/google/common/collect/HashMultisetAddPresentBenchmark.java index a109cc2ed324..f48d27cf5cc2 100644 --- a/guava-tests/benchmark/com/google/common/collect/HashMultisetAddPresentBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/HashMultisetAddPresentBenchmark.java @@ -19,12 +19,14 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmark for HashMultiset.add for an already-present element. * * @author Louis Wasserman */ +@NullUnmarked public class HashMultisetAddPresentBenchmark { private static final int ARRAY_MASK = 0x0ffff; private static final int ARRAY_SIZE = 0x10000; diff --git a/guava-tests/benchmark/com/google/common/collect/ImmutableListCreationBenchmark.java b/guava-tests/benchmark/com/google/common/collect/ImmutableListCreationBenchmark.java index ce0e24abb616..a2c0f3976b95 100644 --- a/guava-tests/benchmark/com/google/common/collect/ImmutableListCreationBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/ImmutableListCreationBenchmark.java @@ -19,12 +19,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.util.List; +import org.jspecify.annotations.NullUnmarked; /** * Benchmark for various ways to create an {@code ImmutableList}. * * @author Louis Wasserman */ +@NullUnmarked public class ImmutableListCreationBenchmark { @Param({"10", "1000", "1000000"}) diff --git a/guava-tests/benchmark/com/google/common/collect/ImmutableSetHashFloodingDetectionBenchmark.java b/guava-tests/benchmark/com/google/common/collect/ImmutableSetHashFloodingDetectionBenchmark.java index 9e43bb71d7ce..54e8fc8cb232 100644 --- a/guava-tests/benchmark/com/google/common/collect/ImmutableSetHashFloodingDetectionBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/ImmutableSetHashFloodingDetectionBenchmark.java @@ -21,8 +21,10 @@ import com.google.caliper.Param; import com.google.common.math.IntMath; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** Benchmark of implementations of {@link ImmutableSet#hashFloodingDetected(Object[])}. */ +@NullUnmarked public class ImmutableSetHashFloodingDetectionBenchmark { private static final int TEST_CASES = 0x100; diff --git a/guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java b/guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java index 2b6a8c011488..aa96b5ee67a5 100644 --- a/guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java @@ -17,12 +17,14 @@ package com.google.common.collect; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarking interners. * * @author Dimitris Andreou */ +@NullUnmarked public class InternersBenchmark { @Benchmark int weakInterner(int reps) { diff --git a/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java b/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java index 6475d3cfb2e2..89d1d5339d79 100644 --- a/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/IteratorBenchmark.java @@ -21,12 +21,14 @@ import com.google.caliper.Param; import java.util.ArrayList; import java.util.LinkedList; +import org.jspecify.annotations.NullUnmarked; /** * Tests the speed of iteration of different iteration methods for collections. * * @author David Richter */ +@NullUnmarked public class IteratorBenchmark { @Param({"0", "1", "16", "256", "4096", "65536"}) int size; diff --git a/guava-tests/benchmark/com/google/common/collect/MapBenchmark.java b/guava-tests/benchmark/com/google/common/collect/MapBenchmark.java index e8aa4e9e22eb..4c71174b5073 100644 --- a/guava-tests/benchmark/com/google/common/collect/MapBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/MapBenchmark.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListMap; +import org.jspecify.annotations.NullUnmarked; /** * A microbenchmark that tests the performance of get() and iteration on various map @@ -37,6 +38,7 @@ * * @author Nicholaus Shupe */ +@NullUnmarked public class MapBenchmark { @Param({"Hash", "LinkedHM", "MapMaker1", "Immutable"}) private Impl impl; diff --git a/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java b/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java index 08755044c3e0..432414accc62 100644 --- a/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java @@ -25,6 +25,7 @@ import java.util.PriorityQueue; import java.util.Queue; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -32,6 +33,7 @@ * * @author Sverre Sundsdal */ +@NullUnmarked public class MinMaxPriorityQueueBenchmark { @Param private ComparatorType comparator; diff --git a/guava-tests/benchmark/com/google/common/collect/MultipleSetContainsBenchmark.java b/guava-tests/benchmark/com/google/common/collect/MultipleSetContainsBenchmark.java index ecefcb0e4dc0..e21eb4734698 100644 --- a/guava-tests/benchmark/com/google/common/collect/MultipleSetContainsBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/MultipleSetContainsBenchmark.java @@ -21,8 +21,10 @@ import com.google.caliper.Param; import com.google.caliper.api.SkipThisScenarioException; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** A benchmark that tries invoking {@code Set.contains} on many different sets. */ +@NullUnmarked public class MultipleSetContainsBenchmark { @Param({"0.0", "0.1", "0.7", "1.0"}) diff --git a/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java b/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java index 29caec305638..552743d69abe 100644 --- a/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java @@ -23,12 +23,14 @@ import com.google.caliper.Param; import com.google.common.base.Preconditions; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Tests the speed of iteration of different iteration methods for collections. * * @author David Richter */ +@NullUnmarked public class MultisetIteratorBenchmark { @Param({"0", "1", "16", "256", "4096", "65536"}) int size; diff --git a/guava-tests/benchmark/com/google/common/collect/PowerSetBenchmark.java b/guava-tests/benchmark/com/google/common/collect/PowerSetBenchmark.java index e775b8b28acf..bf6cd36a5142 100644 --- a/guava-tests/benchmark/com/google/common/collect/PowerSetBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/PowerSetBenchmark.java @@ -22,12 +22,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; /** * Very simple powerSet iteration benchmark. * * @author Kevin Bourrillion */ +@NullUnmarked public class PowerSetBenchmark { @Param({"2", "4", "8", "16"}) int elements; diff --git a/guava-tests/benchmark/com/google/common/collect/SetContainsBenchmark.java b/guava-tests/benchmark/com/google/common/collect/SetContainsBenchmark.java index c2a21b124460..88665d667521 100644 --- a/guava-tests/benchmark/com/google/common/collect/SetContainsBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/SetContainsBenchmark.java @@ -22,12 +22,14 @@ import com.google.common.collect.BenchmarkHelpers.SetImpl; import com.google.common.collect.CollectionBenchmarkSampleData.Element; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; /** * A microbenchmark that tests the performance of contains() on various Set implementations. * * @author Kevin Bourrillion */ +@NullUnmarked public class SetContainsBenchmark { // Start at 4.88 then multiply by 2*2^phi - The goal is be uniform // yet visit a variety of "values-relative-to-the-next-power-of-2" diff --git a/guava-tests/benchmark/com/google/common/collect/SetCreationBenchmark.java b/guava-tests/benchmark/com/google/common/collect/SetCreationBenchmark.java index be114e1539e3..00887ba70904 100644 --- a/guava-tests/benchmark/com/google/common/collect/SetCreationBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/SetCreationBenchmark.java @@ -20,6 +20,7 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import com.google.common.collect.BenchmarkHelpers.SetImpl; +import org.jspecify.annotations.NullUnmarked; /** * This is meant to be used with {@code --measureMemory} to measure the memory usage of various @@ -27,6 +28,7 @@ * * @author Christopher Swenson */ +@NullUnmarked public class SetCreationBenchmark { @Param({ "3", "6", "11", "23", "45", "91", "181", "362", "724", "1448", "2896", "5793", "11585", "23170", diff --git a/guava-tests/benchmark/com/google/common/collect/SetIterationBenchmark.java b/guava-tests/benchmark/com/google/common/collect/SetIterationBenchmark.java index 796acefabfe6..958fc0c19817 100644 --- a/guava-tests/benchmark/com/google/common/collect/SetIterationBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/SetIterationBenchmark.java @@ -22,12 +22,14 @@ import com.google.common.collect.BenchmarkHelpers.SetImpl; import com.google.common.collect.CollectionBenchmarkSampleData.Element; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; /** * Test iteration speed at various size for {@link Set} instances. * * @author Christopher Swenson */ +@NullUnmarked public class SetIterationBenchmark { @Param({ "3", "6", "11", "23", "45", "91", "181", "362", "724", "1448", "2896", "5793", "11585", "23170", diff --git a/guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java b/guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java index 639f48847f93..3353ed96dc04 100644 --- a/guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java @@ -27,6 +27,7 @@ import java.util.Random; import java.util.Set; import java.util.TreeSet; +import org.jspecify.annotations.NullUnmarked; /** * Provides supporting data for performance notes in the documentation of {@link @@ -34,6 +35,7 @@ * suggestions. * */ +@NullUnmarked public class SortedCopyBenchmark { @Param({"1", "10", "1000", "1000000"}) int size; // logarithmic triangular diff --git a/guava-tests/benchmark/com/google/common/collect/StreamsBenchmark.java b/guava-tests/benchmark/com/google/common/collect/StreamsBenchmark.java index cd6b98fac594..a8736438d136 100644 --- a/guava-tests/benchmark/com/google/common/collect/StreamsBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/StreamsBenchmark.java @@ -28,12 +28,14 @@ import java.util.NoSuchElementException; import java.util.function.Supplier; import java.util.stream.Stream; +import org.jspecify.annotations.NullUnmarked; /** * Test stream operation speed. * * @author Louis Wasserman */ +@NullUnmarked public class StreamsBenchmark { @Param({"1", "10", "100", "1000", "10000"}) private int size; diff --git a/guava-tests/benchmark/com/google/common/eventbus/EventBusBenchmark.java b/guava-tests/benchmark/com/google/common/eventbus/EventBusBenchmark.java index 53ddfb7cc0c7..0c4095efbb62 100644 --- a/guava-tests/benchmark/com/google/common/eventbus/EventBusBenchmark.java +++ b/guava-tests/benchmark/com/google/common/eventbus/EventBusBenchmark.java @@ -18,12 +18,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Benchmark for {@link EventBus}. * * @author Eric Fellheimer */ +@NullUnmarked public class EventBusBenchmark { private EventBus eventBus; diff --git a/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java b/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java index 868a9d390f28..5fe37f971697 100644 --- a/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java +++ b/guava-tests/benchmark/com/google/common/hash/ChecksumBenchmark.java @@ -23,6 +23,7 @@ import java.util.zip.Adler32; import java.util.zip.CRC32; import java.util.zip.Checksum; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for comparing {@link Checksum}s and {@link HashFunction}s that wrap {@link Checksum}s. @@ -35,6 +36,7 @@ * * @author Colin Decker */ +@NullUnmarked public class ChecksumBenchmark { // Use a constant seed for all of the benchmarks to ensure apples to apples comparisons. diff --git a/guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java b/guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java index 3e3ec70fafa1..d7b6eb110454 100644 --- a/guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java +++ b/guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java @@ -22,6 +22,7 @@ import java.security.MessageDigest; import java.util.Arrays; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for comparing the various {@link HashCode#equals} methods. @@ -41,6 +42,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class HashCodeBenchmark { // Use a statically configured random instance for all of the benchmarks diff --git a/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java b/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java index 8a807f9b1ba1..69ece875f195 100644 --- a/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java +++ b/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java @@ -20,6 +20,7 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for comparing the various {@link HashFunction functions} that we provide. @@ -33,6 +34,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class HashFunctionBenchmark { // Use a statically configured random instance for all of the benchmarks diff --git a/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java b/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java index 2c73be0994f2..6dc7c0963569 100644 --- a/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java +++ b/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java @@ -22,8 +22,10 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** Benchmarks for the hashing of UTF-8 strings. */ +@NullUnmarked public class HashStringBenchmark { static class MaxCodePoint { final int value; diff --git a/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java b/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java index 2e252d127b68..8eca5a99cced 100644 --- a/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java +++ b/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java @@ -22,6 +22,7 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for comparing {@link MessageDigest}s and {@link com.google.common.hash.HashFunction}s @@ -37,6 +38,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class MessageDigestAlgorithmBenchmark { @Param({"10", "1000", "100000", "1000000"}) int size; diff --git a/guava-tests/benchmark/com/google/common/hash/MessageDigestCreationBenchmark.java b/guava-tests/benchmark/com/google/common/hash/MessageDigestCreationBenchmark.java index bc2dc94102f2..3990b467633a 100644 --- a/guava-tests/benchmark/com/google/common/hash/MessageDigestCreationBenchmark.java +++ b/guava-tests/benchmark/com/google/common/hash/MessageDigestCreationBenchmark.java @@ -20,12 +20,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.security.MessageDigest; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for comparing instance creation of {@link MessageDigest}s. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class MessageDigestCreationBenchmark { @Param({"MD5", "SHA-1", "SHA-256", "SHA-384", "SHA-512"}) diff --git a/guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java b/guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java index a098542a7130..4cd211110c3d 100644 --- a/guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java +++ b/guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java @@ -23,8 +23,10 @@ import java.io.StringReader; import java.io.StringWriter; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** Benchmark for {@code BaseEncoding} performance. */ +@NullUnmarked public class BaseEncodingBenchmark { private static final int INPUTS_COUNT = 0x1000; private static final int INPUTS_MASK = 0xFFF; diff --git a/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java b/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java index f82a0c3e6020..cdc9ec4ce6b6 100644 --- a/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java +++ b/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java @@ -23,12 +23,14 @@ import java.io.InputStreamReader; import java.nio.charset.Charset; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for various potential implementations of {@code ByteSource.asCharSource(...).read()}. */ // These benchmarks allocate a lot of data so use a large heap @VmOptions({"-Xms12g", "-Xmx12g", "-d64"}) +@NullUnmarked public class ByteSourceAsCharSourceReadBenchmark { enum ReadStrategy { TO_BYTE_ARRAY_NEW_STRING { diff --git a/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java b/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java index 0b9c87489c67..b6ff61f25d9f 100644 --- a/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java +++ b/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java @@ -24,6 +24,7 @@ import java.nio.Buffer; import java.nio.CharBuffer; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for {@link CharStreams#copy}. @@ -33,6 +34,7 @@ */ // These benchmarks allocate a lot of data so use a large heap @VmOptions({"-Xms12g", "-Xmx12g", "-d64"}) +@NullUnmarked public class CharStreamsCopyBenchmark { enum CopyStrategy { OLD { diff --git a/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java b/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java index afcf95c4285b..4105c1c49b46 100644 --- a/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java @@ -25,6 +25,7 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; import com.google.caliper.Param; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks against the Apache Commons Math utilities. @@ -33,6 +34,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class ApacheBenchmark { private enum Impl { GUAVA { diff --git a/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java b/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java index f2087f3b1c08..d719e4adac75 100644 --- a/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java @@ -25,12 +25,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.math.BigInteger; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the non-rounding methods of {@code BigIntegerMath}. * * @author Louis Wasserman */ +@NullUnmarked public class BigIntegerMathBenchmark { private static final int[] factorials = new int[ARRAY_SIZE]; private static final int[] slowFactorials = new int[ARRAY_SIZE]; diff --git a/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java b/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java index be387f792459..e33aca162dd3 100644 --- a/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java @@ -26,12 +26,14 @@ import com.google.caliper.Param; import java.math.BigInteger; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the rounding methods of {@code BigIntegerMath}. * * @author Louis Wasserman */ +@NullUnmarked public class BigIntegerMathRoundingBenchmark { private static final BigInteger[] nonzero1 = new BigInteger[ARRAY_SIZE]; private static final BigInteger[] nonzero2 = new BigInteger[ARRAY_SIZE]; diff --git a/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java b/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java index 937c94c98337..b012e729f40d 100644 --- a/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java @@ -24,12 +24,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the non-rounding methods of {@code DoubleMath}. * * @author Louis Wasserman */ +@NullUnmarked public class DoubleMathBenchmark { private static final double[] positiveDoubles = new double[ARRAY_SIZE]; private static final int[] factorials = new int[ARRAY_SIZE]; diff --git a/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java b/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java index 7ab80b15cd6b..6ba25a1994ec 100644 --- a/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java @@ -25,12 +25,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the rounding methods of {@code DoubleMath}. * * @author Louis Wasserman */ +@NullUnmarked public class DoubleMathRoundingBenchmark { private static final double[] doubleInIntRange = new double[ARRAY_SIZE]; private static final double[] doubleInLongRange = new double[ARRAY_SIZE]; diff --git a/guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java b/guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java index 58b0bb64e0e9..730284d79cf9 100644 --- a/guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java @@ -25,12 +25,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the non-rounding methods of {@code IntMath}. * * @author Louis Wasserman */ +@NullUnmarked public class IntMathBenchmark { private static int[] exponent = new int[ARRAY_SIZE]; private static int[] factorial = new int[ARRAY_SIZE]; diff --git a/guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java b/guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java index cfa3d7393cd1..b1902b9f6a4f 100644 --- a/guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java @@ -26,12 +26,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the rounding methods of {@code IntMath}. * * @author Louis Wasserman */ +@NullUnmarked public class IntMathRoundingBenchmark { private static final int[] positive = new int[ARRAY_SIZE]; private static final int[] nonzero = new int[ARRAY_SIZE]; diff --git a/guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java b/guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java index a63dd6b16b0a..de7a3e55c247 100644 --- a/guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java @@ -20,12 +20,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for various ways of writing the expression {@code foo + ((bar < baz) ? 1 : 0)}. * * @author Louis Wasserman */ +@NullUnmarked public class LessThanBenchmark { static final int SAMPLE_SIZE = 0x1000; static final int SAMPLE_MASK = 0x0FFF; diff --git a/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java b/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java index 6b0407cd5787..7934a776c71f 100644 --- a/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java @@ -25,12 +25,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the non-rounding methods of {@code LongMath}. * * @author Louis Wasserman */ +@NullUnmarked public class LongMathBenchmark { private static final int[] exponents = new int[ARRAY_SIZE]; private static final int[] factorialArguments = new int[ARRAY_SIZE]; diff --git a/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java b/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java index 5f2ac40550c3..868f2d5d2d04 100644 --- a/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java @@ -26,12 +26,14 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for the rounding methods of {@code LongMath}. * * @author Louis Wasserman */ +@NullUnmarked public class LongMathRoundingBenchmark { @Param({"DOWN", "UP", "FLOOR", "CEILING", "HALF_EVEN", "HALF_UP", "HALF_DOWN"}) RoundingMode mode; diff --git a/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java b/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java index d97c2d56d642..d55d7b1069d5 100644 --- a/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java @@ -24,8 +24,10 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Range; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** Benchmarks some algorithms providing the same functionality as {@link Quantiles}. */ +@NullUnmarked public class QuantilesBenchmark { private static final ContiguousSet ALL_DECILE_INDEXES = diff --git a/guava-tests/benchmark/com/google/common/math/StatsBenchmark.java b/guava-tests/benchmark/com/google/common/math/StatsBenchmark.java index 7e50249162af..c37b1610e50b 100644 --- a/guava-tests/benchmark/com/google/common/math/StatsBenchmark.java +++ b/guava-tests/benchmark/com/google/common/math/StatsBenchmark.java @@ -22,12 +22,14 @@ import com.google.caliper.api.SkipThisScenarioException; import com.google.common.primitives.Doubles; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for various algorithms for computing the mean and/or variance. * * @author Louis Wasserman */ +@NullUnmarked public class StatsBenchmark { enum MeanAlgorithm { diff --git a/guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java b/guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java index 71ea279bd057..3b4fda5a7f28 100644 --- a/guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java +++ b/guava-tests/benchmark/com/google/common/primitives/UnsignedBytesBenchmark.java @@ -22,12 +22,14 @@ import java.util.Arrays; import java.util.Comparator; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Microbenchmark for {@link UnsignedBytes}. * * @author Hiroshi Yamauchi */ +@NullUnmarked public class UnsignedBytesBenchmark { private byte[] ba1; diff --git a/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java b/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java index 288aa0c5c33c..cf5d3744cf6a 100644 --- a/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java +++ b/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java @@ -19,12 +19,14 @@ import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for certain methods of {@code UnsignedLongs}. * * @author Eamonn McManus */ +@NullUnmarked public class UnsignedLongsBenchmark { private static final int ARRAY_SIZE = 0x10000; private static final int ARRAY_MASK = 0x0ffff; diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java b/guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java index 09edd1dcb013..b4dd6202da5f 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java @@ -27,8 +27,10 @@ import java.util.HashSet; import java.util.Set; import java.util.concurrent.Executor; +import org.jspecify.annotations.NullUnmarked; /** Measures the size of AbstractFuture implementations. */ +@NullUnmarked public class AbstractFutureFootprintBenchmark { enum State { diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java b/guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java index ce674e14e8ce..ec28f78abab8 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java @@ -21,12 +21,14 @@ import com.google.caliper.Param; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for {@link CycleDetectingLockFactory}. * * @author Darick Tong */ +@NullUnmarked public class CycleDetectingLockFactoryBenchmark { @Param({"2", "3", "4", "5", "10"}) diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java b/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java index 50618e63e4d2..a8411cec1afd 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java @@ -42,11 +42,13 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.logging.Logger; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import sun.misc.Unsafe; /** Benchmarks for {@link ExecutionList}. */ @VmOptions({"-Xms8g", "-Xmx8g"}) +@NullUnmarked public class ExecutionListBenchmark { private static final int NUM_THREADS = 10; // make a param? diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java b/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java index 98b696b4b4bb..26714674a82a 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java @@ -45,8 +45,10 @@ import java.util.prefs.InvalidPreferencesFormatException; import java.util.zip.DataFormatException; import javax.security.auth.RefreshFailedException; +import org.jspecify.annotations.NullUnmarked; /** Microbenchmark for {@link Futures#getChecked}. */ +@NullUnmarked public class FuturesGetCheckedBenchmark { private enum Validator { NON_CACHING_WITH_CONSTRUCTOR_CHECK(nonCachingWithConstructorCheckValidator()), diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java b/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java index 7b9be17ec374..7ad6e961a2f2 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java @@ -25,6 +25,7 @@ import java.util.NoSuchElementException; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -52,6 +53,7 @@ * @param the type of elements held in this collection */ // TODO(kak): consider removing some of the @CanIgnoreReturnValue annotations as appropriate +@NullUnmarked public class MonitorBasedArrayBlockingQueue extends AbstractQueue implements BlockingQueue { diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java b/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java index efa7e033bc2c..e5dd26f62b2f 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java @@ -30,6 +30,7 @@ import java.util.SortedSet; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -76,6 +77,7 @@ * @author Justin T. Sampson * @param the type of elements held in this collection */ +@NullUnmarked public class MonitorBasedPriorityBlockingQueue extends AbstractQueue implements BlockingQueue { diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBenchmark.java b/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBenchmark.java index 692017d786c2..2513d861776b 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBenchmark.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBenchmark.java @@ -21,12 +21,14 @@ import com.google.caliper.Param; import java.lang.reflect.Constructor; import java.util.concurrent.BlockingQueue; +import org.jspecify.annotations.NullUnmarked; /** * Benchmarks for {@link Monitor}. * * @author Justin T. Sampson */ +@NullUnmarked public class MonitorBenchmark { @Param({"10", "100", "1000"}) diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/MoreExecutorsDirectExecutorBenchmark.java b/guava-tests/benchmark/com/google/common/util/concurrent/MoreExecutorsDirectExecutorBenchmark.java index f64ae389eefe..b42305e2b3e1 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/MoreExecutorsDirectExecutorBenchmark.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/MoreExecutorsDirectExecutorBenchmark.java @@ -29,12 +29,14 @@ import java.util.Set; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicInteger; +import org.jspecify.annotations.NullUnmarked; /** * A benchmark comparing the {@link MoreExecutors#newDirectExecutorService()} to {@link * MoreExecutors#directExecutor}. */ @VmOptions({"-Xms12g", "-Xmx12g", "-d64"}) +@NullUnmarked public class MoreExecutorsDirectExecutorBenchmark { enum Impl { EXECUTOR_SERVICE { diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/SingleThreadAbstractFutureBenchmark.java b/guava-tests/benchmark/com/google/common/util/concurrent/SingleThreadAbstractFutureBenchmark.java index 94b513f92897..0d8cfd59a9b9 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/SingleThreadAbstractFutureBenchmark.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/SingleThreadAbstractFutureBenchmark.java @@ -30,9 +30,11 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; +import org.jspecify.annotations.NullUnmarked; /** A benchmark that times how long it takes to add a given number of */ @VmOptions({"-Xms8g", "-Xmx8g"}) +@NullUnmarked public class SingleThreadAbstractFutureBenchmark { @Param Impl impl; diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/StripedBenchmark.java b/guava-tests/benchmark/com/google/common/util/concurrent/StripedBenchmark.java index 03c90d31dd89..3c1401e901c8 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/StripedBenchmark.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/StripedBenchmark.java @@ -33,9 +33,11 @@ import java.util.Random; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; +import org.jspecify.annotations.NullUnmarked; /** A benchmark comparing the various striped implementations. */ @VmOptions({"-Xms12g", "-Xmx12g", "-d64"}) +@NullUnmarked public class StripedBenchmark { private static final Supplier LOCK_SUPPLIER = new Supplier() { diff --git a/guava-tests/test/com/google/common/base/AbstractIteratorTest.java b/guava-tests/test/com/google/common/base/AbstractIteratorTest.java index 7dc3d0274017..a81bacf73baa 100644 --- a/guava-tests/test/com/google/common/base/AbstractIteratorTest.java +++ b/guava-tests/test/com/google/common/base/AbstractIteratorTest.java @@ -28,6 +28,7 @@ import java.util.Iterator; import java.util.NoSuchElementException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@code AbstractIterator}. @@ -35,6 +36,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class AbstractIteratorTest extends TestCase { public void testDefaultBehaviorOfNextAndHasNext() { diff --git a/guava-tests/test/com/google/common/base/AsciiTest.java b/guava-tests/test/com/google/common/base/AsciiTest.java index 3017289c5077..6faf81046006 100644 --- a/guava-tests/test/com/google/common/base/AsciiTest.java +++ b/guava-tests/test/com/google/common/base/AsciiTest.java @@ -21,6 +21,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Ascii}. @@ -28,6 +29,7 @@ * @author Craig Berry */ @GwtCompatible +@NullUnmarked public class AsciiTest extends TestCase { /** diff --git a/guava-tests/test/com/google/common/base/BenchmarkHelpers.java b/guava-tests/test/com/google/common/base/BenchmarkHelpers.java index eda9074b5418..adba32ca9587 100644 --- a/guava-tests/test/com/google/common/base/BenchmarkHelpers.java +++ b/guava-tests/test/com/google/common/base/BenchmarkHelpers.java @@ -14,12 +14,15 @@ package com.google.common.base; +import org.jspecify.annotations.NullUnmarked; + /** * Common benchmarking utilities. * * @author Christopher Swenson * @author Louis Wasserman */ +@NullUnmarked class BenchmarkHelpers { private static final String WHITESPACE_CHARACTERS = "\u00a0\u180e\u202f\t\n\013\f\r \u0085" diff --git a/guava-tests/test/com/google/common/base/CaseFormatTest.java b/guava-tests/test/com/google/common/base/CaseFormatTest.java index 57c7e1725672..ac9efb1f7fea 100644 --- a/guava-tests/test/com/google/common/base/CaseFormatTest.java +++ b/guava-tests/test/com/google/common/base/CaseFormatTest.java @@ -28,6 +28,7 @@ import com.google.common.testing.NullPointerTester; import com.google.common.testing.SerializableTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link CaseFormat}. @@ -35,6 +36,7 @@ * @author Mike Bostock */ @GwtCompatible(emulated = true) +@NullUnmarked public class CaseFormatTest extends TestCase { public void testIdentity() { diff --git a/guava-tests/test/com/google/common/base/CharsetsTest.java b/guava-tests/test/com/google/common/base/CharsetsTest.java index 8ff80d0f7e43..94dc1a115e2a 100644 --- a/guava-tests/test/com/google/common/base/CharsetsTest.java +++ b/guava-tests/test/com/google/common/base/CharsetsTest.java @@ -22,6 +22,7 @@ import java.nio.charset.Charset; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Charsets}. @@ -29,6 +30,7 @@ * @author Mike Bostock */ @GwtCompatible(emulated = true) +@NullUnmarked public class CharsetsTest extends TestCase { @J2ktIncompatible diff --git a/guava-tests/test/com/google/common/base/ConverterTest.java b/guava-tests/test/com/google/common/base/ConverterTest.java index d74331af2996..d566dcba0ceb 100644 --- a/guava-tests/test/com/google/common/base/ConverterTest.java +++ b/guava-tests/test/com/google/common/base/ConverterTest.java @@ -29,9 +29,11 @@ import java.util.Iterator; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link Converter}. */ @GwtCompatible(emulated = true) +@NullUnmarked public class ConverterTest extends TestCase { private static final Converter STR_TO_LONG = diff --git a/guava-tests/test/com/google/common/base/DefaultsTest.java b/guava-tests/test/com/google/common/base/DefaultsTest.java index 43881a70e0a5..3a95ab08f6a1 100644 --- a/guava-tests/test/com/google/common/base/DefaultsTest.java +++ b/guava-tests/test/com/google/common/base/DefaultsTest.java @@ -20,6 +20,7 @@ import com.google.common.annotations.GwtIncompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Defaults}. @@ -27,6 +28,7 @@ * @author Jige Yu */ @GwtIncompatible +@NullUnmarked public class DefaultsTest extends TestCase { public void testGetDefaultValue() { assertEquals(false, Defaults.defaultValue(boolean.class).booleanValue()); diff --git a/guava-tests/test/com/google/common/base/EnumsTest.java b/guava-tests/test/com/google/common/base/EnumsTest.java index 26b3a52a376d..394bbd3689b2 100644 --- a/guava-tests/test/com/google/common/base/EnumsTest.java +++ b/guava-tests/test/com/google/common/base/EnumsTest.java @@ -39,6 +39,7 @@ import java.util.HashSet; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Enums}. @@ -47,6 +48,7 @@ */ @GwtIncompatible @J2ktIncompatible +@NullUnmarked public class EnumsTest extends TestCase { private enum TestEnum { diff --git a/guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java b/guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java index 923647621376..c4236becab70 100644 --- a/guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java +++ b/guava-tests/test/com/google/common/base/FinalizableReferenceQueueClassLoaderUnloadingTest.java @@ -30,6 +30,7 @@ import java.net.URL; import java.net.URLClassLoader; import java.util.concurrent.atomic.AtomicReference; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -43,6 +44,7 @@ */ @AndroidIncompatible @RunWith(JUnit4.class) +@NullUnmarked public class FinalizableReferenceQueueClassLoaderUnloadingTest { /* diff --git a/guava-tests/test/com/google/common/base/FinalizableReferenceQueueTest.java b/guava-tests/test/com/google/common/base/FinalizableReferenceQueueTest.java index 534728db0942..fb4ca4da972c 100644 --- a/guava-tests/test/com/google/common/base/FinalizableReferenceQueueTest.java +++ b/guava-tests/test/com/google/common/base/FinalizableReferenceQueueTest.java @@ -35,6 +35,7 @@ import java.net.URLClassLoader; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.After; import org.junit.Test; @@ -52,6 +53,7 @@ @AndroidIncompatible @GwtIncompatible @RunWith(JUnit4.class) +@NullUnmarked public class FinalizableReferenceQueueTest { private @Nullable FinalizableReferenceQueue frq; diff --git a/guava-tests/test/com/google/common/base/MoreObjectsTest.java b/guava-tests/test/com/google/common/base/MoreObjectsTest.java index 9b3bbadd1b7d..3b7c8068953b 100644 --- a/guava-tests/test/com/google/common/base/MoreObjectsTest.java +++ b/guava-tests/test/com/google/common/base/MoreObjectsTest.java @@ -23,9 +23,11 @@ import com.google.common.annotations.J2ktIncompatible; import com.google.common.testing.NullPointerTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link MoreObjects}. */ @GwtCompatible(emulated = true) +@NullUnmarked public class MoreObjectsTest extends TestCase { public void testFirstNonNull_withNonNull() { String s1 = "foo"; diff --git a/guava-tests/test/com/google/common/base/ObjectsTest.java b/guava-tests/test/com/google/common/base/ObjectsTest.java index ff81db62d1d2..4d277975c3ae 100644 --- a/guava-tests/test/com/google/common/base/ObjectsTest.java +++ b/guava-tests/test/com/google/common/base/ObjectsTest.java @@ -21,6 +21,7 @@ import com.google.common.annotations.J2ktIncompatible; import com.google.common.testing.NullPointerTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Objects}. @@ -28,6 +29,7 @@ * @author Laurence Gonsalves */ @GwtCompatible(emulated = true) +@NullUnmarked public class ObjectsTest extends TestCase { public void testEqual() throws Exception { diff --git a/guava-tests/test/com/google/common/base/PackageSanityTests.java b/guava-tests/test/com/google/common/base/PackageSanityTests.java index c9eeed0decf7..7b77c80c7f63 100644 --- a/guava-tests/test/com/google/common/base/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/base/PackageSanityTests.java @@ -18,10 +18,12 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** Basic sanity tests for classes in {@code common.base}. */ @GwtIncompatible +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { // package private classes like FunctionalEquivalence are tested through the public API. diff --git a/guava-tests/test/com/google/common/base/StandardSystemPropertyTest.java b/guava-tests/test/com/google/common/base/StandardSystemPropertyTest.java index f4907a337e1e..6c898bf3dc52 100644 --- a/guava-tests/test/com/google/common/base/StandardSystemPropertyTest.java +++ b/guava-tests/test/com/google/common/base/StandardSystemPropertyTest.java @@ -22,6 +22,7 @@ import com.google.common.annotations.GwtIncompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link StandardSystemProperty}. @@ -29,6 +30,7 @@ * @author Kurt Alfred Kluever */ @GwtIncompatible +@NullUnmarked public class StandardSystemPropertyTest extends TestCase { public void testGetKeyMatchesString() { diff --git a/guava-tests/test/com/google/common/base/StopwatchJavaTimeTest.java b/guava-tests/test/com/google/common/base/StopwatchJavaTimeTest.java index 2b082119d29b..71bcfc740779 100644 --- a/guava-tests/test/com/google/common/base/StopwatchJavaTimeTest.java +++ b/guava-tests/test/com/google/common/base/StopwatchJavaTimeTest.java @@ -21,10 +21,12 @@ import com.google.common.testing.FakeTicker; import java.time.Duration; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit test for the {@code java.time} support in {@link Stopwatch}. */ @J2ktIncompatible @GwtIncompatible +@NullUnmarked public class StopwatchJavaTimeTest extends TestCase { private final FakeTicker ticker = new FakeTicker(); private final Stopwatch stopwatch = new Stopwatch(ticker); diff --git a/guava-tests/test/com/google/common/base/StopwatchTest.java b/guava-tests/test/com/google/common/base/StopwatchTest.java index abe0f438fb2a..53d583b1b17b 100644 --- a/guava-tests/test/com/google/common/base/StopwatchTest.java +++ b/guava-tests/test/com/google/common/base/StopwatchTest.java @@ -25,6 +25,7 @@ import com.google.common.annotations.J2ktIncompatible; import com.google.common.testing.FakeTicker; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Stopwatch}. @@ -32,6 +33,7 @@ * @author Kevin Bourrillion */ @GwtCompatible +@NullUnmarked public class StopwatchTest extends TestCase { private final FakeTicker ticker = new FakeTicker(); diff --git a/guava-tests/test/com/google/common/base/TestExceptions.java b/guava-tests/test/com/google/common/base/TestExceptions.java index 35152703f673..17444e0afeca 100644 --- a/guava-tests/test/com/google/common/base/TestExceptions.java +++ b/guava-tests/test/com/google/common/base/TestExceptions.java @@ -18,9 +18,11 @@ import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; /** Exception classes for use in tests. */ @GwtCompatible +@NullUnmarked final class TestExceptions { static class SomeError extends Error {} diff --git a/guava-tests/test/com/google/common/base/ThrowablesTest.java b/guava-tests/test/com/google/common/base/ThrowablesTest.java index 6e00c08fb6a8..4ae5ad110da3 100644 --- a/guava-tests/test/com/google/common/base/ThrowablesTest.java +++ b/guava-tests/test/com/google/common/base/ThrowablesTest.java @@ -46,6 +46,7 @@ import com.google.common.testing.NullPointerTester; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Throwables}. @@ -54,6 +55,7 @@ */ @GwtCompatible(emulated = true) @SuppressWarnings("deprecation") // tests of numerous deprecated methods +@NullUnmarked public class ThrowablesTest extends TestCase { // We're testing that the method is in fact equivalent to throwing the exception directly. @SuppressWarnings("ThrowIfUncheckedKnownUnchecked") diff --git a/guava-tests/test/com/google/common/base/ToStringHelperTest.java b/guava-tests/test/com/google/common/base/ToStringHelperTest.java index 21e53d90814f..a66e229b6dae 100644 --- a/guava-tests/test/com/google/common/base/ToStringHelperTest.java +++ b/guava-tests/test/com/google/common/base/ToStringHelperTest.java @@ -31,6 +31,7 @@ import java.util.OptionalInt; import java.util.OptionalLong; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link MoreObjects#toStringHelper(Object)}. @@ -38,6 +39,7 @@ * @author Jason Lee */ @GwtCompatible +@NullUnmarked public class ToStringHelperTest extends TestCase { @GwtIncompatible // Class names are obfuscated in GWT diff --git a/guava-tests/test/com/google/common/base/UnannotatedJavaClass.java b/guava-tests/test/com/google/common/base/UnannotatedJavaClass.java index 521035c61752..0d7cc9cae8e8 100644 --- a/guava-tests/test/com/google/common/base/UnannotatedJavaClass.java +++ b/guava-tests/test/com/google/common/base/UnannotatedJavaClass.java @@ -16,7 +16,10 @@ package com.google.common.base; +import org.jspecify.annotations.NullUnmarked; + /** Class containing an unannotated Java method for use from {@code OptionalExtensionsTest}. */ +@NullUnmarked final class UnannotatedJavaClass { static Object getNull() { return null; diff --git a/guava-tests/test/com/google/common/base/Utf8Test.java b/guava-tests/test/com/google/common/base/Utf8Test.java index b4dfcb5c1991..72da351b5e24 100644 --- a/guava-tests/test/com/google/common/base/Utf8Test.java +++ b/guava-tests/test/com/google/common/base/Utf8Test.java @@ -32,6 +32,7 @@ import java.util.HashMap; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Utf8}. @@ -41,6 +42,7 @@ * @author Clément Roux */ @GwtCompatible(emulated = true) +@NullUnmarked public class Utf8Test extends TestCase { private static final ImmutableList ILL_FORMED_STRINGS; diff --git a/guava-tests/test/com/google/common/base/VerifyTest.java b/guava-tests/test/com/google/common/base/VerifyTest.java index 6257c5eb7faa..6a1e8a0a0785 100644 --- a/guava-tests/test/com/google/common/base/VerifyTest.java +++ b/guava-tests/test/com/google/common/base/VerifyTest.java @@ -24,9 +24,11 @@ import com.google.common.annotations.J2ktIncompatible; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit test for {@link com.google.common.base.Verify}. */ @GwtCompatible(emulated = true) +@NullUnmarked public class VerifyTest extends TestCase { public void testVerify_simple_success() { verify(true); diff --git a/guava-tests/test/com/google/common/cache/AbstractCacheTest.java b/guava-tests/test/com/google/common/cache/AbstractCacheTest.java index 7793a4ff365d..856164a6c331 100644 --- a/guava-tests/test/com/google/common/cache/AbstractCacheTest.java +++ b/guava-tests/test/com/google/common/cache/AbstractCacheTest.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -33,6 +34,7 @@ * * @author Charles Fry */ +@NullUnmarked public class AbstractCacheTest extends TestCase { public void testGetIfPresent() { diff --git a/guava-tests/test/com/google/common/cache/AbstractLoadingCacheTest.java b/guava-tests/test/com/google/common/cache/AbstractLoadingCacheTest.java index c029ff3d00a2..2cb08ef6dc03 100644 --- a/guava-tests/test/com/google/common/cache/AbstractLoadingCacheTest.java +++ b/guava-tests/test/com/google/common/cache/AbstractLoadingCacheTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -31,6 +32,7 @@ * * @author Charles Fry */ +@NullUnmarked public class AbstractLoadingCacheTest extends TestCase { public void testGetUnchecked_checked() { diff --git a/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java b/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java index 3caca22bb180..695298f6ebc8 100644 --- a/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java +++ b/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -34,6 +35,7 @@ * * @author mike nonemacher */ +@NullUnmarked class CacheBuilderFactory { // Default values contain only 'null', which means don't call the CacheBuilder method (just give // the CacheBuilder default). diff --git a/guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java b/guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java index 5cd7bcfc4c35..bdefbbb3000f 100644 --- a/guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java +++ b/guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java @@ -32,6 +32,7 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test suite for {@link CacheBuilder}. TODO(cpovirk): merge into CacheBuilderTest? @@ -39,6 +40,7 @@ * @author Jon Donovan */ @GwtCompatible +@NullUnmarked public class CacheBuilderGwtTest extends TestCase { private FakeTicker fakeTicker; diff --git a/guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java b/guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java index 57d7b4aa6bb0..670275b08252 100644 --- a/guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java +++ b/guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java @@ -28,6 +28,7 @@ import com.google.common.cache.LocalCache.Strength; import com.google.common.testing.EqualsTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests CacheBuilderSpec. TODO(user): tests of a few invalid input conditions, boundary @@ -35,6 +36,7 @@ * * @author Adam Winer */ +@NullUnmarked public class CacheBuilderSpecTest extends TestCase { public void testParse_empty() { CacheBuilderSpec spec = parse(""); diff --git a/guava-tests/test/com/google/common/cache/CacheBuilderTest.java b/guava-tests/test/com/google/common/cache/CacheBuilderTest.java index cf19b59733fb..dc9721316ebc 100644 --- a/guava-tests/test/com/google/common/cache/CacheBuilderTest.java +++ b/guava-tests/test/com/google/common/cache/CacheBuilderTest.java @@ -47,11 +47,13 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for CacheBuilder. */ @GwtCompatible(emulated = true) // We are intentionally testing the TimeUnit overloads, too. @SuppressWarnings("LongTimeUnit_ExpireAfterWrite_Seconds") +@NullUnmarked public class CacheBuilderTest extends TestCase { public void testNewBuilder() { diff --git a/guava-tests/test/com/google/common/cache/CacheEvictionTest.java b/guava-tests/test/com/google/common/cache/CacheEvictionTest.java index dce8c88d0389..1f0d7b41f650 100644 --- a/guava-tests/test/com/google/common/cache/CacheEvictionTest.java +++ b/guava-tests/test/com/google/common/cache/CacheEvictionTest.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests relating to cache eviction: what does and doesn't count toward maximumSize, what happens @@ -36,6 +37,7 @@ * * @author mike nonemacher */ +@NullUnmarked public class CacheEvictionTest extends TestCase { static final int MAX_SIZE = 100; diff --git a/guava-tests/test/com/google/common/cache/CacheExpirationTest.java b/guava-tests/test/com/google/common/cache/CacheExpirationTest.java index 4d3924de2f0e..86d3e4af648c 100644 --- a/guava-tests/test/com/google/common/cache/CacheExpirationTest.java +++ b/guava-tests/test/com/google/common/cache/CacheExpirationTest.java @@ -32,6 +32,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests relating to cache expiration: make sure entries expire at the right times, make sure @@ -40,6 +41,7 @@ * @author mike nonemacher */ @SuppressWarnings("deprecation") // tests of deprecated method +@NullUnmarked public class CacheExpirationTest extends TestCase { private static final long EXPIRING_TIME = 1000; diff --git a/guava-tests/test/com/google/common/cache/CacheLoaderTest.java b/guava-tests/test/com/google/common/cache/CacheLoaderTest.java index 5ecedcf5a98b..9c8cd2819658 100644 --- a/guava-tests/test/com/google/common/cache/CacheLoaderTest.java +++ b/guava-tests/test/com/google/common/cache/CacheLoaderTest.java @@ -28,12 +28,14 @@ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link CacheLoader}. * * @author Charles Fry */ +@NullUnmarked public class CacheLoaderTest extends TestCase { private static class QueuingExecutor implements Executor { diff --git a/guava-tests/test/com/google/common/cache/CacheLoadingTest.java b/guava-tests/test/com/google/common/cache/CacheLoadingTest.java index 6344109dba01..cd37da76bfba 100644 --- a/guava-tests/test/com/google/common/cache/CacheLoadingTest.java +++ b/guava-tests/test/com/google/common/cache/CacheLoadingTest.java @@ -55,12 +55,14 @@ import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.logging.LogRecord; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests relating to cache loading: concurrent loading, exceptions during loading, etc. * * @author mike nonemacher */ +@NullUnmarked public class CacheLoadingTest extends TestCase { TestLogHandler logHandler; diff --git a/guava-tests/test/com/google/common/cache/CacheManualTest.java b/guava-tests/test/com/google/common/cache/CacheManualTest.java index abe0b15eb6cc..a2cf24dcef28 100644 --- a/guava-tests/test/com/google/common/cache/CacheManualTest.java +++ b/guava-tests/test/com/google/common/cache/CacheManualTest.java @@ -19,8 +19,12 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author Charles Fry */ +/** + * @author Charles Fry + */ +@NullUnmarked public class CacheManualTest extends TestCase { public void testGetIfPresent() { diff --git a/guava-tests/test/com/google/common/cache/CacheReferencesTest.java b/guava-tests/test/com/google/common/cache/CacheReferencesTest.java index 63af4b59c9f2..a11d14a090fd 100644 --- a/guava-tests/test/com/google/common/cache/CacheReferencesTest.java +++ b/guava-tests/test/com/google/common/cache/CacheReferencesTest.java @@ -26,6 +26,7 @@ import com.google.common.collect.Iterables; import java.lang.ref.WeakReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests of basic {@link LoadingCache} operations with all possible combinations of key & value @@ -33,6 +34,7 @@ * * @author mike nonemacher */ +@NullUnmarked public class CacheReferencesTest extends TestCase { private static final CacheLoader KEY_TO_STRING_LOADER = diff --git a/guava-tests/test/com/google/common/cache/CacheRefreshTest.java b/guava-tests/test/com/google/common/cache/CacheRefreshTest.java index 823ad360f8b9..6a7948c470dc 100644 --- a/guava-tests/test/com/google/common/cache/CacheRefreshTest.java +++ b/guava-tests/test/com/google/common/cache/CacheRefreshTest.java @@ -20,12 +20,14 @@ import com.google.common.cache.TestingCacheLoaders.IncrementingLoader; import com.google.common.testing.FakeTicker; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests relating to automatic cache refreshing. * * @author Charles Fry */ +@NullUnmarked public class CacheRefreshTest extends TestCase { public void testAutoRefresh() { FakeTicker ticker = new FakeTicker(); diff --git a/guava-tests/test/com/google/common/cache/CacheStatsTest.java b/guava-tests/test/com/google/common/cache/CacheStatsTest.java index 73efa0e1f8f2..cfd174aea242 100644 --- a/guava-tests/test/com/google/common/cache/CacheStatsTest.java +++ b/guava-tests/test/com/google/common/cache/CacheStatsTest.java @@ -19,12 +19,14 @@ import static com.google.common.truth.Truth.assertThat; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link CacheStats}. * * @author Charles Fry */ +@NullUnmarked public class CacheStatsTest extends TestCase { public void testEmpty() { diff --git a/guava-tests/test/com/google/common/cache/CacheTesting.java b/guava-tests/test/com/google/common/cache/CacheTesting.java index bf792e70e042..31a126524870 100644 --- a/guava-tests/test/com/google/common/cache/CacheTesting.java +++ b/guava-tests/test/com/google/common/cache/CacheTesting.java @@ -45,6 +45,7 @@ import java.util.Set; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicReferenceArray; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -53,6 +54,7 @@ * @author mike nonemacher */ @SuppressWarnings("GuardedBy") // TODO(b/35466881): Fix or suppress. +@NullUnmarked class CacheTesting { /** diff --git a/guava-tests/test/com/google/common/cache/EmptyCachesTest.java b/guava-tests/test/com/google/common/cache/EmptyCachesTest.java index ccdcb955d572..f93568bc29a5 100644 --- a/guava-tests/test/com/google/common/cache/EmptyCachesTest.java +++ b/guava-tests/test/com/google/common/cache/EmptyCachesTest.java @@ -33,6 +33,7 @@ import java.util.Set; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * {@link LoadingCache} tests that deal with empty caches. @@ -40,6 +41,7 @@ * @author mike nonemacher */ +@NullUnmarked public class EmptyCachesTest extends TestCase { public void testEmpty() { diff --git a/guava-tests/test/com/google/common/cache/ForwardingCacheTest.java b/guava-tests/test/com/google/common/cache/ForwardingCacheTest.java index 639a208bd5cd..76de76c3707c 100644 --- a/guava-tests/test/com/google/common/cache/ForwardingCacheTest.java +++ b/guava-tests/test/com/google/common/cache/ForwardingCacheTest.java @@ -24,12 +24,14 @@ import com.google.common.collect.ImmutableMap; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingCache}. * * @author Charles Fry */ +@NullUnmarked public class ForwardingCacheTest extends TestCase { private Cache forward; private Cache mock; diff --git a/guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java b/guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java index fe41612132b1..cdef91afe699 100644 --- a/guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java +++ b/guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java @@ -24,12 +24,14 @@ import com.google.common.collect.ImmutableMap; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingLoadingCache}. * * @author Charles Fry */ +@NullUnmarked public class ForwardingLoadingCacheTest extends TestCase { private LoadingCache forward; private LoadingCache mock; diff --git a/guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java b/guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java index 136a2a4f4a73..a080c7cfcbae 100644 --- a/guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java +++ b/guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java @@ -29,8 +29,10 @@ import java.util.function.IntConsumer; import java.util.stream.IntStream; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Test Java8 map.compute in concurrent cache context. */ +@NullUnmarked public class LocalCacheMapComputeTest extends TestCase { final int count = 10000; final String delimiter = "-"; diff --git a/guava-tests/test/com/google/common/cache/LocalCacheTest.java b/guava-tests/test/com/google/common/cache/LocalCacheTest.java index d90115ab421b..12264d176d0a 100644 --- a/guava-tests/test/com/google/common/cache/LocalCacheTest.java +++ b/guava-tests/test/com/google/common/cache/LocalCacheTest.java @@ -86,10 +86,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; -/** @author Charles Fry */ +/** + * @author Charles Fry + */ @SuppressWarnings("GuardedBy") // TODO(b/35466881): Fix or suppress. +@NullUnmarked public class LocalCacheTest extends TestCase { private static class TestStringCacheGenerator extends TestStringMapGenerator { private final CacheBuilder builder; diff --git a/guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java b/guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java index 318bebc2f53c..8111b2e6ad00 100644 --- a/guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java +++ b/guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java @@ -34,8 +34,12 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author Charles Fry */ +/** + * @author Charles Fry + */ +@NullUnmarked public class LocalLoadingCacheTest extends TestCase { private static LocalLoadingCache makeCache( diff --git a/guava-tests/test/com/google/common/cache/LongAdderTest.java b/guava-tests/test/com/google/common/cache/LongAdderTest.java index 876f90748880..8a5bed0bb235 100644 --- a/guava-tests/test/com/google/common/cache/LongAdderTest.java +++ b/guava-tests/test/com/google/common/cache/LongAdderTest.java @@ -17,8 +17,10 @@ import static com.google.common.truth.Truth.assertThat; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link LongAdder}. */ +@NullUnmarked public class LongAdderTest extends TestCase { /** diff --git a/guava-tests/test/com/google/common/cache/NullCacheTest.java b/guava-tests/test/com/google/common/cache/NullCacheTest.java index 6fa8f7b13ce4..23ccbe9ff0eb 100644 --- a/guava-tests/test/com/google/common/cache/NullCacheTest.java +++ b/guava-tests/test/com/google/common/cache/NullCacheTest.java @@ -26,12 +26,14 @@ import com.google.common.cache.TestingRemovalListeners.QueuingRemovalListener; import com.google.common.util.concurrent.UncheckedExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * {@link LoadingCache} tests for caches with a maximum size of zero. * * @author mike nonemacher */ +@NullUnmarked public class NullCacheTest extends TestCase { QueuingRemovalListener listener; diff --git a/guava-tests/test/com/google/common/cache/PackageSanityTests.java b/guava-tests/test/com/google/common/cache/PackageSanityTests.java index 64cdc13375f2..e4909906e5d8 100644 --- a/guava-tests/test/com/google/common/cache/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/cache/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.cache; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -24,6 +25,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { setDefault( diff --git a/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java b/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java index 8ebeeb16a540..81eea6c63ff3 100644 --- a/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java +++ b/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java @@ -38,6 +38,7 @@ import java.util.Map.Entry; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * {@link LoadingCache} tests that deal with caches that actually contain some key-value mappings. @@ -45,6 +46,7 @@ * @author mike nonemacher */ +@NullUnmarked public class PopulatedCachesTest extends TestCase { // we use integers as keys; make sure the range covers some values that ARE cached by // Integer.valueOf(int), and some that are not cached. (127 is the highest cached value.) diff --git a/guava-tests/test/com/google/common/cache/RemovalNotificationTest.java b/guava-tests/test/com/google/common/cache/RemovalNotificationTest.java index 9cd587db7c82..12d6e0e0cfcd 100644 --- a/guava-tests/test/com/google/common/cache/RemovalNotificationTest.java +++ b/guava-tests/test/com/google/common/cache/RemovalNotificationTest.java @@ -18,12 +18,14 @@ import com.google.common.testing.EqualsTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests of {@link RemovalNotification}. * * @author Ben Yu */ +@NullUnmarked public class RemovalNotificationTest extends TestCase { public void testEquals() { diff --git a/guava-tests/test/com/google/common/cache/TestingCacheLoaders.java b/guava-tests/test/com/google/common/cache/TestingCacheLoaders.java index cae57e532002..239c71fceaa6 100644 --- a/guava-tests/test/com/google/common/cache/TestingCacheLoaders.java +++ b/guava-tests/test/com/google/common/cache/TestingCacheLoaders.java @@ -23,6 +23,7 @@ import com.google.common.util.concurrent.ListenableFuture; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -31,6 +32,7 @@ * @author mike nonemacher */ @GwtCompatible(emulated = true) +@NullUnmarked class TestingCacheLoaders { /** diff --git a/guava-tests/test/com/google/common/cache/TestingRemovalListeners.java b/guava-tests/test/com/google/common/cache/TestingRemovalListeners.java index 698467fceb07..4aab99e1aaec 100644 --- a/guava-tests/test/com/google/common/cache/TestingRemovalListeners.java +++ b/guava-tests/test/com/google/common/cache/TestingRemovalListeners.java @@ -18,6 +18,7 @@ import com.google.common.annotations.GwtIncompatible; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; +import org.jspecify.annotations.NullUnmarked; /** * Utility {@link RemovalListener} implementations intended for use in testing. @@ -25,6 +26,7 @@ * @author mike nonemacher */ @GwtCompatible(emulated = true) +@NullUnmarked class TestingRemovalListeners { /** Returns a new no-op {@code RemovalListener}. */ diff --git a/guava-tests/test/com/google/common/cache/TestingWeighers.java b/guava-tests/test/com/google/common/cache/TestingWeighers.java index b09fdf03e78a..db508aae5749 100644 --- a/guava-tests/test/com/google/common/cache/TestingWeighers.java +++ b/guava-tests/test/com/google/common/cache/TestingWeighers.java @@ -14,11 +14,14 @@ package com.google.common.cache; +import org.jspecify.annotations.NullUnmarked; + /** * Utility {@link Weigher} implementations intended for use in testing. * * @author Charles Fry */ +@NullUnmarked public class TestingWeighers { /** Returns a {@link Weigher} that returns the given {@code constant} for every request. */ diff --git a/guava-tests/test/com/google/common/collect/AbstractBiMapTest.java b/guava-tests/test/com/google/common/collect/AbstractBiMapTest.java index e430f0e523b9..b0e4055ab9cb 100644 --- a/guava-tests/test/com/google/common/collect/AbstractBiMapTest.java +++ b/guava-tests/test/com/google/common/collect/AbstractBiMapTest.java @@ -18,12 +18,14 @@ import java.util.Iterator; import java.util.Map.Entry; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code AbstractBiMap}. * * @author Mike Bostock */ +@NullUnmarked public class AbstractBiMapTest extends TestCase { // The next two tests verify that map entries are not accessed after they're diff --git a/guava-tests/test/com/google/common/collect/AbstractHashFloodingTest.java b/guava-tests/test/com/google/common/collect/AbstractHashFloodingTest.java index cf2d666ad29d..cc726dbe0d2e 100644 --- a/guava-tests/test/com/google/common/collect/AbstractHashFloodingTest.java +++ b/guava-tests/test/com/google/common/collect/AbstractHashFloodingTest.java @@ -31,6 +31,7 @@ import java.util.function.IntToDoubleFunction; import java.util.function.Supplier; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -38,6 +39,7 @@ * performance. */ @GwtIncompatible +@NullUnmarked public abstract class AbstractHashFloodingTest extends TestCase { private final List> constructions; private final IntToDoubleFunction constructionAsymptotics; diff --git a/guava-tests/test/com/google/common/collect/AbstractImmutableBiMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/AbstractImmutableBiMapMapInterfaceTest.java index 1588bf61321a..5a4934ebcc84 100644 --- a/guava-tests/test/com/google/common/collect/AbstractImmutableBiMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/AbstractImmutableBiMapMapInterfaceTest.java @@ -23,8 +23,10 @@ import com.google.common.collect.testing.MapInterfaceTest; import java.util.Map; import java.util.Map.Entry; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked abstract class AbstractImmutableBiMapMapInterfaceTest extends MapInterfaceTest { AbstractImmutableBiMapMapInterfaceTest() { super(false, false, false, false, false); diff --git a/guava-tests/test/com/google/common/collect/AbstractImmutableMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/AbstractImmutableMapMapInterfaceTest.java index b31675647ebe..29c57ec3cc25 100644 --- a/guava-tests/test/com/google/common/collect/AbstractImmutableMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/AbstractImmutableMapMapInterfaceTest.java @@ -24,8 +24,10 @@ import com.google.common.collect.testing.MinimalSet; import java.util.Map; import java.util.Map.Entry; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked abstract class AbstractImmutableMapMapInterfaceTest extends MapInterfaceTest { AbstractImmutableMapMapInterfaceTest() { super(false, false, false, false, false); diff --git a/guava-tests/test/com/google/common/collect/AbstractImmutableSortedMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/AbstractImmutableSortedMapMapInterfaceTest.java index 612768d329e9..73ac6f385761 100644 --- a/guava-tests/test/com/google/common/collect/AbstractImmutableSortedMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/AbstractImmutableSortedMapMapInterfaceTest.java @@ -24,8 +24,10 @@ import java.util.Map; import java.util.Map.Entry; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public abstract class AbstractImmutableSortedMapMapInterfaceTest extends SortedMapInterfaceTest { public AbstractImmutableSortedMapMapInterfaceTest() { diff --git a/guava-tests/test/com/google/common/collect/AbstractRangeSetTest.java b/guava-tests/test/com/google/common/collect/AbstractRangeSetTest.java index 9319bb5a8ae1..90b8a4792aad 100644 --- a/guava-tests/test/com/google/common/collect/AbstractRangeSetTest.java +++ b/guava-tests/test/com/google/common/collect/AbstractRangeSetTest.java @@ -19,6 +19,7 @@ import java.util.List; import java.util.NoSuchElementException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Base class for {@link RangeSet} tests. @@ -26,6 +27,7 @@ * @author Louis Wasserman */ @GwtIncompatible // TreeRangeSet +@NullUnmarked public abstract class AbstractRangeSetTest extends TestCase { public static void testInvariants(RangeSet rangeSet) { testInvariantsInternal(rangeSet); diff --git a/guava-tests/test/com/google/common/collect/ArrayTableColumnMapTest.java b/guava-tests/test/com/google/common/collect/ArrayTableColumnMapTest.java index 8adf4e4e165d..f73153084816 100644 --- a/guava-tests/test/com/google/common/collect/ArrayTableColumnMapTest.java +++ b/guava-tests/test/com/google/common/collect/ArrayTableColumnMapTest.java @@ -21,8 +21,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.TableCollectionTest.ColumnMapTests; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // TODO(hhchan): ArrayTable +@NullUnmarked public class ArrayTableColumnMapTest extends ColumnMapTests { public ArrayTableColumnMapTest() { super(true, false, false, false); diff --git a/guava-tests/test/com/google/common/collect/ArrayTableColumnTest.java b/guava-tests/test/com/google/common/collect/ArrayTableColumnTest.java index 208f70085061..902e5ea7b00f 100644 --- a/guava-tests/test/com/google/common/collect/ArrayTableColumnTest.java +++ b/guava-tests/test/com/google/common/collect/ArrayTableColumnTest.java @@ -21,8 +21,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.TableCollectionTest.ColumnTests; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // TODO(hhchan): ArrayTable +@NullUnmarked public class ArrayTableColumnTest extends ColumnTests { public ArrayTableColumnTest() { super(true, true, false, false, false); diff --git a/guava-tests/test/com/google/common/collect/ArrayTableRowMapTest.java b/guava-tests/test/com/google/common/collect/ArrayTableRowMapTest.java index 8e1479c86377..082a43596f9d 100644 --- a/guava-tests/test/com/google/common/collect/ArrayTableRowMapTest.java +++ b/guava-tests/test/com/google/common/collect/ArrayTableRowMapTest.java @@ -21,8 +21,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.TableCollectionTest.RowMapTests; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // TODO(hhchan): ArrayTable +@NullUnmarked public class ArrayTableRowMapTest extends RowMapTests { public ArrayTableRowMapTest() { super(true, false, false, false); diff --git a/guava-tests/test/com/google/common/collect/ArrayTableRowTest.java b/guava-tests/test/com/google/common/collect/ArrayTableRowTest.java index ed83526c658f..9d8370717961 100644 --- a/guava-tests/test/com/google/common/collect/ArrayTableRowTest.java +++ b/guava-tests/test/com/google/common/collect/ArrayTableRowTest.java @@ -21,8 +21,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.TableCollectionTest.RowTests; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // TODO(hhchan): ArrayTable +@NullUnmarked public class ArrayTableRowTest extends RowTests { public ArrayTableRowTest() { super(true, true, false, false, false); diff --git a/guava-tests/test/com/google/common/collect/Base.java b/guava-tests/test/com/google/common/collect/Base.java index b68bd7f651fa..d39cd87c57a4 100644 --- a/guava-tests/test/com/google/common/collect/Base.java +++ b/guava-tests/test/com/google/common/collect/Base.java @@ -18,10 +18,12 @@ import com.google.common.annotations.GwtCompatible; import java.io.Serializable; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** Simple base class to verify that we handle generics correctly. */ @GwtCompatible +@NullUnmarked class Base implements Comparable, Serializable { private final String s; diff --git a/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java b/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java index d0475fc47d65..45015d01e6ab 100644 --- a/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java +++ b/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java @@ -33,12 +33,14 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentSkipListMap; +import org.jspecify.annotations.NullUnmarked; /** * Helper classes for various benchmarks. * * @author Christopher Swenson */ +@NullUnmarked final class BenchmarkHelpers { /** So far, this is the best way to test various implementations of {@link Set} subclasses. */ public interface CollectionsImplEnum { diff --git a/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java b/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java index 839b0b505d88..86624974fd41 100644 --- a/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java +++ b/guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -28,6 +29,7 @@ * * @author Nicholaus Shupe */ +@NullUnmarked class CollectionBenchmarkSampleData { private final boolean isUserTypeFast; private final SpecialRandom random; diff --git a/guava-tests/test/com/google/common/collect/Collections2FilterArrayListTest.java b/guava-tests/test/com/google/common/collect/Collections2FilterArrayListTest.java index 8a783ec6e823..4c3ef4b26098 100644 --- a/guava-tests/test/com/google/common/collect/Collections2FilterArrayListTest.java +++ b/guava-tests/test/com/google/common/collect/Collections2FilterArrayListTest.java @@ -19,7 +19,9 @@ import com.google.common.base.Predicate; import com.google.common.collect.FilteredCollectionsTestUtil.AbstractFilteredCollectionTest; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class Collections2FilterArrayListTest extends AbstractFilteredCollectionTest> { @Override diff --git a/guava-tests/test/com/google/common/collect/CompactHashMapFloodingTest.java b/guava-tests/test/com/google/common/collect/CompactHashMapFloodingTest.java index e09759d914ae..14d8e3a8809f 100644 --- a/guava-tests/test/com/google/common/collect/CompactHashMapFloodingTest.java +++ b/guava-tests/test/com/google/common/collect/CompactHashMapFloodingTest.java @@ -20,8 +20,10 @@ import com.google.common.annotations.GwtIncompatible; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible +@NullUnmarked public class CompactHashMapFloodingTest extends AbstractHashFloodingTest> { public CompactHashMapFloodingTest() { super( diff --git a/guava-tests/test/com/google/common/collect/CompactHashMapTest.java b/guava-tests/test/com/google/common/collect/CompactHashMapTest.java index 463dfe8bcae0..bef30ca150b5 100644 --- a/guava-tests/test/com/google/common/collect/CompactHashMapTest.java +++ b/guava-tests/test/com/google/common/collect/CompactHashMapTest.java @@ -30,12 +30,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code CompactHashMap}. * * @author Louis Wasserman */ +@NullUnmarked public class CompactHashMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/guava-tests/test/com/google/common/collect/CompactHashSetFloodingTest.java b/guava-tests/test/com/google/common/collect/CompactHashSetFloodingTest.java index 7e34201a2cfa..ea741ce38d0e 100644 --- a/guava-tests/test/com/google/common/collect/CompactHashSetFloodingTest.java +++ b/guava-tests/test/com/google/common/collect/CompactHashSetFloodingTest.java @@ -20,8 +20,10 @@ import com.google.common.annotations.GwtIncompatible; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible +@NullUnmarked public class CompactHashSetFloodingTest extends AbstractHashFloodingTest> { public CompactHashSetFloodingTest() { super( diff --git a/guava-tests/test/com/google/common/collect/CompactHashSetTest.java b/guava-tests/test/com/google/common/collect/CompactHashSetTest.java index d2366b099eea..39fa5bbdef94 100644 --- a/guava-tests/test/com/google/common/collect/CompactHashSetTest.java +++ b/guava-tests/test/com/google/common/collect/CompactHashSetTest.java @@ -33,6 +33,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for CompactHashSet. @@ -40,6 +41,7 @@ * @author Dimitris Andreou */ @GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array +@NullUnmarked public class CompactHashSetTest extends TestCase { public static Test suite() { List> allFeatures = diff --git a/guava-tests/test/com/google/common/collect/CompactLinkedHashMapFloodingTest.java b/guava-tests/test/com/google/common/collect/CompactLinkedHashMapFloodingTest.java index 68f1b45fb9ad..fe485ed4bb1a 100644 --- a/guava-tests/test/com/google/common/collect/CompactLinkedHashMapFloodingTest.java +++ b/guava-tests/test/com/google/common/collect/CompactLinkedHashMapFloodingTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtIncompatible; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible +@NullUnmarked public class CompactLinkedHashMapFloodingTest extends AbstractHashFloodingTest> { public CompactLinkedHashMapFloodingTest() { diff --git a/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java b/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java index 319d0a2a1512..bd9e8b592dc0 100644 --- a/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java +++ b/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java @@ -29,12 +29,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code CompactLinkedHashMap}. * * @author Louis Wasserman */ +@NullUnmarked public class CompactLinkedHashMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/guava-tests/test/com/google/common/collect/CompactLinkedHashSetFloodingTest.java b/guava-tests/test/com/google/common/collect/CompactLinkedHashSetFloodingTest.java index 402bf19bdfcc..23a6ae7b9b30 100644 --- a/guava-tests/test/com/google/common/collect/CompactLinkedHashSetFloodingTest.java +++ b/guava-tests/test/com/google/common/collect/CompactLinkedHashSetFloodingTest.java @@ -20,8 +20,10 @@ import com.google.common.annotations.GwtIncompatible; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible +@NullUnmarked public class CompactLinkedHashSetFloodingTest extends AbstractHashFloodingTest> { public CompactLinkedHashSetFloodingTest() { super( diff --git a/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java b/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java index d9c59a8cb8d1..5e3e8ed6f71c 100644 --- a/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java +++ b/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java @@ -33,6 +33,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for CompactLinkedHashSet. @@ -40,6 +41,7 @@ * @author Dimitris Andreou */ @GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array +@NullUnmarked public class CompactLinkedHashSetTest extends TestCase { public static Test suite() { List> allFeatures = diff --git a/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java b/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java index 425808658c06..aa7836dfe39f 100644 --- a/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java +++ b/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java @@ -34,6 +34,7 @@ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Basher test for {@link ConcurrentHashMultiset}: start a bunch of threads, have each of them do @@ -44,6 +45,7 @@ * @author mike nonemacher */ +@NullUnmarked public class ConcurrentHashMultisetBasherTest extends TestCase { public void testAddAndRemove_concurrentHashMap() throws Exception { diff --git a/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java b/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java index f7ffbc92f2f9..d211a0bed2cd 100644 --- a/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java +++ b/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java @@ -40,6 +40,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test case for {@link ConcurrentHashMultiset}. @@ -47,6 +48,7 @@ * @author Cliff L. Biffle * @author mike nonemacher */ +@NullUnmarked public class ConcurrentHashMultisetTest extends TestCase { public static Test suite() { diff --git a/guava-tests/test/com/google/common/collect/ContiguousSetTest.java b/guava-tests/test/com/google/common/collect/ContiguousSetTest.java index abca6e75e499..bf53d89a0dd5 100644 --- a/guava-tests/test/com/google/common/collect/ContiguousSetTest.java +++ b/guava-tests/test/com/google/common/collect/ContiguousSetTest.java @@ -45,11 +45,13 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * @author Gregory Kick */ @GwtCompatible(emulated = true) +@NullUnmarked public class ContiguousSetTest extends TestCase { private static final DiscreteDomain NOT_EQUAL_TO_INTEGERS = new DiscreteDomain() { diff --git a/guava-tests/test/com/google/common/collect/Derived.java b/guava-tests/test/com/google/common/collect/Derived.java index 995c42be8136..9d3c0a2a0a71 100644 --- a/guava-tests/test/com/google/common/collect/Derived.java +++ b/guava-tests/test/com/google/common/collect/Derived.java @@ -17,9 +17,11 @@ package com.google.common.collect; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; /** Simple derived class to verify that we handle generics correctly. */ @GwtCompatible +@NullUnmarked class Derived extends Base { public Derived(String s) { super(s); diff --git a/guava-tests/test/com/google/common/collect/DiscreteDomainTest.java b/guava-tests/test/com/google/common/collect/DiscreteDomainTest.java index bd7fa8b646db..c11828ad39dc 100644 --- a/guava-tests/test/com/google/common/collect/DiscreteDomainTest.java +++ b/guava-tests/test/com/google/common/collect/DiscreteDomainTest.java @@ -22,6 +22,7 @@ import com.google.common.annotations.GwtIncompatible; import java.math.BigInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link DiscreteDomain}. @@ -29,6 +30,7 @@ * @author Chris Povirk */ @GwtIncompatible // SerializableTester +@NullUnmarked public class DiscreteDomainTest extends TestCase { public void testSerialization() { reserializeAndAssert(DiscreteDomain.integers()); diff --git a/guava-tests/test/com/google/common/collect/EnumHashBiMapTest.java b/guava-tests/test/com/google/common/collect/EnumHashBiMapTest.java index 91d454dbdd8f..b0e0bab7e214 100644 --- a/guava-tests/test/com/google/common/collect/EnumHashBiMapTest.java +++ b/guava-tests/test/com/google/common/collect/EnumHashBiMapTest.java @@ -38,6 +38,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code EnumHashBiMap}. @@ -46,6 +47,7 @@ */ @J2ktIncompatible // EnumHashBiMap @GwtCompatible(emulated = true) +@NullUnmarked public class EnumHashBiMapTest extends TestCase { private enum Currency { DOLLAR, diff --git a/guava-tests/test/com/google/common/collect/EnumMultisetTest.java b/guava-tests/test/com/google/common/collect/EnumMultisetTest.java index 4a3fc9d07e4e..3d66d0f58836 100644 --- a/guava-tests/test/com/google/common/collect/EnumMultisetTest.java +++ b/guava-tests/test/com/google/common/collect/EnumMultisetTest.java @@ -38,6 +38,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for an {@link EnumMultiset}. @@ -46,6 +47,7 @@ */ @GwtCompatible(emulated = true) @J2ktIncompatible // EnumMultiset +@NullUnmarked public class EnumMultisetTest extends TestCase { @J2ktIncompatible diff --git a/guava-tests/test/com/google/common/collect/FauxveridesTest.java b/guava-tests/test/com/google/common/collect/FauxveridesTest.java index 0e1ec2b6f2df..61db37fec916 100644 --- a/guava-tests/test/com/google/common/collect/FauxveridesTest.java +++ b/guava-tests/test/com/google/common/collect/FauxveridesTest.java @@ -35,6 +35,7 @@ import java.util.Map; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -44,6 +45,7 @@ * * @author Chris Povirk */ +@NullUnmarked public class FauxveridesTest extends TestCase { public void testImmutableBiMap() { doHasAllFauxveridesTest(ImmutableBiMap.class, ImmutableMap.class); diff --git a/guava-tests/test/com/google/common/collect/FilteredCollectionsTestUtil.java b/guava-tests/test/com/google/common/collect/FilteredCollectionsTestUtil.java index 095f0b1d2a24..7fcd814d0c93 100644 --- a/guava-tests/test/com/google/common/collect/FilteredCollectionsTestUtil.java +++ b/guava-tests/test/com/google/common/collect/FilteredCollectionsTestUtil.java @@ -33,6 +33,7 @@ import java.util.Set; import java.util.SortedSet; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Class that contains nested abstract tests for filtered collection views, along with their @@ -44,6 +45,7 @@ * TODO(cpovirk): Should all the tests for filtered collections run under GWT, too? Currently, they * don't. */ +@NullUnmarked public final class FilteredCollectionsTestUtil { private static final Predicate EVEN = new Predicate() { diff --git a/guava-tests/test/com/google/common/collect/FilteredMultimapTest.java b/guava-tests/test/com/google/common/collect/FilteredMultimapTest.java index 3f0a2ea78a92..01010c52eacf 100644 --- a/guava-tests/test/com/google/common/collect/FilteredMultimapTest.java +++ b/guava-tests/test/com/google/common/collect/FilteredMultimapTest.java @@ -24,6 +24,7 @@ import com.google.common.base.Predicate; import java.util.Map.Entry; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Multimaps} filtering methods. @@ -31,6 +32,7 @@ * @author Jared Levy */ @GwtIncompatible // nottested +@NullUnmarked public class FilteredMultimapTest extends TestCase { private static final Predicate> ENTRY_PREDICATE = diff --git a/guava-tests/test/com/google/common/collect/FluentIterableTest.java b/guava-tests/test/com/google/common/collect/FluentIterableTest.java index 544bbe96669e..eb97a98b15ae 100644 --- a/guava-tests/test/com/google/common/collect/FluentIterableTest.java +++ b/guava-tests/test/com/google/common/collect/FluentIterableTest.java @@ -49,6 +49,7 @@ import java.util.concurrent.TimeUnit; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -57,6 +58,7 @@ * @author Marcin Mikosik */ @GwtCompatible(emulated = true) +@NullUnmarked public class FluentIterableTest extends TestCase { @GwtIncompatible // NullPointerTester diff --git a/guava-tests/test/com/google/common/collect/ForwardingCollectionTest.java b/guava-tests/test/com/google/common/collect/ForwardingCollectionTest.java index 63dd135afaec..f8b9cb02f4f8 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingCollectionTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingCollectionTest.java @@ -29,6 +29,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ForwardingCollection}. @@ -37,6 +38,7 @@ * @author Hayward Chan * @author Louis Wasserman */ +@NullUnmarked public class ForwardingCollectionTest extends TestCase { static final class StandardImplForwardingCollection extends ForwardingCollection { private final Collection backingCollection; diff --git a/guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java b/guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java index aa1c61c88d35..3bd70757f696 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java @@ -19,12 +19,14 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ForwardingConcurrentMap}. * * @author Jared Levy */ +@NullUnmarked public class ForwardingConcurrentMapTest extends TestCase { private static class TestMap extends ForwardingConcurrentMap { diff --git a/guava-tests/test/com/google/common/collect/ForwardingDequeTest.java b/guava-tests/test/com/google/common/collect/ForwardingDequeTest.java index 3e7343fc32b1..6811b1c2393a 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingDequeTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingDequeTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.ForwardingWrapperTester; import java.util.Deque; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code ForwardingDeque}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class ForwardingDequeTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/guava-tests/test/com/google/common/collect/ForwardingListIteratorTest.java b/guava-tests/test/com/google/common/collect/ForwardingListIteratorTest.java index d71ed3b0be7e..e369de4254cd 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingListIteratorTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingListIteratorTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.ForwardingWrapperTester; import java.util.ListIterator; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code ForwardingListIterator}. * * @author Robert Konigsberg */ +@NullUnmarked public class ForwardingListIteratorTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/guava-tests/test/com/google/common/collect/ForwardingListMultimapTest.java b/guava-tests/test/com/google/common/collect/ForwardingListMultimapTest.java index 9ad47bde144e..ba974e0dc9bd 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingListMultimapTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingListMultimapTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.ForwardingWrapperTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingListMultimap}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class ForwardingListMultimapTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/guava-tests/test/com/google/common/collect/ForwardingListTest.java b/guava-tests/test/com/google/common/collect/ForwardingListTest.java index 881228260edd..d0bac259adac 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingListTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingListTest.java @@ -31,6 +31,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -39,6 +40,7 @@ * @author Robert Konigsberg * @author Louis Wasserman */ +@NullUnmarked public class ForwardingListTest extends TestCase { static final class StandardImplForwardingList extends ForwardingList { private final List backingList; diff --git a/guava-tests/test/com/google/common/collect/ForwardingMapTest.java b/guava-tests/test/com/google/common/collect/ForwardingMapTest.java index d080c20efd81..39643eb61016 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingMapTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingMapTest.java @@ -49,6 +49,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -57,6 +58,7 @@ * @author Hayward Chan * @author Louis Wasserman */ +@NullUnmarked public class ForwardingMapTest extends TestCase { static class StandardImplForwardingMap extends ForwardingMap { private final Map backingMap; diff --git a/guava-tests/test/com/google/common/collect/ForwardingMultimapTest.java b/guava-tests/test/com/google/common/collect/ForwardingMultimapTest.java index 1203428f8095..ec93966ea344 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingMultimapTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingMultimapTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.ForwardingWrapperTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingMultimap}. * * @author Hayward Chan */ +@NullUnmarked public class ForwardingMultimapTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/guava-tests/test/com/google/common/collect/ForwardingMultisetTest.java b/guava-tests/test/com/google/common/collect/ForwardingMultisetTest.java index 5bdb70801b07..e070713703db 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingMultisetTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingMultisetTest.java @@ -34,6 +34,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -42,6 +43,7 @@ * @author Hayward Chan * @author Louis Wasserman */ +@NullUnmarked public class ForwardingMultisetTest extends TestCase { static final class StandardImplForwardingMultiset extends ForwardingMultiset { diff --git a/guava-tests/test/com/google/common/collect/ForwardingNavigableMapTest.java b/guava-tests/test/com/google/common/collect/ForwardingNavigableMapTest.java index 41e29ec8807f..f85fd1f21b2b 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingNavigableMapTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingNavigableMapTest.java @@ -39,6 +39,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -47,6 +48,7 @@ * @author Robert Konigsberg * @author Louis Wasserman */ +@NullUnmarked public class ForwardingNavigableMapTest extends TestCase { static class StandardImplForwardingNavigableMap extends ForwardingNavigableMap { private final NavigableMap backingMap; diff --git a/guava-tests/test/com/google/common/collect/ForwardingNavigableSetTest.java b/guava-tests/test/com/google/common/collect/ForwardingNavigableSetTest.java index 5b4acfdefe89..1fdac7a84137 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingNavigableSetTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingNavigableSetTest.java @@ -35,6 +35,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -42,6 +43,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class ForwardingNavigableSetTest extends TestCase { static class StandardImplForwardingNavigableSet extends ForwardingNavigableSet { private final NavigableSet backingSet; diff --git a/guava-tests/test/com/google/common/collect/ForwardingObjectTest.java b/guava-tests/test/com/google/common/collect/ForwardingObjectTest.java index abd14248eecc..efcdf0e87d5e 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingObjectTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingObjectTest.java @@ -21,12 +21,14 @@ import com.google.common.testing.EqualsTester; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code ForwardingObject}. * * @author Mike Bostock */ +@NullUnmarked public class ForwardingObjectTest extends TestCase { public void testEqualsReflexive() { diff --git a/guava-tests/test/com/google/common/collect/ForwardingQueueTest.java b/guava-tests/test/com/google/common/collect/ForwardingQueueTest.java index 033a96d9e310..a421c0acd577 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingQueueTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingQueueTest.java @@ -29,6 +29,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -37,6 +38,7 @@ * @author Robert Konigsberg * @author Louis Wasserman */ +@NullUnmarked public class ForwardingQueueTest extends TestCase { static final class StandardImplForwardingQueue extends ForwardingQueue { diff --git a/guava-tests/test/com/google/common/collect/ForwardingSetMultimapTest.java b/guava-tests/test/com/google/common/collect/ForwardingSetMultimapTest.java index ff19b19c0b53..f25b2aa3ee85 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingSetMultimapTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingSetMultimapTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.ForwardingWrapperTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingSetMultimap}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class ForwardingSetMultimapTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/guava-tests/test/com/google/common/collect/ForwardingSetTest.java b/guava-tests/test/com/google/common/collect/ForwardingSetTest.java index 53d12c36afb1..a6f02f7069fc 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingSetTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingSetTest.java @@ -31,6 +31,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -39,6 +40,7 @@ * @author Robert Konigsberg * @author Louis Wasserman */ +@NullUnmarked public class ForwardingSetTest extends TestCase { static class StandardImplForwardingSet extends ForwardingSet { private final Set backingSet; diff --git a/guava-tests/test/com/google/common/collect/ForwardingSortedMapTest.java b/guava-tests/test/com/google/common/collect/ForwardingSortedMapTest.java index a4d829085d42..dedb8a8fd361 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingSortedMapTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingSortedMapTest.java @@ -36,6 +36,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -43,6 +44,7 @@ * * @author Robert KonigsbergSortedMapFeature */ +@NullUnmarked public class ForwardingSortedMapTest extends TestCase { static class StandardImplForwardingSortedMap extends ForwardingSortedMap { private final SortedMap backingSortedMap; diff --git a/guava-tests/test/com/google/common/collect/ForwardingSortedMultisetTest.java b/guava-tests/test/com/google/common/collect/ForwardingSortedMultisetTest.java index ad4d6e768490..03f3199310e7 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingSortedMultisetTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingSortedMultisetTest.java @@ -31,6 +31,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -38,6 +39,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class ForwardingSortedMultisetTest extends TestCase { static class StandardImplForwardingSortedMultiset extends ForwardingSortedMultiset { private final SortedMultiset backingMultiset; diff --git a/guava-tests/test/com/google/common/collect/ForwardingSortedSetMultimapTest.java b/guava-tests/test/com/google/common/collect/ForwardingSortedSetMultimapTest.java index c5d91965eda8..237eb0570eac 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingSortedSetMultimapTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingSortedSetMultimapTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.ForwardingWrapperTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ForwardingSortedSetMultimap}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class ForwardingSortedSetMultimapTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/guava-tests/test/com/google/common/collect/ForwardingSortedSetTest.java b/guava-tests/test/com/google/common/collect/ForwardingSortedSetTest.java index b19ec90bba5c..9af2ef4f44ef 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingSortedSetTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingSortedSetTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -39,6 +40,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class ForwardingSortedSetTest extends TestCase { static class StandardImplForwardingSortedSet extends ForwardingSortedSet { private final SortedSet backingSortedSet; diff --git a/guava-tests/test/com/google/common/collect/ForwardingTableTest.java b/guava-tests/test/com/google/common/collect/ForwardingTableTest.java index 4d8e784354f4..79e6ad3d16a9 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingTableTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingTableTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.ForwardingWrapperTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests {@link ForwardingTable}. * * @author Gregory Kick */ +@NullUnmarked public class ForwardingTableTest extends TestCase { @SuppressWarnings("rawtypes") diff --git a/guava-tests/test/com/google/common/collect/ImmutableBiMapFloodingTest.java b/guava-tests/test/com/google/common/collect/ImmutableBiMapFloodingTest.java index 3407668e4824..5aed0a340522 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableBiMapFloodingTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableBiMapFloodingTest.java @@ -29,8 +29,10 @@ import java.util.Map; import java.util.Map.Entry; import java.util.stream.Stream; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible +@NullUnmarked public class ImmutableBiMapFloodingTest extends AbstractHashFloodingTest> { public ImmutableBiMapFloodingTest() { super( diff --git a/guava-tests/test/com/google/common/collect/ImmutableBiMapInverseMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/ImmutableBiMapInverseMapInterfaceTest.java index 1484171ed7c4..2bcf2a7e0793 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableBiMapInverseMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableBiMapInverseMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableBiMapInverseMapInterfaceTest extends AbstractImmutableBiMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/ImmutableBiMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/ImmutableBiMapMapInterfaceTest.java index 6a7846e3dd30..63bd444579db 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableBiMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableBiMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableBiMapMapInterfaceTest extends AbstractImmutableBiMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/ImmutableClassToInstanceMapTest.java b/guava-tests/test/com/google/common/collect/ImmutableClassToInstanceMapTest.java index 04fc2a7d2747..d075f580b036 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableClassToInstanceMapTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableClassToInstanceMapTest.java @@ -36,6 +36,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -43,6 +44,7 @@ * * @author Kevin Bourrillion */ +@NullUnmarked public class ImmutableClassToInstanceMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/guava-tests/test/com/google/common/collect/ImmutableCollectionTest.java b/guava-tests/test/com/google/common/collect/ImmutableCollectionTest.java index 260c43459b3d..59d794dfa6f2 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableCollectionTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableCollectionTest.java @@ -17,12 +17,14 @@ package com.google.common.collect; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code ImmutableCollection}. * * @author Louis Wasserman */ +@NullUnmarked public class ImmutableCollectionTest extends TestCase { public void testCapacityExpansion() { assertEquals(1, ImmutableCollection.Builder.expandedCapacity(0, 1)); diff --git a/guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.java b/guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.java index e236ae6a070b..f758b8daf3c2 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.java @@ -32,8 +32,10 @@ import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // reflection +@NullUnmarked public class ImmutableListCopyOfConcurrentlyModifiedInputTest extends TestCase { enum WrapWithIterable { WRAP, diff --git a/guava-tests/test/com/google/common/collect/ImmutableMapFloodingTest.java b/guava-tests/test/com/google/common/collect/ImmutableMapFloodingTest.java index 61b2830d20c5..d7ed8160f09b 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableMapFloodingTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableMapFloodingTest.java @@ -25,8 +25,10 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible +@NullUnmarked public class ImmutableMapFloodingTest extends AbstractHashFloodingTest> { public ImmutableMapFloodingTest() { super(asList(ConstructionPathway.values()), n -> n * log(n), ImmutableList.of(QueryOp.MAP_GET)); diff --git a/guava-tests/test/com/google/common/collect/ImmutableMapWithBadHashesMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/ImmutableMapWithBadHashesMapInterfaceTest.java index 76a1fac5935e..d7e4910b2af8 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableMapWithBadHashesMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableMapWithBadHashesMapInterfaceTest.java @@ -19,8 +19,10 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.collect.testing.SampleElements.Colliders; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableMapWithBadHashesMapInterfaceTest extends AbstractImmutableMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/ImmutableMultisetFloodingTest.java b/guava-tests/test/com/google/common/collect/ImmutableMultisetFloodingTest.java index b062753792a2..9cd31ee919c9 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableMultisetFloodingTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableMultisetFloodingTest.java @@ -22,8 +22,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.List; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible +@NullUnmarked public class ImmutableMultisetFloodingTest extends AbstractHashFloodingTest> { public ImmutableMultisetFloodingTest() { super( diff --git a/guava-tests/test/com/google/common/collect/ImmutableRangeMapTest.java b/guava-tests/test/com/google/common/collect/ImmutableRangeMapTest.java index 8a5c19ac4c09..fbe5f8fcf789 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableRangeMapTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableRangeMapTest.java @@ -24,6 +24,7 @@ import java.util.Map.Entry; import java.util.NoSuchElementException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code ImmutableRangeMap}. @@ -31,6 +32,7 @@ * @author Louis Wasserman */ @GwtIncompatible // NavigableMap +@NullUnmarked public class ImmutableRangeMapTest extends TestCase { private static final ImmutableList> RANGES; private static final int MIN_BOUND = 0; diff --git a/guava-tests/test/com/google/common/collect/ImmutableRangeSetTest.java b/guava-tests/test/com/google/common/collect/ImmutableRangeSetTest.java index 6e538d271e47..55f834481f15 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableRangeSetTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableRangeSetTest.java @@ -30,6 +30,7 @@ import java.util.Set; import junit.framework.Test; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ImmutableRangeSet}. @@ -37,6 +38,7 @@ * @author Louis Wasserman */ @GwtIncompatible // ImmutableRangeSet +@NullUnmarked public class ImmutableRangeSetTest extends AbstractRangeSetTest { static final class ImmutableRangeSetIntegerAsSetGenerator implements TestSetGenerator { diff --git a/guava-tests/test/com/google/common/collect/ImmutableSetFloodingTest.java b/guava-tests/test/com/google/common/collect/ImmutableSetFloodingTest.java index 6212c036ddc8..b9b9a6745b61 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableSetFloodingTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableSetFloodingTest.java @@ -22,8 +22,10 @@ import com.google.common.annotations.GwtIncompatible; import java.util.List; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible +@NullUnmarked public class ImmutableSetFloodingTest extends AbstractHashFloodingTest> { public ImmutableSetFloodingTest() { super( diff --git a/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapInclusiveMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapInclusiveMapInterfaceTest.java index 5823d542d275..40848428bf64 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapInclusiveMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapInclusiveMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableSortedMapHeadMapInclusiveMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapMapInterfaceTest.java index ed96bd1f53e4..c22d8063072d 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableSortedMapHeadMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableSortedMapHeadMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/ImmutableSortedMapSubMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/ImmutableSortedMapSubMapMapInterfaceTest.java index 7d45663909ce..31faf4bf4c26 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableSortedMapSubMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableSortedMapSubMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableSortedMapSubMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapExclusiveMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapExclusiveMapInterfaceTest.java index 15ba852faefd..8752bd4f79bd 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapExclusiveMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapExclusiveMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableSortedMapTailMapExclusiveMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapMapInterfaceTest.java index 54c3aa575adb..5a31f11b46fc 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableSortedMapTailMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class ImmutableSortedMapTailMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java b/guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java index 8975e4f8b302..45f63fa66ae2 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java @@ -48,12 +48,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ImmutableSortedMultiset}. * * @author Louis Wasserman */ +@NullUnmarked public class ImmutableSortedMultisetTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/guava-tests/test/com/google/common/collect/InternersTest.java b/guava-tests/test/com/google/common/collect/InternersTest.java index 8d0239f62e2e..bd28f8a85696 100644 --- a/guava-tests/test/com/google/common/collect/InternersTest.java +++ b/guava-tests/test/com/google/common/collect/InternersTest.java @@ -25,12 +25,14 @@ import com.google.common.testing.NullPointerTester; import java.lang.ref.WeakReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Interners}. * * @author Kevin Bourrillion */ +@NullUnmarked public class InternersTest extends TestCase { public void testStrong_simplistic() { diff --git a/guava-tests/test/com/google/common/collect/IterablesFilterArrayListTest.java b/guava-tests/test/com/google/common/collect/IterablesFilterArrayListTest.java index 9cd2d90917c6..ff8706a22071 100644 --- a/guava-tests/test/com/google/common/collect/IterablesFilterArrayListTest.java +++ b/guava-tests/test/com/google/common/collect/IterablesFilterArrayListTest.java @@ -18,7 +18,9 @@ import com.google.common.base.Predicate; import com.google.common.collect.FilteredCollectionsTestUtil.AbstractFilteredIterableTest; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class IterablesFilterArrayListTest extends AbstractFilteredIterableTest> { @Override diff --git a/guava-tests/test/com/google/common/collect/LenientSerializableTester.java b/guava-tests/test/com/google/common/collect/LenientSerializableTester.java index 8c346e61842f..51378a31b49e 100644 --- a/guava-tests/test/com/google/common/collect/LenientSerializableTester.java +++ b/guava-tests/test/com/google/common/collect/LenientSerializableTester.java @@ -27,6 +27,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Collection; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; /** * Variant of {@link SerializableTester} that does not require the reserialized object's class to be @@ -39,6 +40,7 @@ * parameter for non-GWT, non-test files, and it didn't seem worth adding one for this unusual case. */ @GwtCompatible(emulated = true) +@NullUnmarked final class LenientSerializableTester { /* * TODO(cpovirk): move this to c.g.c.testing if we allow for c.g.c.annotations dependencies so diff --git a/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java b/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java index 1590399dc37f..7bc01a7dc2e0 100644 --- a/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java +++ b/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java @@ -29,9 +29,13 @@ import java.lang.ref.Reference; import java.util.concurrent.atomic.AtomicReferenceArray; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author Charles Fry */ +/** + * @author Charles Fry + */ @SuppressWarnings("deprecation") // many tests of deprecated methods +@NullUnmarked public class MapMakerInternalMapTest extends TestCase { static final int SMALL_MAX_SIZE = DRAIN_THRESHOLD * 5; diff --git a/guava-tests/test/com/google/common/collect/MapMakerTest.java b/guava-tests/test/com/google/common/collect/MapMakerTest.java index 0bc48dde11b2..9c79948d17a1 100644 --- a/guava-tests/test/com/google/common/collect/MapMakerTest.java +++ b/guava-tests/test/com/google/common/collect/MapMakerTest.java @@ -28,12 +28,14 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * @author Charles Fry */ @GwtCompatible(emulated = true) @J2ktIncompatible // MapMaker +@NullUnmarked public class MapMakerTest extends TestCase { @GwtIncompatible // NullPointerTester public void testNullParameters() throws Exception { diff --git a/guava-tests/test/com/google/common/collect/MapsCollectionTest.java b/guava-tests/test/com/google/common/collect/MapsCollectionTest.java index f584d85a0d56..7a964e1d3d3c 100644 --- a/guava-tests/test/com/google/common/collect/MapsCollectionTest.java +++ b/guava-tests/test/com/google/common/collect/MapsCollectionTest.java @@ -52,6 +52,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -59,6 +60,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class MapsCollectionTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/guava-tests/test/com/google/common/collect/MultimapsCollectionTest.java b/guava-tests/test/com/google/common/collect/MultimapsCollectionTest.java index 7c010eedd9ea..c0c40596eac5 100644 --- a/guava-tests/test/com/google/common/collect/MultimapsCollectionTest.java +++ b/guava-tests/test/com/google/common/collect/MultimapsCollectionTest.java @@ -70,6 +70,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Run collection tests on wrappers from {@link Multimaps}. @@ -77,6 +78,7 @@ * @author Jared Levy */ @GwtIncompatible // suite // TODO(cpovirk): set up collect/gwt/suites version +@NullUnmarked public class MultimapsCollectionTest extends TestCase { private static final Feature[] FOR_MAP_FEATURES_ONE = { diff --git a/guava-tests/test/com/google/common/collect/MultimapsFilterEntriesAsMapTest.java b/guava-tests/test/com/google/common/collect/MultimapsFilterEntriesAsMapTest.java index 314a12774e8d..9066880cf25b 100644 --- a/guava-tests/test/com/google/common/collect/MultimapsFilterEntriesAsMapTest.java +++ b/guava-tests/test/com/google/common/collect/MultimapsFilterEntriesAsMapTest.java @@ -21,6 +21,7 @@ import java.util.Collection; import java.util.Map; import java.util.Map.Entry; +import org.jspecify.annotations.NullUnmarked; /** * Tests for Multimaps.filterEntries().asMap(). @@ -28,6 +29,7 @@ * @author Jared Levy */ @GwtIncompatible(value = "untested") +@NullUnmarked public class MultimapsFilterEntriesAsMapTest extends AbstractMultimapAsMapImplementsMapTest { private static final Predicate> PREDICATE = new Predicate>() { diff --git a/guava-tests/test/com/google/common/collect/MultisetsCollectionTest.java b/guava-tests/test/com/google/common/collect/MultisetsCollectionTest.java index 7698b1917fc4..eac7058b374b 100644 --- a/guava-tests/test/com/google/common/collect/MultisetsCollectionTest.java +++ b/guava-tests/test/com/google/common/collect/MultisetsCollectionTest.java @@ -40,6 +40,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Collection tests on wrappers from {@link Multisets}. @@ -47,6 +48,7 @@ * @author Jared Levy */ @GwtIncompatible // suite // TODO(cpovirk): set up collect/gwt/suites version +@NullUnmarked public class MultisetsCollectionTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/guava-tests/test/com/google/common/collect/MutableClassToInstanceMapTest.java b/guava-tests/test/com/google/common/collect/MutableClassToInstanceMapTest.java index 765115d42b5e..f1d2e94fa302 100644 --- a/guava-tests/test/com/google/common/collect/MutableClassToInstanceMapTest.java +++ b/guava-tests/test/com/google/common/collect/MutableClassToInstanceMapTest.java @@ -29,12 +29,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Unit test of {@link MutableClassToInstanceMap}. * * @author Kevin Bourrillion */ +@NullUnmarked public class MutableClassToInstanceMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/guava-tests/test/com/google/common/collect/PackageSanityTests.java b/guava-tests/test/com/google/common/collect/PackageSanityTests.java index c847140d573e..52ebabb173f1 100644 --- a/guava-tests/test/com/google/common/collect/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/collect/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.collect; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Covers basic sanity checks for the entire package. @@ -24,6 +25,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { publicApiOnly(); // Many package-private classes are tested through the public API. diff --git a/guava-tests/test/com/google/common/collect/QueuesTest.java b/guava-tests/test/com/google/common/collect/QueuesTest.java index f9ca68b0fcaa..22725fe4ed72 100644 --- a/guava-tests/test/com/google/common/collect/QueuesTest.java +++ b/guava-tests/test/com/google/common/collect/QueuesTest.java @@ -41,6 +41,7 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.TimeUnit; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -48,6 +49,7 @@ * * @author Dimitris Andreou */ +@NullUnmarked public class QueuesTest extends TestCase { /* * All the following tests relate to BlockingQueue methods in Queues. diff --git a/guava-tests/test/com/google/common/collect/RangeNonGwtTest.java b/guava-tests/test/com/google/common/collect/RangeNonGwtTest.java index 666624a305f1..e669fc41cf7f 100644 --- a/guava-tests/test/com/google/common/collect/RangeNonGwtTest.java +++ b/guava-tests/test/com/google/common/collect/RangeNonGwtTest.java @@ -18,6 +18,7 @@ import com.google.common.testing.NullPointerTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test cases for {@link Range} which cannot run as GWT tests. @@ -25,6 +26,7 @@ * @author Gregory Kick * @see RangeTest */ +@NullUnmarked public class RangeNonGwtTest extends TestCase { public void testNullPointers() { diff --git a/guava-tests/test/com/google/common/collect/RegularImmutableMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/RegularImmutableMapMapInterfaceTest.java index 4035d6955032..f888c7677904 100644 --- a/guava-tests/test/com/google/common/collect/RegularImmutableMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/RegularImmutableMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class RegularImmutableMapMapInterfaceTest extends AbstractImmutableMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/RegularImmutableMapWithUnhashableValuesMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/RegularImmutableMapWithUnhashableValuesMapInterfaceTest.java index 5bbf247b8f15..641c99d8f42f 100644 --- a/guava-tests/test/com/google/common/collect/RegularImmutableMapWithUnhashableValuesMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/RegularImmutableMapWithUnhashableValuesMapInterfaceTest.java @@ -20,8 +20,10 @@ import com.google.common.collect.testing.SampleElements.Unhashables; import com.google.common.collect.testing.UnhashableObject; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // GWT's ImmutableMap emulation is backed by java.util.HashMap. +@NullUnmarked public class RegularImmutableMapWithUnhashableValuesMapInterfaceTest extends AbstractImmutableMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/RegularImmutableSortedMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/RegularImmutableSortedMapMapInterfaceTest.java index d825eac5e043..ca09158f053e 100644 --- a/guava-tests/test/com/google/common/collect/RegularImmutableSortedMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/RegularImmutableSortedMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class RegularImmutableSortedMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/ReserializedImmutableMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/ReserializedImmutableMapMapInterfaceTest.java index 6eef9f30b968..a09be5094498 100644 --- a/guava-tests/test/com/google/common/collect/ReserializedImmutableMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/ReserializedImmutableMapMapInterfaceTest.java @@ -19,8 +19,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.testing.SerializableTester; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // SerializableTester +@NullUnmarked public class ReserializedImmutableMapMapInterfaceTest extends AbstractImmutableMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/ReserializedImmutableSortedMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/ReserializedImmutableSortedMapMapInterfaceTest.java index 1011cfef3ce2..01e24ffb9e7c 100644 --- a/guava-tests/test/com/google/common/collect/ReserializedImmutableSortedMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/ReserializedImmutableSortedMapMapInterfaceTest.java @@ -19,8 +19,10 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.testing.SerializableTester; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // SerializableTester +@NullUnmarked public class ReserializedImmutableSortedMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/SetsFilterHashSetTest.java b/guava-tests/test/com/google/common/collect/SetsFilterHashSetTest.java index 658d88056905..6a74bf9726ef 100644 --- a/guava-tests/test/com/google/common/collect/SetsFilterHashSetTest.java +++ b/guava-tests/test/com/google/common/collect/SetsFilterHashSetTest.java @@ -21,7 +21,9 @@ import com.google.common.base.Predicate; import com.google.common.collect.FilteredCollectionsTestUtil.AbstractFilteredSetTest; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class SetsFilterHashSetTest extends AbstractFilteredSetTest> { @Override Set createUnfiltered(Iterable contents) { diff --git a/guava-tests/test/com/google/common/collect/SetsFilterNavigableSetTest.java b/guava-tests/test/com/google/common/collect/SetsFilterNavigableSetTest.java index 350c091507ba..2090e78098c6 100644 --- a/guava-tests/test/com/google/common/collect/SetsFilterNavigableSetTest.java +++ b/guava-tests/test/com/google/common/collect/SetsFilterNavigableSetTest.java @@ -19,7 +19,9 @@ import com.google.common.base.Predicate; import com.google.common.collect.FilteredCollectionsTestUtil.AbstractFilteredNavigableSetTest; import java.util.NavigableSet; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class SetsFilterNavigableSetTest extends AbstractFilteredNavigableSetTest { @Override NavigableSet createUnfiltered(Iterable contents) { diff --git a/guava-tests/test/com/google/common/collect/SetsFilterSortedSetTest.java b/guava-tests/test/com/google/common/collect/SetsFilterSortedSetTest.java index 0529bead6ccd..8d6b85ab517f 100644 --- a/guava-tests/test/com/google/common/collect/SetsFilterSortedSetTest.java +++ b/guava-tests/test/com/google/common/collect/SetsFilterSortedSetTest.java @@ -20,7 +20,9 @@ import com.google.common.collect.FilteredCollectionsTestUtil.AbstractFilteredSortedSetTest; import java.util.SortedSet; import java.util.TreeSet; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class SetsFilterSortedSetTest extends AbstractFilteredSortedSetTest> { @Override diff --git a/guava-tests/test/com/google/common/collect/SingletonImmutableMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/SingletonImmutableMapMapInterfaceTest.java index 2a9197d6c5df..45be28eb17b9 100644 --- a/guava-tests/test/com/google/common/collect/SingletonImmutableMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/SingletonImmutableMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class SingletonImmutableMapMapInterfaceTest extends AbstractImmutableMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/SingletonImmutableMapWithUnhashableValueMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/SingletonImmutableMapWithUnhashableValueMapInterfaceTest.java index 851e5d8c5dbe..0891fa2952c2 100644 --- a/guava-tests/test/com/google/common/collect/SingletonImmutableMapWithUnhashableValueMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/SingletonImmutableMapWithUnhashableValueMapInterfaceTest.java @@ -20,8 +20,10 @@ import com.google.common.collect.testing.SampleElements.Unhashables; import com.google.common.collect.testing.UnhashableObject; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible // GWT's ImmutableMap emulation is backed by java.util.HashMap. +@NullUnmarked public class SingletonImmutableMapWithUnhashableValueMapInterfaceTest extends RegularImmutableMapWithUnhashableValuesMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/SingletonImmutableSortedMapMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/SingletonImmutableSortedMapMapInterfaceTest.java index 4cb7ca5f436a..ae4f7d8962fe 100644 --- a/guava-tests/test/com/google/common/collect/SingletonImmutableSortedMapMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/SingletonImmutableSortedMapMapInterfaceTest.java @@ -18,8 +18,10 @@ import com.google.common.annotations.GwtCompatible; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class SingletonImmutableSortedMapMapInterfaceTest extends AbstractImmutableSortedMapMapInterfaceTest { @Override diff --git a/guava-tests/test/com/google/common/collect/SpecialRandom.java b/guava-tests/test/com/google/common/collect/SpecialRandom.java index 5996e5bfe26c..571a061f74ae 100644 --- a/guava-tests/test/com/google/common/collect/SpecialRandom.java +++ b/guava-tests/test/com/google/common/collect/SpecialRandom.java @@ -17,6 +17,7 @@ package com.google.common.collect; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Utility class for being able to seed a {@link Random} value with a passed in seed from a @@ -26,6 +27,7 @@ * * @author Nicholaus Shupe */ +@NullUnmarked public final class SpecialRandom extends Random { public static SpecialRandom valueOf(String s) { return (s.length() == 0) ? new SpecialRandom() : new SpecialRandom(Long.parseLong(s)); diff --git a/guava-tests/test/com/google/common/collect/SynchronizedBiMapTest.java b/guava-tests/test/com/google/common/collect/SynchronizedBiMapTest.java index 7b67382fa348..96ec1da931c9 100644 --- a/guava-tests/test/com/google/common/collect/SynchronizedBiMapTest.java +++ b/guava-tests/test/com/google/common/collect/SynchronizedBiMapTest.java @@ -30,6 +30,7 @@ import java.util.Set; import java.util.function.BiFunction; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -37,6 +38,7 @@ * * @author Mike Bostock */ +@NullUnmarked public class SynchronizedBiMapTest extends SynchronizedMapTest { public static TestSuite suite() { diff --git a/guava-tests/test/com/google/common/collect/SynchronizedDequeTest.java b/guava-tests/test/com/google/common/collect/SynchronizedDequeTest.java index dd1b9569e801..5d1394fbf3e0 100644 --- a/guava-tests/test/com/google/common/collect/SynchronizedDequeTest.java +++ b/guava-tests/test/com/google/common/collect/SynchronizedDequeTest.java @@ -21,6 +21,7 @@ import java.util.Deque; import java.util.Iterator; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -28,6 +29,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class SynchronizedDequeTest extends TestCase { protected Deque create() { diff --git a/guava-tests/test/com/google/common/collect/SynchronizedMapTest.java b/guava-tests/test/com/google/common/collect/SynchronizedMapTest.java index 7b49e26f2625..55425e73aba3 100644 --- a/guava-tests/test/com/google/common/collect/SynchronizedMapTest.java +++ b/guava-tests/test/com/google/common/collect/SynchronizedMapTest.java @@ -28,6 +28,7 @@ import java.util.Map.Entry; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -35,6 +36,7 @@ * * @author Mike Bostock */ +@NullUnmarked public class SynchronizedMapTest extends TestCase { public final Object mutex = new Object[0]; // something Serializable diff --git a/guava-tests/test/com/google/common/collect/SynchronizedMultimapTest.java b/guava-tests/test/com/google/common/collect/SynchronizedMultimapTest.java index c4e17efeddf1..b4499f96371d 100644 --- a/guava-tests/test/com/google/common/collect/SynchronizedMultimapTest.java +++ b/guava-tests/test/com/google/common/collect/SynchronizedMultimapTest.java @@ -35,6 +35,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -42,6 +43,7 @@ * * @author Mike Bostock */ +@NullUnmarked public class SynchronizedMultimapTest extends TestCase { public static Test suite() { diff --git a/guava-tests/test/com/google/common/collect/SynchronizedNavigableMapTest.java b/guava-tests/test/com/google/common/collect/SynchronizedNavigableMapTest.java index d92a94847711..0c414a269be6 100644 --- a/guava-tests/test/com/google/common/collect/SynchronizedNavigableMapTest.java +++ b/guava-tests/test/com/google/common/collect/SynchronizedNavigableMapTest.java @@ -33,6 +33,7 @@ import java.util.NavigableSet; import java.util.SortedMap; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -40,6 +41,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class SynchronizedNavigableMapTest extends SynchronizedMapTest { @Override protected NavigableMap create() { diff --git a/guava-tests/test/com/google/common/collect/SynchronizedNavigableSetTest.java b/guava-tests/test/com/google/common/collect/SynchronizedNavigableSetTest.java index 73ee85fa2826..870cc12b0258 100644 --- a/guava-tests/test/com/google/common/collect/SynchronizedNavigableSetTest.java +++ b/guava-tests/test/com/google/common/collect/SynchronizedNavigableSetTest.java @@ -32,6 +32,7 @@ import java.util.TreeSet; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -39,6 +40,7 @@ * * @author Louis Wasserman */ +@NullUnmarked public class SynchronizedNavigableSetTest extends TestCase { private static final Object MUTEX = new Object[0]; // something Serializable diff --git a/guava-tests/test/com/google/common/collect/SynchronizedQueueTest.java b/guava-tests/test/com/google/common/collect/SynchronizedQueueTest.java index e61905fe791e..8697239cd6f5 100644 --- a/guava-tests/test/com/google/common/collect/SynchronizedQueueTest.java +++ b/guava-tests/test/com/google/common/collect/SynchronizedQueueTest.java @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.Queue; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -28,6 +29,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class SynchronizedQueueTest extends TestCase { protected Queue create() { diff --git a/guava-tests/test/com/google/common/collect/SynchronizedSetTest.java b/guava-tests/test/com/google/common/collect/SynchronizedSetTest.java index ef6d8e8e9471..9d0fff3a1253 100644 --- a/guava-tests/test/com/google/common/collect/SynchronizedSetTest.java +++ b/guava-tests/test/com/google/common/collect/SynchronizedSetTest.java @@ -31,6 +31,7 @@ import java.util.stream.Stream; import junit.framework.Test; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -38,6 +39,7 @@ * * @author Mike Bostock */ +@NullUnmarked public class SynchronizedSetTest extends TestCase { public static final Object MUTEX = new Object[0]; // something Serializable diff --git a/guava-tests/test/com/google/common/collect/SynchronizedTableTest.java b/guava-tests/test/com/google/common/collect/SynchronizedTableTest.java index b0690f80a316..365ab36b8670 100644 --- a/guava-tests/test/com/google/common/collect/SynchronizedTableTest.java +++ b/guava-tests/test/com/google/common/collect/SynchronizedTableTest.java @@ -20,8 +20,10 @@ import java.util.Collection; import java.util.Map; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; +@NullUnmarked public class SynchronizedTableTest extends AbstractTableTest { private static final class TestTable implements Table, Serializable { final Table delegate = HashBasedTable.create(); diff --git a/guava-tests/test/com/google/common/collect/TestExceptions.java b/guava-tests/test/com/google/common/collect/TestExceptions.java index f7ca37fbd944..eb0025b49260 100644 --- a/guava-tests/test/com/google/common/collect/TestExceptions.java +++ b/guava-tests/test/com/google/common/collect/TestExceptions.java @@ -17,9 +17,11 @@ package com.google.common.collect; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; /** Exception classes for use in tests. */ @GwtCompatible +@NullUnmarked final class TestExceptions { static class SomeError extends Error {} diff --git a/guava-tests/test/com/google/common/collect/TopKSelectorTest.java b/guava-tests/test/com/google/common/collect/TopKSelectorTest.java index dc8ae30902c1..5f28508d8928 100644 --- a/guava-tests/test/com/google/common/collect/TopKSelectorTest.java +++ b/guava-tests/test/com/google/common/collect/TopKSelectorTest.java @@ -27,6 +27,7 @@ import java.util.Comparator; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code TopKSelector}. @@ -34,6 +35,7 @@ * @author Louis Wasserman */ @GwtCompatible +@NullUnmarked public class TopKSelectorTest extends TestCase { public void testNegativeK() { diff --git a/guava-tests/test/com/google/common/collect/TreeBasedTableRowMapInterfaceTest.java b/guava-tests/test/com/google/common/collect/TreeBasedTableRowMapInterfaceTest.java index dd8aec3aa444..70ed7faca268 100644 --- a/guava-tests/test/com/google/common/collect/TreeBasedTableRowMapInterfaceTest.java +++ b/guava-tests/test/com/google/common/collect/TreeBasedTableRowMapInterfaceTest.java @@ -19,8 +19,10 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.collect.testing.SortedMapInterfaceTest; import java.util.SortedMap; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible +@NullUnmarked public class TreeBasedTableRowMapInterfaceTest extends SortedMapInterfaceTest { public TreeBasedTableRowMapInterfaceTest() { super(false, false, true, true, true); diff --git a/guava-tests/test/com/google/common/collect/TreeRangeMapTest.java b/guava-tests/test/com/google/common/collect/TreeRangeMapTest.java index 0e939fd6c802..6b884467f91b 100644 --- a/guava-tests/test/com/google/common/collect/TreeRangeMapTest.java +++ b/guava-tests/test/com/google/common/collect/TreeRangeMapTest.java @@ -34,6 +34,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code TreeRangeMap}. @@ -41,6 +42,7 @@ * @author Louis Wasserman */ @GwtIncompatible // NavigableMap +@NullUnmarked public class TreeRangeMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); diff --git a/guava-tests/test/com/google/common/collect/TreeRangeSetTest.java b/guava-tests/test/com/google/common/collect/TreeRangeSetTest.java index 29b94f157a72..892c988b7991 100644 --- a/guava-tests/test/com/google/common/collect/TreeRangeSetTest.java +++ b/guava-tests/test/com/google/common/collect/TreeRangeSetTest.java @@ -23,6 +23,7 @@ import com.google.common.testing.SerializableTester; import java.util.List; import java.util.NavigableMap; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link TreeRangeSet}. @@ -31,6 +32,7 @@ * @author Chris Povirk */ @GwtIncompatible // TreeRangeSet +@NullUnmarked public class TreeRangeSetTest extends AbstractRangeSetTest { // TODO(cpovirk): test all of these with the ranges added in the reverse order diff --git a/guava-tests/test/com/google/common/collect/WriteReplaceOverridesTest.java b/guava-tests/test/com/google/common/collect/WriteReplaceOverridesTest.java index d19299220ed4..61c40de4a87c 100644 --- a/guava-tests/test/com/google/common/collect/WriteReplaceOverridesTest.java +++ b/guava-tests/test/com/google/common/collect/WriteReplaceOverridesTest.java @@ -28,6 +28,7 @@ import com.google.common.reflect.TypeToken; import java.lang.reflect.Method; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests that all package-private {@code writeReplace} methods are overridden in any existing @@ -36,6 +37,7 @@ * writeReplace} when serializing an instance of the subclass. For an example of this problem, see * b/310253115. */ +@NullUnmarked public class WriteReplaceOverridesTest extends TestCase { private static final ImmutableSet GUAVA_PACKAGES = FluentIterable.of( diff --git a/guava-tests/test/com/google/common/escape/ArrayBasedEscaperMapTest.java b/guava-tests/test/com/google/common/escape/ArrayBasedEscaperMapTest.java index 83b58ee94c8b..a327f549bed6 100644 --- a/guava-tests/test/com/google/common/escape/ArrayBasedEscaperMapTest.java +++ b/guava-tests/test/com/google/common/escape/ArrayBasedEscaperMapTest.java @@ -22,9 +22,13 @@ import com.google.common.collect.ImmutableMap; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author David Beaumont */ +/** + * @author David Beaumont + */ @GwtCompatible +@NullUnmarked public class ArrayBasedEscaperMapTest extends TestCase { public void testNullMap() { assertThrows(NullPointerException.class, () -> ArrayBasedEscaperMap.create(null)); diff --git a/guava-tests/test/com/google/common/escape/CharEscaperBuilderTest.java b/guava-tests/test/com/google/common/escape/CharEscaperBuilderTest.java index 087e3177ab7d..5f0ebea616ea 100644 --- a/guava-tests/test/com/google/common/escape/CharEscaperBuilderTest.java +++ b/guava-tests/test/com/google/common/escape/CharEscaperBuilderTest.java @@ -17,7 +17,9 @@ package com.google.common.escape; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public class CharEscaperBuilderTest extends TestCase { public void testAddEscapes() { diff --git a/guava-tests/test/com/google/common/escape/EscapersTest.java b/guava-tests/test/com/google/common/escape/EscapersTest.java index 7072ea7997a5..650203e548fc 100644 --- a/guava-tests/test/com/google/common/escape/EscapersTest.java +++ b/guava-tests/test/com/google/common/escape/EscapersTest.java @@ -22,9 +22,13 @@ import com.google.common.escape.testing.EscaperAsserts; import java.io.IOException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author David Beaumont */ +/** + * @author David Beaumont + */ @GwtCompatible +@NullUnmarked public class EscapersTest extends TestCase { public void testNullEscaper() throws IOException { Escaper escaper = Escapers.nullEscaper(); diff --git a/guava-tests/test/com/google/common/escape/PackageSanityTests.java b/guava-tests/test/com/google/common/escape/PackageSanityTests.java index c2af8b742d02..d284c28a6e54 100644 --- a/guava-tests/test/com/google/common/escape/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/escape/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.escape; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -24,4 +25,5 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests {} diff --git a/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java b/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java index a42af5cee91a..1817cdff8efa 100644 --- a/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java +++ b/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java @@ -20,6 +20,7 @@ import com.google.common.annotations.GwtCompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -28,6 +29,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked public class UnicodeEscaperTest extends TestCase { private static final String SMALLEST_SURROGATE = diff --git a/guava-tests/test/com/google/common/eventbus/AsyncEventBusTest.java b/guava-tests/test/com/google/common/eventbus/AsyncEventBusTest.java index 208667d213f3..ec84a0e368da 100644 --- a/guava-tests/test/com/google/common/eventbus/AsyncEventBusTest.java +++ b/guava-tests/test/com/google/common/eventbus/AsyncEventBusTest.java @@ -20,12 +20,14 @@ import java.util.List; import java.util.concurrent.Executor; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test case for {@link AsyncEventBus}. * * @author Cliff Biffle */ +@NullUnmarked public class AsyncEventBusTest extends TestCase { private static final String EVENT = "Hello"; diff --git a/guava-tests/test/com/google/common/eventbus/DispatcherTest.java b/guava-tests/test/com/google/common/eventbus/DispatcherTest.java index ec78c716fdc9..58c12be8b901 100644 --- a/guava-tests/test/com/google/common/eventbus/DispatcherTest.java +++ b/guava-tests/test/com/google/common/eventbus/DispatcherTest.java @@ -25,12 +25,14 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.CyclicBarrier; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Dispatcher} implementations. * * @author Colin Decker */ +@NullUnmarked public class DispatcherTest extends TestCase { private final EventBus bus = new EventBus(); diff --git a/guava-tests/test/com/google/common/eventbus/EventBusTest.java b/guava-tests/test/com/google/common/eventbus/EventBusTest.java index 661d40ae2d42..e81efa36bebb 100644 --- a/guava-tests/test/com/google/common/eventbus/EventBusTest.java +++ b/guava-tests/test/com/google/common/eventbus/EventBusTest.java @@ -26,12 +26,14 @@ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test case for {@link EventBus}. * * @author Cliff Biffle */ +@NullUnmarked public class EventBusTest extends TestCase { private static final String EVENT = "Hello"; private static final String BUS_IDENTIFIER = "test-bus"; diff --git a/guava-tests/test/com/google/common/eventbus/PackageSanityTests.java b/guava-tests/test/com/google/common/eventbus/PackageSanityTests.java index bb7de099b4bb..441e79a730fc 100644 --- a/guava-tests/test/com/google/common/eventbus/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/eventbus/PackageSanityTests.java @@ -18,6 +18,7 @@ import com.google.common.testing.AbstractPackageSanityTests; import java.lang.reflect.Method; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -26,6 +27,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() throws Exception { diff --git a/guava-tests/test/com/google/common/eventbus/ReentrantEventsTest.java b/guava-tests/test/com/google/common/eventbus/ReentrantEventsTest.java index f26f0c36f723..6ae77e5b15ab 100644 --- a/guava-tests/test/com/google/common/eventbus/ReentrantEventsTest.java +++ b/guava-tests/test/com/google/common/eventbus/ReentrantEventsTest.java @@ -19,12 +19,14 @@ import com.google.common.collect.Lists; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Validate that {@link EventBus} behaves carefully when listeners publish their own events. * * @author Jesse Wilson */ +@NullUnmarked public class ReentrantEventsTest extends TestCase { static final String FIRST = "one"; diff --git a/guava-tests/test/com/google/common/eventbus/StringCatcher.java b/guava-tests/test/com/google/common/eventbus/StringCatcher.java index 0fb9cecf1b57..56be3f2ac1ae 100644 --- a/guava-tests/test/com/google/common/eventbus/StringCatcher.java +++ b/guava-tests/test/com/google/common/eventbus/StringCatcher.java @@ -19,6 +19,7 @@ import com.google.common.collect.Lists; import java.util.List; import junit.framework.Assert; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -29,6 +30,7 @@ * * @author Cliff Biffle */ +@NullUnmarked public class StringCatcher { private List events = Lists.newArrayList(); diff --git a/guava-tests/test/com/google/common/eventbus/SubscriberRegistryTest.java b/guava-tests/test/com/google/common/eventbus/SubscriberRegistryTest.java index 901bb2b51e49..21ff84066d04 100644 --- a/guava-tests/test/com/google/common/eventbus/SubscriberRegistryTest.java +++ b/guava-tests/test/com/google/common/eventbus/SubscriberRegistryTest.java @@ -22,12 +22,14 @@ import com.google.common.collect.Iterators; import java.util.Iterator; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link SubscriberRegistry}. * * @author Colin Decker */ +@NullUnmarked public class SubscriberRegistryTest extends TestCase { private final SubscriberRegistry registry = new SubscriberRegistry(new EventBus()); diff --git a/guava-tests/test/com/google/common/eventbus/SubscriberTest.java b/guava-tests/test/com/google/common/eventbus/SubscriberTest.java index 6e02627feff6..4f9c7bdce788 100644 --- a/guava-tests/test/com/google/common/eventbus/SubscriberTest.java +++ b/guava-tests/test/com/google/common/eventbus/SubscriberTest.java @@ -23,6 +23,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -31,6 +32,7 @@ * @author Cliff Biffle * @author Colin Decker */ +@NullUnmarked public class SubscriberTest extends TestCase { private static final Object FIXTURE_ARGUMENT = new Object(); diff --git a/guava-tests/test/com/google/common/graph/AbstractGraphTest.java b/guava-tests/test/com/google/common/graph/AbstractGraphTest.java index 8b4b5076cdf7..bcf9cf6d7680 100644 --- a/guava-tests/test/com/google/common/graph/AbstractGraphTest.java +++ b/guava-tests/test/com/google/common/graph/AbstractGraphTest.java @@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableSet; import java.util.HashSet; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -47,6 +48,7 @@ * TODO(user): Make this class generic (using ) for all node and edge types. * TODO(user): Differentiate between directed and undirected edge strings. */ +@NullUnmarked public abstract class AbstractGraphTest { Graph graph; diff --git a/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java b/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java index 9fee7c8be6b4..70ecbc028d52 100644 --- a/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java +++ b/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java @@ -38,6 +38,7 @@ import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.After; import org.junit.Before; @@ -59,6 +60,7 @@ * TODO(user): Make this class generic (using ) for all node and edge types. * TODO(user): Differentiate between directed and undirected edge strings. */ +@NullUnmarked public abstract class AbstractNetworkTest { Network network; diff --git a/guava-tests/test/com/google/common/graph/AbstractStandardDirectedGraphTest.java b/guava-tests/test/com/google/common/graph/AbstractStandardDirectedGraphTest.java index 0079c1c46008..2e650a1fa378 100644 --- a/guava-tests/test/com/google/common/graph/AbstractStandardDirectedGraphTest.java +++ b/guava-tests/test/com/google/common/graph/AbstractStandardDirectedGraphTest.java @@ -23,11 +23,13 @@ import static org.junit.Assert.assertTrue; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; /** * Abstract base class for testing directed {@link Graph} implementations defined in this package. */ +@NullUnmarked public abstract class AbstractStandardDirectedGraphTest extends AbstractGraphTest { @Override diff --git a/guava-tests/test/com/google/common/graph/AbstractStandardDirectedNetworkTest.java b/guava-tests/test/com/google/common/graph/AbstractStandardDirectedNetworkTest.java index f33c34d9affe..a3c41ae14375 100644 --- a/guava-tests/test/com/google/common/graph/AbstractStandardDirectedNetworkTest.java +++ b/guava-tests/test/com/google/common/graph/AbstractStandardDirectedNetworkTest.java @@ -28,12 +28,14 @@ import java.util.Collections; import java.util.Optional; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.After; import org.junit.Test; /** * Abstract base class for testing directed {@link Network} implementations defined in this package. */ +@NullUnmarked public abstract class AbstractStandardDirectedNetworkTest extends AbstractNetworkTest { @After diff --git a/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedGraphTest.java b/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedGraphTest.java index 521bc72bd13f..d0f8d38163da 100644 --- a/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedGraphTest.java +++ b/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedGraphTest.java @@ -23,12 +23,14 @@ import com.google.common.testing.EqualsTester; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.After; import org.junit.Test; /** * Abstract base class for testing undirected {@link Graph} implementations defined in this package. */ +@NullUnmarked public abstract class AbstractStandardUndirectedGraphTest extends AbstractGraphTest { @After diff --git a/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedNetworkTest.java b/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedNetworkTest.java index ab220ca621bb..16a4d5349260 100644 --- a/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedNetworkTest.java +++ b/guava-tests/test/com/google/common/graph/AbstractStandardUndirectedNetworkTest.java @@ -27,6 +27,7 @@ import com.google.common.testing.EqualsTester; import java.util.Optional; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.After; import org.junit.Test; @@ -34,6 +35,7 @@ * Abstract base class for testing undirected {@link Network} implementations defined in this * package. */ +@NullUnmarked public abstract class AbstractStandardUndirectedNetworkTest extends AbstractNetworkTest { private static final EndpointPair ENDPOINTS_N1N2 = EndpointPair.ordered(N1, N2); private static final EndpointPair ENDPOINTS_N2N1 = EndpointPair.ordered(N2, N1); diff --git a/guava-tests/test/com/google/common/graph/DefaultNetworkImplementationsTest.java b/guava-tests/test/com/google/common/graph/DefaultNetworkImplementationsTest.java index 4f3cd6f9d56b..bf5a387b0290 100644 --- a/guava-tests/test/com/google/common/graph/DefaultNetworkImplementationsTest.java +++ b/guava-tests/test/com/google/common/graph/DefaultNetworkImplementationsTest.java @@ -26,6 +26,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -40,6 +41,7 @@ @AndroidIncompatible // TODO(cpovirk): Figure out Android JUnit 4 support. Does it work with Gingerbread? @RunWith? @RunWith(Parameterized.class) +@NullUnmarked public final class DefaultNetworkImplementationsTest { private MutableNetwork network; private NetworkForTest networkForTest; diff --git a/guava-tests/test/com/google/common/graph/ElementOrderTest.java b/guava-tests/test/com/google/common/graph/ElementOrderTest.java index 5e4c8d4d8a77..a50b0400fe45 100644 --- a/guava-tests/test/com/google/common/graph/ElementOrderTest.java +++ b/guava-tests/test/com/google/common/graph/ElementOrderTest.java @@ -23,12 +23,14 @@ import com.google.common.collect.Ordering; import java.util.Comparator; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Tests for ordering the elements of graphs. */ @RunWith(JUnit4.class) +@NullUnmarked public final class ElementOrderTest { // Node order tests diff --git a/guava-tests/test/com/google/common/graph/EndpointPairTest.java b/guava-tests/test/com/google/common/graph/EndpointPairTest.java index 391f4c83814f..a304ed7b8c43 100644 --- a/guava-tests/test/com/google/common/graph/EndpointPairTest.java +++ b/guava-tests/test/com/google/common/graph/EndpointPairTest.java @@ -24,12 +24,14 @@ import com.google.common.testing.EqualsTester; import java.util.Collection; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Tests for {@link EndpointPair} and {@link Graph#edges()}. */ @RunWith(JUnit4.class) +@NullUnmarked public final class EndpointPairTest { private static final Integer N0 = 0; private static final Integer N1 = 1; diff --git a/guava-tests/test/com/google/common/graph/GraphEquivalenceTest.java b/guava-tests/test/com/google/common/graph/GraphEquivalenceTest.java index 87247d5b56ec..7d45f55913d5 100644 --- a/guava-tests/test/com/google/common/graph/GraphEquivalenceTest.java +++ b/guava-tests/test/com/google/common/graph/GraphEquivalenceTest.java @@ -23,6 +23,7 @@ import com.google.common.graph.TestUtil.EdgeType; import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -31,6 +32,7 @@ @AndroidIncompatible // TODO(cpovirk): Figure out Android JUnit 4 support. Does it work with Gingerbread? @RunWith? @RunWith(Parameterized.class) +@NullUnmarked public final class GraphEquivalenceTest { private static final Integer N1 = 1; private static final Integer N2 = 2; diff --git a/guava-tests/test/com/google/common/graph/GraphMutationTest.java b/guava-tests/test/com/google/common/graph/GraphMutationTest.java index 82ff96756723..3d8d51d04466 100644 --- a/guava-tests/test/com/google/common/graph/GraphMutationTest.java +++ b/guava-tests/test/com/google/common/graph/GraphMutationTest.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Random; import java.util.RandomAccess; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -30,6 +31,7 @@ /** Tests for repeated node and edge addition and removal in a {@link Graph}. */ @RunWith(JUnit4.class) +@NullUnmarked public final class GraphMutationTest { private static final int NUM_TRIALS = 50; private static final int NUM_NODES = 100; diff --git a/guava-tests/test/com/google/common/graph/GraphPropertiesTest.java b/guava-tests/test/com/google/common/graph/GraphPropertiesTest.java index a6860929048e..bb1d25e77f99 100644 --- a/guava-tests/test/com/google/common/graph/GraphPropertiesTest.java +++ b/guava-tests/test/com/google/common/graph/GraphPropertiesTest.java @@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat; import com.google.common.collect.ImmutableList; +import org.jspecify.annotations.NullUnmarked; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -28,6 +29,7 @@ /** Tests for {@link Graphs#hasCycle(Graph)} and {@link Graphs#hasCycle(Network)}. */ // TODO(user): Consider moving this to GraphsTest. @RunWith(JUnit4.class) +@NullUnmarked public class GraphPropertiesTest { ImmutableList> graphsToTest; Graph directedGraph; diff --git a/guava-tests/test/com/google/common/graph/GraphsTest.java b/guava-tests/test/com/google/common/graph/GraphsTest.java index ff59ff7a5d71..4be09009d080 100644 --- a/guava-tests/test/com/google/common/graph/GraphsTest.java +++ b/guava-tests/test/com/google/common/graph/GraphsTest.java @@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableSet; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -35,6 +36,7 @@ * the missing nodes to the graph, then adds the edge between them. */ @RunWith(JUnit4.class) +@NullUnmarked public class GraphsTest { private static final Integer N1 = 1; private static final Integer N2 = 2; diff --git a/guava-tests/test/com/google/common/graph/ImmutableNetworkTest.java b/guava-tests/test/com/google/common/graph/ImmutableNetworkTest.java index 5de3cf751f8e..9d4889fd2634 100644 --- a/guava-tests/test/com/google/common/graph/ImmutableNetworkTest.java +++ b/guava-tests/test/com/google/common/graph/ImmutableNetworkTest.java @@ -18,12 +18,14 @@ import static com.google.common.truth.Truth.assertThat; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Tests for {@link ImmutableNetwork}. */ @RunWith(JUnit4.class) +@NullUnmarked public class ImmutableNetworkTest { @Test diff --git a/guava-tests/test/com/google/common/graph/ImmutableValueGraphTest.java b/guava-tests/test/com/google/common/graph/ImmutableValueGraphTest.java index 8e5e67f3046e..43f48d91c986 100644 --- a/guava-tests/test/com/google/common/graph/ImmutableValueGraphTest.java +++ b/guava-tests/test/com/google/common/graph/ImmutableValueGraphTest.java @@ -18,12 +18,14 @@ import static com.google.common.truth.Truth.assertThat; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Tests for {@link ImmutableValueGraph} . */ @RunWith(JUnit4.class) +@NullUnmarked public class ImmutableValueGraphTest { @Test diff --git a/guava-tests/test/com/google/common/graph/InvalidatableSetTest.java b/guava-tests/test/com/google/common/graph/InvalidatableSetTest.java index 1af877f39f87..1f393acd25ce 100644 --- a/guava-tests/test/com/google/common/graph/InvalidatableSetTest.java +++ b/guava-tests/test/com/google/common/graph/InvalidatableSetTest.java @@ -6,12 +6,14 @@ import com.google.common.collect.ImmutableSet; import java.util.HashSet; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) +@NullUnmarked public final class InvalidatableSetTest { Set wrappedSet; Set copyOfWrappedSet; diff --git a/guava-tests/test/com/google/common/graph/MapCacheTest.java b/guava-tests/test/com/google/common/graph/MapCacheTest.java index f04f010c84c9..e129443530f8 100644 --- a/guava-tests/test/com/google/common/graph/MapCacheTest.java +++ b/guava-tests/test/com/google/common/graph/MapCacheTest.java @@ -24,6 +24,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.TreeMap; +import org.jspecify.annotations.NullUnmarked; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,6 +35,7 @@ @AndroidIncompatible // TODO(cpovirk): Figure out Android JUnit 4 support. Does it work with Gingerbread? @RunWith? @RunWith(Parameterized.class) +@NullUnmarked public final class MapCacheTest { private final MapIteratorCache mapCache; diff --git a/guava-tests/test/com/google/common/graph/NetworkEquivalenceTest.java b/guava-tests/test/com/google/common/graph/NetworkEquivalenceTest.java index 69d18fa1b039..de8ff654c9fb 100644 --- a/guava-tests/test/com/google/common/graph/NetworkEquivalenceTest.java +++ b/guava-tests/test/com/google/common/graph/NetworkEquivalenceTest.java @@ -23,6 +23,7 @@ import com.google.common.graph.TestUtil.EdgeType; import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -31,6 +32,7 @@ @AndroidIncompatible // TODO(cpovirk): Figure out Android JUnit 4 support. Does it work with Gingerbread? @RunWith? @RunWith(Parameterized.class) +@NullUnmarked public final class NetworkEquivalenceTest { private static final Integer N1 = 1; private static final Integer N2 = 2; diff --git a/guava-tests/test/com/google/common/graph/NetworkMutationTest.java b/guava-tests/test/com/google/common/graph/NetworkMutationTest.java index 5be0ae02b895..f3629370c9e5 100644 --- a/guava-tests/test/com/google/common/graph/NetworkMutationTest.java +++ b/guava-tests/test/com/google/common/graph/NetworkMutationTest.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Random; import java.util.RandomAccess; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -30,6 +31,7 @@ /** Tests for repeated node and edge addition and removal in a {@link Network}. */ @RunWith(JUnit4.class) +@NullUnmarked public final class NetworkMutationTest { private static final int NUM_TRIALS = 5; private static final int NUM_NODES = 20; diff --git a/guava-tests/test/com/google/common/graph/PackageSanityTests.java b/guava-tests/test/com/google/common/graph/PackageSanityTests.java index 97753f7ab671..8b241a2ab123 100644 --- a/guava-tests/test/com/google/common/graph/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/graph/PackageSanityTests.java @@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertWithMessage; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Covers basic sanity checks for the entire package. @@ -27,6 +28,7 @@ * @author Kurt Alfred Kluever */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { private static final AbstractGraphBuilder GRAPH_BUILDER_A = diff --git a/guava-tests/test/com/google/common/graph/StandardImmutableDirectedGraphTest.java b/guava-tests/test/com/google/common/graph/StandardImmutableDirectedGraphTest.java index d89baa0634bc..710f7890526b 100644 --- a/guava-tests/test/com/google/common/graph/StandardImmutableDirectedGraphTest.java +++ b/guava-tests/test/com/google/common/graph/StandardImmutableDirectedGraphTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -25,6 +26,7 @@ /** Tests for a directed {@link StandardMutableGraph}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public final class StandardImmutableDirectedGraphTest extends AbstractStandardDirectedGraphTest { @Parameters(name = "allowsSelfLoops={0}") diff --git a/guava-tests/test/com/google/common/graph/StandardImmutableDirectedNetworkTest.java b/guava-tests/test/com/google/common/graph/StandardImmutableDirectedNetworkTest.java index b237ff91f07c..bc3e194d969b 100644 --- a/guava-tests/test/com/google/common/graph/StandardImmutableDirectedNetworkTest.java +++ b/guava-tests/test/com/google/common/graph/StandardImmutableDirectedNetworkTest.java @@ -19,6 +19,7 @@ import com.google.common.collect.Ordering; import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -26,6 +27,7 @@ /** Tests for a directed {@link ImmutableNetwork}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public class StandardImmutableDirectedNetworkTest extends AbstractStandardDirectedNetworkTest { @Parameters(name = "allowsSelfLoops={0}, allowsParallelEdges={1}, nodeOrder={2}, edgeOrder={3}") diff --git a/guava-tests/test/com/google/common/graph/StandardImmutableGraphAdditionalTest.java b/guava-tests/test/com/google/common/graph/StandardImmutableGraphAdditionalTest.java index 47cd6a037426..1a709ac6a227 100644 --- a/guava-tests/test/com/google/common/graph/StandardImmutableGraphAdditionalTest.java +++ b/guava-tests/test/com/google/common/graph/StandardImmutableGraphAdditionalTest.java @@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -27,6 +28,7 @@ * {@link StandardImmutableDirectedGraphTest}. */ @RunWith(JUnit4.class) +@NullUnmarked public class StandardImmutableGraphAdditionalTest { @Test diff --git a/guava-tests/test/com/google/common/graph/StandardImmutableUndirectedGraphTest.java b/guava-tests/test/com/google/common/graph/StandardImmutableUndirectedGraphTest.java index 7f580a6db80d..290306d4a09d 100644 --- a/guava-tests/test/com/google/common/graph/StandardImmutableUndirectedGraphTest.java +++ b/guava-tests/test/com/google/common/graph/StandardImmutableUndirectedGraphTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -25,6 +26,7 @@ /** Tests for an undirected {@link StandardMutableGraph}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public final class StandardImmutableUndirectedGraphTest extends AbstractStandardUndirectedGraphTest { diff --git a/guava-tests/test/com/google/common/graph/StandardMutableDirectedGraphTest.java b/guava-tests/test/com/google/common/graph/StandardMutableDirectedGraphTest.java index 191010e48f40..8b849a8cd2c6 100644 --- a/guava-tests/test/com/google/common/graph/StandardMutableDirectedGraphTest.java +++ b/guava-tests/test/com/google/common/graph/StandardMutableDirectedGraphTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -25,6 +26,7 @@ /** Tests for a directed {@link StandardMutableGraph}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public final class StandardMutableDirectedGraphTest extends AbstractStandardDirectedGraphTest { @Parameters(name = "allowsSelfLoops={0}, incidentEdgeOrder={1}") diff --git a/guava-tests/test/com/google/common/graph/StandardMutableDirectedNetworkTest.java b/guava-tests/test/com/google/common/graph/StandardMutableDirectedNetworkTest.java index fb8be1d34d7a..1e8960a39c86 100644 --- a/guava-tests/test/com/google/common/graph/StandardMutableDirectedNetworkTest.java +++ b/guava-tests/test/com/google/common/graph/StandardMutableDirectedNetworkTest.java @@ -19,6 +19,7 @@ import com.google.common.collect.Ordering; import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -26,6 +27,7 @@ /** Tests for a directed {@link StandardMutableNetwork} allowing self-loops. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public class StandardMutableDirectedNetworkTest extends AbstractStandardDirectedNetworkTest { @Parameters(name = "allowsSelfLoops={0}, allowsParallelEdges={1}, nodeOrder={2}, edgeOrder={3}") diff --git a/guava-tests/test/com/google/common/graph/StandardMutableUndirectedGraphTest.java b/guava-tests/test/com/google/common/graph/StandardMutableUndirectedGraphTest.java index aa0372aa8aae..fdb3bef224e6 100644 --- a/guava-tests/test/com/google/common/graph/StandardMutableUndirectedGraphTest.java +++ b/guava-tests/test/com/google/common/graph/StandardMutableUndirectedGraphTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -25,6 +26,7 @@ /** Tests for an undirected {@link StandardMutableGraph}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public class StandardMutableUndirectedGraphTest extends AbstractStandardUndirectedGraphTest { @Parameters(name = "allowsSelfLoops={0}, incidentEdgeOrder={1}") diff --git a/guava-tests/test/com/google/common/graph/StandardMutableUndirectedNetworkTest.java b/guava-tests/test/com/google/common/graph/StandardMutableUndirectedNetworkTest.java index c021b5d17354..f5e12b33f7ef 100644 --- a/guava-tests/test/com/google/common/graph/StandardMutableUndirectedNetworkTest.java +++ b/guava-tests/test/com/google/common/graph/StandardMutableUndirectedNetworkTest.java @@ -19,6 +19,7 @@ import com.google.common.collect.Ordering; import java.util.Arrays; import java.util.Collection; +import org.jspecify.annotations.NullUnmarked; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -26,6 +27,7 @@ /** Tests for an undirected {@link StandardMutableNetwork}. */ @AndroidIncompatible @RunWith(Parameterized.class) +@NullUnmarked public final class StandardMutableUndirectedNetworkTest extends AbstractStandardUndirectedNetworkTest { diff --git a/guava-tests/test/com/google/common/graph/TestUtil.java b/guava-tests/test/com/google/common/graph/TestUtil.java index 95fc75296c3a..8a7dfbef6665 100644 --- a/guava-tests/test/com/google/common/graph/TestUtil.java +++ b/guava-tests/test/com/google/common/graph/TestUtil.java @@ -22,8 +22,10 @@ import com.google.common.collect.Iterators; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; /** Utility methods used in various common.graph tests. */ +@NullUnmarked final class TestUtil { static final String ERROR_ELEMENT_NOT_IN_GRAPH = "not an element of this graph"; static final String ERROR_NODE_NOT_IN_GRAPH = diff --git a/guava-tests/test/com/google/common/graph/TraverserTest.java b/guava-tests/test/com/google/common/graph/TraverserTest.java index a941b95290c1..5694d7f69ad8 100644 --- a/guava-tests/test/com/google/common/graph/TraverserTest.java +++ b/guava-tests/test/com/google/common/graph/TraverserTest.java @@ -30,11 +30,13 @@ import com.google.common.collect.Multiset; import com.google.common.collect.Ordering; import com.google.common.primitives.Chars; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) +@NullUnmarked public class TraverserTest { /** diff --git a/guava-tests/test/com/google/common/graph/ValueGraphTest.java b/guava-tests/test/com/google/common/graph/ValueGraphTest.java index 9920eac27844..2e91de5820b8 100644 --- a/guava-tests/test/com/google/common/graph/ValueGraphTest.java +++ b/guava-tests/test/com/google/common/graph/ValueGraphTest.java @@ -28,6 +28,7 @@ import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.After; import org.junit.Test; @@ -37,6 +38,7 @@ /** Tests for {@link StandardMutableValueGraph} and related functionality. */ // TODO(user): Expand coverage and move to proper test suite. @RunWith(JUnit4.class) +@NullUnmarked public final class ValueGraphTest { private static final String DEFAULT = "default"; diff --git a/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java b/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java index 9bd2b4b90fee..fe35bf3d9820 100644 --- a/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java +++ b/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java @@ -21,12 +21,14 @@ import java.io.ByteArrayOutputStream; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for AbstractByteHasher. * * @author Colin Decker */ +@NullUnmarked public class AbstractByteHasherTest extends TestCase { public void testBytes() { diff --git a/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java b/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java index 754147152fd9..281ec4fef5a4 100644 --- a/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java +++ b/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java @@ -24,8 +24,10 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for AbstractNonStreamingHashFunction. */ +@NullUnmarked public class AbstractNonStreamingHashFunctionTest extends TestCase { /** * Constructs two trivial HashFunctions (output := input), one streaming and one non-streaming, diff --git a/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java b/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java index 9373681c1f9e..2a93936a90ef 100644 --- a/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java +++ b/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java @@ -30,12 +30,14 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for AbstractStreamingHasher. * * @author Dimitris Andreou */ +@NullUnmarked public class AbstractStreamingHasherTest extends TestCase { public void testBytes() { Sink sink = new Sink(4); // byte order insignificant here diff --git a/guava-tests/test/com/google/common/hash/BloomFilterTest.java b/guava-tests/test/com/google/common/hash/BloomFilterTest.java index 91c183c6322d..06b28eee645f 100644 --- a/guava-tests/test/com/google/common/hash/BloomFilterTest.java +++ b/guava-tests/test/com/google/common/hash/BloomFilterTest.java @@ -38,6 +38,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -45,6 +46,7 @@ * * @author Dimitris Andreou */ +@NullUnmarked public class BloomFilterTest extends TestCase { private static final int NUM_PUTS = 100_000; private static final ThreadLocal random = diff --git a/guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java b/guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java index 14a106a62825..1cdc8cdfcf8c 100644 --- a/guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java +++ b/guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java @@ -19,12 +19,14 @@ import java.util.zip.Checksum; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for ChecksumHashFunction. * * @author Colin Decker */ +@NullUnmarked public class ChecksumHashFunctionTest extends TestCase { public void testCrc32_equalsChecksumValue() throws Exception { diff --git a/guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java b/guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java index af0481ae5b79..03a0cf1490cf 100644 --- a/guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java +++ b/guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Crc32c}. Known test values are from RFC 3720, Section B.4. @@ -26,6 +27,7 @@ * @author Patrick Costello * @author Kurt Alfred Kluever */ +@NullUnmarked public class Crc32cHashFunctionTest extends TestCase { public void testEmpty() { assertCrc(0, new byte[0]); diff --git a/guava-tests/test/com/google/common/hash/FarmHashFingerprint64Test.java b/guava-tests/test/com/google/common/hash/FarmHashFingerprint64Test.java index 3a27f1109ee8..ec7023a16cd7 100644 --- a/guava-tests/test/com/google/common/hash/FarmHashFingerprint64Test.java +++ b/guava-tests/test/com/google/common/hash/FarmHashFingerprint64Test.java @@ -23,6 +23,7 @@ import com.google.common.base.Strings; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for FarmHashFingerprint64. @@ -30,6 +31,7 @@ * @author Kyle Maddison * @author Geoff Pike */ +@NullUnmarked public class FarmHashFingerprint64Test extends TestCase { private static final HashFunction HASH_FN = Hashing.farmHashFingerprint64(); diff --git a/guava-tests/test/com/google/common/hash/Fingerprint2011Test.java b/guava-tests/test/com/google/common/hash/Fingerprint2011Test.java index 7aafe77ced2c..d8db779ceda9 100644 --- a/guava-tests/test/com/google/common/hash/Fingerprint2011Test.java +++ b/guava-tests/test/com/google/common/hash/Fingerprint2011Test.java @@ -12,12 +12,14 @@ import com.google.common.primitives.UnsignedLong; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for Fingerprint2011. * * @author kylemaddison@google.com (Kyle Maddison) */ +@NullUnmarked public class Fingerprint2011Test extends TestCase { // Length of the sample string to produce diff --git a/guava-tests/test/com/google/common/hash/FunnelsTest.java b/guava-tests/test/com/google/common/hash/FunnelsTest.java index 653f0a81d1fa..862ddcb6d153 100644 --- a/guava-tests/test/com/google/common/hash/FunnelsTest.java +++ b/guava-tests/test/com/google/common/hash/FunnelsTest.java @@ -29,6 +29,7 @@ import java.nio.charset.Charset; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.mockito.InOrder; /** @@ -36,6 +37,7 @@ * * @author Dimitris Andreou */ +@NullUnmarked public class FunnelsTest extends TestCase { public void testForBytes() { PrimitiveSink primitiveSink = mock(PrimitiveSink.class); diff --git a/guava-tests/test/com/google/common/hash/HashCodeTest.java b/guava-tests/test/com/google/common/hash/HashCodeTest.java index 3de5fd043011..7e2b051ccbe0 100644 --- a/guava-tests/test/com/google/common/hash/HashCodeTest.java +++ b/guava-tests/test/com/google/common/hash/HashCodeTest.java @@ -25,6 +25,7 @@ import com.google.common.testing.ClassSanityTester; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -33,6 +34,7 @@ * @author Dimitris Andreou * @author Kurt Alfred Kluever */ +@NullUnmarked public class HashCodeTest extends TestCase { // note: asInt(), asLong() are in little endian private static final ImmutableList expectedHashCodes = diff --git a/guava-tests/test/com/google/common/hash/HashFunctionEnum.java b/guava-tests/test/com/google/common/hash/HashFunctionEnum.java index 34717477e645..fde53a30d6a1 100644 --- a/guava-tests/test/com/google/common/hash/HashFunctionEnum.java +++ b/guava-tests/test/com/google/common/hash/HashFunctionEnum.java @@ -16,12 +16,14 @@ package com.google.common.hash; +import org.jspecify.annotations.NullUnmarked; /** * An enum that contains all of the known hash functions. * * @author Kurt Alfred Kluever */ +@NullUnmarked enum HashFunctionEnum { ADLER32(Hashing.adler32()), CRC32(Hashing.crc32()), diff --git a/guava-tests/test/com/google/common/hash/HashTestUtils.java b/guava-tests/test/com/google/common/hash/HashTestUtils.java index 668119458790..85096df34df9 100644 --- a/guava-tests/test/com/google/common/hash/HashTestUtils.java +++ b/guava-tests/test/com/google/common/hash/HashTestUtils.java @@ -36,6 +36,7 @@ import java.util.Arrays; import java.util.Random; import java.util.Set; +import org.jspecify.annotations.NullUnmarked; import org.junit.Assert; /** @@ -44,6 +45,7 @@ * @author Dimitris Andreou * @author Kurt Alfred Kluever */ +@NullUnmarked final class HashTestUtils { private HashTestUtils() {} diff --git a/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java b/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java index 05351d94cdde..51c65cb5f78e 100644 --- a/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java +++ b/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java @@ -23,12 +23,14 @@ import java.io.ByteArrayInputStream; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link HashingInputStream}. * * @author Qian Huang */ +@NullUnmarked public class HashingInputStreamTest extends TestCase { private Hasher hasher; private HashFunction hashFunction; diff --git a/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java b/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java index 60eef10f0a60..9f4bf00f848d 100644 --- a/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java +++ b/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java @@ -22,12 +22,14 @@ import com.google.common.testing.NullPointerTester; import java.io.ByteArrayOutputStream; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link HashingOutputStream}. * * @author Zoe Piepmeier */ +@NullUnmarked public class HashingOutputStreamTest extends TestCase { private Hasher hasher; private HashFunction hashFunction; diff --git a/guava-tests/test/com/google/common/hash/HashingTest.java b/guava-tests/test/com/google/common/hash/HashingTest.java index bb71d1fbc848..a9d4433b3ea8 100644 --- a/guava-tests/test/com/google/common/hash/HashingTest.java +++ b/guava-tests/test/com/google/common/hash/HashingTest.java @@ -37,6 +37,7 @@ import java.util.Locale; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Hashing}. @@ -47,6 +48,7 @@ * @author Dimitris Andreou * @author Kurt Alfred Kluever */ +@NullUnmarked public class HashingTest extends TestCase { public void testMd5() { HashTestUtils.checkAvalanche(Hashing.md5(), 100, 0.4); diff --git a/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java b/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java index 2b118783c9c9..5d9d6489a458 100644 --- a/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java +++ b/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java @@ -30,6 +30,7 @@ import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import sun.security.jca.ProviderList; import sun.security.jca.Providers; @@ -39,6 +40,7 @@ * * @author Kurt Alfred Kluever */ +@NullUnmarked public class MacHashFunctionTest extends TestCase { private static final ImmutableSet INPUTS = ImmutableSet.of("", "Z", "foobar"); diff --git a/guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java b/guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java index c58d50d54352..127b0e7eeac7 100644 --- a/guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java +++ b/guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java @@ -25,12 +25,14 @@ import java.security.NoSuchAlgorithmException; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the MessageDigestHashFunction. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class MessageDigestHashFunctionTest extends TestCase { private static final ImmutableSet INPUTS = ImmutableSet.of("", "Z", "foobar"); diff --git a/guava-tests/test/com/google/common/hash/Murmur3Hash128Test.java b/guava-tests/test/com/google/common/hash/Murmur3Hash128Test.java index 35d423b45638..be1d5fb548f9 100644 --- a/guava-tests/test/com/google/common/hash/Murmur3Hash128Test.java +++ b/guava-tests/test/com/google/common/hash/Murmur3Hash128Test.java @@ -23,8 +23,10 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link Murmur3_128HashFunction}. */ +@NullUnmarked public class Murmur3Hash128Test extends TestCase { public void testKnownValues() { assertHash(0, 0x629942693e10f867L, 0x92db0b82baeb5347L, "hell"); diff --git a/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java b/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java index 704d9dbd4fc5..3728b44b5bf7 100644 --- a/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java +++ b/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java @@ -26,8 +26,10 @@ import java.nio.charset.Charset; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link Murmur3_32HashFunction}. */ +@NullUnmarked public class Murmur3Hash32Test extends TestCase { public void testKnownIntegerInputs() { assertHash(593689054, murmur3_32().hashInt(0)); diff --git a/guava-tests/test/com/google/common/hash/PackageSanityTests.java b/guava-tests/test/com/google/common/hash/PackageSanityTests.java index d2b0ef5261bb..e81d60515839 100644 --- a/guava-tests/test/com/google/common/hash/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/hash/PackageSanityTests.java @@ -18,6 +18,7 @@ import com.google.common.hash.BloomFilterStrategies.LockFreeBitArray; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -25,6 +26,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { setDefault(LockFreeBitArray.class, new LockFreeBitArray(1)); diff --git a/guava-tests/test/com/google/common/hash/SipHashFunctionTest.java b/guava-tests/test/com/google/common/hash/SipHashFunctionTest.java index 8effde04576f..64ff4e20c99d 100644 --- a/guava-tests/test/com/google/common/hash/SipHashFunctionTest.java +++ b/guava-tests/test/com/google/common/hash/SipHashFunctionTest.java @@ -18,12 +18,14 @@ import com.google.common.collect.ImmutableSet; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link SipHashFunction}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class SipHashFunctionTest extends TestCase { // From https://131002.net/siphash/siphash24.c diff --git a/guava-tests/test/com/google/common/html/HtmlEscapersTest.java b/guava-tests/test/com/google/common/html/HtmlEscapersTest.java index 776aa4c75eff..3f7b4a5b0805 100644 --- a/guava-tests/test/com/google/common/html/HtmlEscapersTest.java +++ b/guava-tests/test/com/google/common/html/HtmlEscapersTest.java @@ -18,6 +18,7 @@ import com.google.common.annotations.GwtCompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the {@link HtmlEscapers} class. @@ -25,6 +26,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked public class HtmlEscapersTest extends TestCase { public void testHtmlEscaper() throws Exception { diff --git a/guava-tests/test/com/google/common/io/AppendableWriterTest.java b/guava-tests/test/com/google/common/io/AppendableWriterTest.java index bfc6a082fa3d..7784e2d6b4bc 100644 --- a/guava-tests/test/com/google/common/io/AppendableWriterTest.java +++ b/guava-tests/test/com/google/common/io/AppendableWriterTest.java @@ -22,12 +22,14 @@ import java.io.Flushable; import java.io.IOException; import java.io.Writer; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link AppendableWriter}. * * @author Alan Green */ +@NullUnmarked public class AppendableWriterTest extends IoTestCase { /** Helper class for testing behavior with Flushable and Closeable targets. */ diff --git a/guava-tests/test/com/google/common/io/BaseEncodingTest.java b/guava-tests/test/com/google/common/io/BaseEncodingTest.java index 25b9787235cd..93d62cbe8553 100644 --- a/guava-tests/test/com/google/common/io/BaseEncodingTest.java +++ b/guava-tests/test/com/google/common/io/BaseEncodingTest.java @@ -37,6 +37,7 @@ import java.io.StringReader; import java.io.StringWriter; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -45,6 +46,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class BaseEncodingTest extends TestCase { public void testSeparatorsExplicitly() { diff --git a/guava-tests/test/com/google/common/io/ByteSinkTest.java b/guava-tests/test/com/google/common/io/ByteSinkTest.java index 4ce3981c0304..6fd8b634750a 100644 --- a/guava-tests/test/com/google/common/io/ByteSinkTest.java +++ b/guava-tests/test/com/google/common/io/ByteSinkTest.java @@ -27,12 +27,14 @@ import java.io.IOException; import java.io.OutputStream; import java.util.EnumSet; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the default implementations of {@code ByteSink} methods. * * @author Colin Decker */ +@NullUnmarked public class ByteSinkTest extends IoTestCase { private final byte[] bytes = newPreFilledByteArray(10000); diff --git a/guava-tests/test/com/google/common/io/ByteSinkTester.java b/guava-tests/test/com/google/common/io/ByteSinkTester.java index 18869eaa8b15..ebbaf5c1080f 100644 --- a/guava-tests/test/com/google/common/io/ByteSinkTester.java +++ b/guava-tests/test/com/google/common/io/ByteSinkTester.java @@ -28,6 +28,7 @@ import java.lang.reflect.Method; import java.util.Map.Entry; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * A generator of {@code TestSuite} instances for testing {@code ByteSink} implementations. @@ -37,6 +38,7 @@ * @author Colin Decker */ @AndroidIncompatible // TODO(b/230620681): Make this available (even though we won't run it). +@NullUnmarked public class ByteSinkTester extends SourceSinkTester { private static final ImmutableList testMethods = getTestMethods(ByteSinkTester.class); diff --git a/guava-tests/test/com/google/common/io/ByteSourceTest.java b/guava-tests/test/com/google/common/io/ByteSourceTest.java index 9a8f25fb4bc4..723224717d99 100644 --- a/guava-tests/test/com/google/common/io/ByteSourceTest.java +++ b/guava-tests/test/com/google/common/io/ByteSourceTest.java @@ -42,6 +42,7 @@ import java.util.Arrays; import java.util.EnumSet; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -49,6 +50,7 @@ * * @author Colin Decker */ +@NullUnmarked public class ByteSourceTest extends IoTestCase { @AndroidIncompatible // Android doesn't understand suites whose tests lack default constructors. diff --git a/guava-tests/test/com/google/common/io/ByteSourceTester.java b/guava-tests/test/com/google/common/io/ByteSourceTester.java index cbd7286c133b..4404ada69f6a 100644 --- a/guava-tests/test/com/google/common/io/ByteSourceTester.java +++ b/guava-tests/test/com/google/common/io/ByteSourceTester.java @@ -35,6 +35,7 @@ import java.util.Map.Entry; import java.util.Random; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * A generator of {@code TestSuite} instances for testing {@code ByteSource} implementations. @@ -45,6 +46,7 @@ * @author Colin Decker */ @AndroidIncompatible // TODO(b/230620681): Make this available (even though we won't run it). +@NullUnmarked public class ByteSourceTester extends SourceSinkTester { private static final ImmutableList testMethods = getTestMethods(ByteSourceTester.class); diff --git a/guava-tests/test/com/google/common/io/ByteStreamsTest.java b/guava-tests/test/com/google/common/io/ByteStreamsTest.java index c5f552dd0924..9c0048f0ca5d 100644 --- a/guava-tests/test/com/google/common/io/ByteStreamsTest.java +++ b/guava-tests/test/com/google/common/io/ByteStreamsTest.java @@ -37,12 +37,14 @@ import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ByteStreams}. * * @author Chris Nokleberg */ +@NullUnmarked public class ByteStreamsTest extends IoTestCase { public void testCopyChannel() throws IOException { diff --git a/guava-tests/test/com/google/common/io/CharSequenceReaderTest.java b/guava-tests/test/com/google/common/io/CharSequenceReaderTest.java index 6a4b3c472208..bb97b591ffd7 100644 --- a/guava-tests/test/com/google/common/io/CharSequenceReaderTest.java +++ b/guava-tests/test/com/google/common/io/CharSequenceReaderTest.java @@ -21,12 +21,14 @@ import java.io.IOException; import java.nio.CharBuffer; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link CharSequenceReader}. * * @author Colin Decker */ +@NullUnmarked public class CharSequenceReaderTest extends TestCase { public void testReadEmptyString() throws IOException { diff --git a/guava-tests/test/com/google/common/io/CharSinkTest.java b/guava-tests/test/com/google/common/io/CharSinkTest.java index 3718c278d58d..d2d59d35be0f 100644 --- a/guava-tests/test/com/google/common/io/CharSinkTest.java +++ b/guava-tests/test/com/google/common/io/CharSinkTest.java @@ -28,12 +28,14 @@ import java.io.StringReader; import java.io.Writer; import java.util.EnumSet; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the default implementations of {@code CharSink} methods. * * @author Colin Decker */ +@NullUnmarked public class CharSinkTest extends IoTestCase { private static final String STRING = ASCII + I18N; diff --git a/guava-tests/test/com/google/common/io/CharSinkTester.java b/guava-tests/test/com/google/common/io/CharSinkTester.java index 4c8d3db1b6bb..f42d250e32db 100644 --- a/guava-tests/test/com/google/common/io/CharSinkTester.java +++ b/guava-tests/test/com/google/common/io/CharSinkTester.java @@ -24,6 +24,7 @@ import java.lang.reflect.Method; import java.util.Map.Entry; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * A generator of {@code TestSuite} instances for testing {@code CharSink} implementations. @@ -32,6 +33,7 @@ * @author Colin Decker */ @AndroidIncompatible // TODO(b/230620681): Make this available (even though we won't run it). +@NullUnmarked public class CharSinkTester extends SourceSinkTester { private static final ImmutableList testMethods = getTestMethods(CharSinkTester.class); diff --git a/guava-tests/test/com/google/common/io/CharSourceTest.java b/guava-tests/test/com/google/common/io/CharSourceTest.java index e59bfcb6448c..165f27f887e3 100644 --- a/guava-tests/test/com/google/common/io/CharSourceTest.java +++ b/guava-tests/test/com/google/common/io/CharSourceTest.java @@ -37,12 +37,14 @@ import java.util.List; import java.util.stream.Stream; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the default implementations of {@code CharSource} methods. * * @author Colin Decker */ +@NullUnmarked public class CharSourceTest extends IoTestCase { @AndroidIncompatible // Android doesn't understand suites whose tests lack default constructors. diff --git a/guava-tests/test/com/google/common/io/CharSourceTester.java b/guava-tests/test/com/google/common/io/CharSourceTester.java index b217dc743fdd..1dcec679a757 100644 --- a/guava-tests/test/com/google/common/io/CharSourceTester.java +++ b/guava-tests/test/com/google/common/io/CharSourceTester.java @@ -33,6 +33,7 @@ import java.util.Map.Entry; import java.util.stream.Stream; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * A generator of {@code TestSuite} instances for testing {@code CharSource} implementations. @@ -42,6 +43,7 @@ * @author Colin Decker */ @AndroidIncompatible // TODO(b/230620681): Make this available (even though we won't run it). +@NullUnmarked public class CharSourceTester extends SourceSinkTester { private static final ImmutableList testMethods = getTestMethods(CharSourceTester.class); diff --git a/guava-tests/test/com/google/common/io/CharStreamsTest.java b/guava-tests/test/com/google/common/io/CharStreamsTest.java index e33574e45834..f36a1dcc74a4 100644 --- a/guava-tests/test/com/google/common/io/CharStreamsTest.java +++ b/guava-tests/test/com/google/common/io/CharStreamsTest.java @@ -29,12 +29,14 @@ import java.io.Writer; import java.nio.CharBuffer; import java.util.List; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link CharStreams}. * * @author Chris Nokleberg */ +@NullUnmarked public class CharStreamsTest extends IoTestCase { private static final String TEXT = "The quick brown fox jumped over the lazy dog."; diff --git a/guava-tests/test/com/google/common/io/CloseablesTest.java b/guava-tests/test/com/google/common/io/CloseablesTest.java index 34648b46e88d..2ac954c11f34 100644 --- a/guava-tests/test/com/google/common/io/CloseablesTest.java +++ b/guava-tests/test/com/google/common/io/CloseablesTest.java @@ -26,6 +26,7 @@ import java.io.InputStream; import java.io.Reader; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Closeables}. @@ -35,6 +36,7 @@ * * @author Michael Lancaster */ +@NullUnmarked public class CloseablesTest extends TestCase { private Closeable mockCloseable; diff --git a/guava-tests/test/com/google/common/io/CloserTest.java b/guava-tests/test/com/google/common/io/CloserTest.java index 6dce40fda390..f906c4c793f8 100644 --- a/guava-tests/test/com/google/common/io/CloserTest.java +++ b/guava-tests/test/com/google/common/io/CloserTest.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -36,6 +37,7 @@ * * @author Colin Decker */ +@NullUnmarked public class CloserTest extends TestCase { private TestSuppressor suppressor; diff --git a/guava-tests/test/com/google/common/io/CountingInputStreamTest.java b/guava-tests/test/com/google/common/io/CountingInputStreamTest.java index 945f5d023386..20212ae40955 100644 --- a/guava-tests/test/com/google/common/io/CountingInputStreamTest.java +++ b/guava-tests/test/com/google/common/io/CountingInputStreamTest.java @@ -22,12 +22,14 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link CountingInputStream}. * * @author Chris Nokleberg */ +@NullUnmarked public class CountingInputStreamTest extends IoTestCase { private CountingInputStream counter; diff --git a/guava-tests/test/com/google/common/io/CountingOutputStreamTest.java b/guava-tests/test/com/google/common/io/CountingOutputStreamTest.java index d5023492b381..6a1a1e70180d 100644 --- a/guava-tests/test/com/google/common/io/CountingOutputStreamTest.java +++ b/guava-tests/test/com/google/common/io/CountingOutputStreamTest.java @@ -19,12 +19,14 @@ import static org.junit.Assert.assertThrows; import java.io.ByteArrayOutputStream; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link CountingOutputStream}. * * @author Chris Nokleberg */ +@NullUnmarked public class CountingOutputStreamTest extends IoTestCase { public void testCount() throws Exception { diff --git a/guava-tests/test/com/google/common/io/FileBackedOutputStreamAndroidIncompatibleTest.java b/guava-tests/test/com/google/common/io/FileBackedOutputStreamAndroidIncompatibleTest.java index 4ecdcf8d5688..1386de3c45b6 100644 --- a/guava-tests/test/com/google/common/io/FileBackedOutputStreamAndroidIncompatibleTest.java +++ b/guava-tests/test/com/google/common/io/FileBackedOutputStreamAndroidIncompatibleTest.java @@ -20,6 +20,7 @@ import com.google.common.testing.GcFinalization; import java.io.File; +import org.jspecify.annotations.NullUnmarked; /** * Android-incompatible tests for {@link FileBackedOutputStream}. @@ -27,6 +28,7 @@ * @author Chris Nokleberg */ @AndroidIncompatible // Finalization probably just doesn't happen fast enough? +@NullUnmarked public class FileBackedOutputStreamAndroidIncompatibleTest extends IoTestCase { public void testFinalizeDeletesFile() throws Exception { diff --git a/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java b/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java index 2561e2b5c5ed..3cbf5a1028a7 100644 --- a/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java +++ b/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java @@ -30,6 +30,7 @@ import java.nio.file.attribute.PosixFileAttributeView; import java.nio.file.attribute.PosixFileAttributes; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link FileBackedOutputStream}. @@ -38,6 +39,7 @@ * * @author Chris Nokleberg */ +@NullUnmarked public class FileBackedOutputStreamTest extends IoTestCase { diff --git a/guava-tests/test/com/google/common/io/FilesCreateTempDirTest.java b/guava-tests/test/com/google/common/io/FilesCreateTempDirTest.java index 381eef258425..1b15f3c8569b 100644 --- a/guava-tests/test/com/google/common/io/FilesCreateTempDirTest.java +++ b/guava-tests/test/com/google/common/io/FilesCreateTempDirTest.java @@ -30,6 +30,7 @@ import java.nio.file.attribute.PosixFileAttributeView; import java.nio.file.attribute.PosixFileAttributes; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Files#createTempDir}. @@ -38,6 +39,7 @@ */ @SuppressWarnings("deprecation") // tests of a deprecated method +@NullUnmarked public class FilesCreateTempDirTest extends TestCase { public void testCreateTempDir() throws IOException { if (JAVA_IO_TMPDIR.value().equals("/sdcard")) { diff --git a/guava-tests/test/com/google/common/io/FilesFileTraverserTest.java b/guava-tests/test/com/google/common/io/FilesFileTraverserTest.java index 9409d216df62..5353bd709a7b 100644 --- a/guava-tests/test/com/google/common/io/FilesFileTraverserTest.java +++ b/guava-tests/test/com/google/common/io/FilesFileTraverserTest.java @@ -22,6 +22,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.io.File; import java.io.IOException; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Files#fileTraverser()}. @@ -29,6 +30,7 @@ * @author Jens Nyman */ +@NullUnmarked public class FilesFileTraverserTest extends IoTestCase { private File rootDir; diff --git a/guava-tests/test/com/google/common/io/FilesSimplifyPathTest.java b/guava-tests/test/com/google/common/io/FilesSimplifyPathTest.java index 2afd5bf2a843..eb87be285ead 100644 --- a/guava-tests/test/com/google/common/io/FilesSimplifyPathTest.java +++ b/guava-tests/test/com/google/common/io/FilesSimplifyPathTest.java @@ -25,12 +25,14 @@ import java.net.URL; import java.util.Iterator; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Files#simplifyPath}. * * @author Pablo Bellver */ +@NullUnmarked public class FilesSimplifyPathTest extends TestCase { public void testSimplifyEmptyString() { diff --git a/guava-tests/test/com/google/common/io/FilesTest.java b/guava-tests/test/com/google/common/io/FilesTest.java index 6f6603edbdf5..1111471e185e 100644 --- a/guava-tests/test/com/google/common/io/FilesTest.java +++ b/guava-tests/test/com/google/common/io/FilesTest.java @@ -41,6 +41,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Files}. @@ -56,6 +57,7 @@ */ @SuppressWarnings("InlineMeInliner") // many tests of deprecated methods +@NullUnmarked public class FilesTest extends IoTestCase { @AndroidIncompatible // suites, ByteSourceTester (b/230620681) diff --git a/guava-tests/test/com/google/common/io/FlushablesTest.java b/guava-tests/test/com/google/common/io/FlushablesTest.java index b45150a43d44..ddb8bdeace43 100644 --- a/guava-tests/test/com/google/common/io/FlushablesTest.java +++ b/guava-tests/test/com/google/common/io/FlushablesTest.java @@ -23,6 +23,7 @@ import java.io.Flushable; import java.io.IOException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Flushables}. @@ -32,6 +33,7 @@ * * @author Michael Lancaster */ +@NullUnmarked public class FlushablesTest extends TestCase { private Flushable mockFlushable; diff --git a/guava-tests/test/com/google/common/io/IoTestCase.java b/guava-tests/test/com/google/common/io/IoTestCase.java index a5aa6dd44eaa..d188ccf43185 100644 --- a/guava-tests/test/com/google/common/io/IoTestCase.java +++ b/guava-tests/test/com/google/common/io/IoTestCase.java @@ -28,6 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -36,6 +37,7 @@ * @author Chris Nokleberg * @author Colin Decker */ +@NullUnmarked public abstract class IoTestCase extends TestCase { private static final Logger logger = Logger.getLogger(IoTestCase.class.getName()); diff --git a/guava-tests/test/com/google/common/io/LineBufferTest.java b/guava-tests/test/com/google/common/io/LineBufferTest.java index 159d9252728b..eea7686917d6 100644 --- a/guava-tests/test/com/google/common/io/LineBufferTest.java +++ b/guava-tests/test/com/google/common/io/LineBufferTest.java @@ -29,6 +29,7 @@ import java.nio.CharBuffer; import java.util.Arrays; import java.util.List; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link LineBuffer} and {@link LineReader}. @@ -36,6 +37,7 @@ * @author Chris Nokleberg */ @AndroidIncompatible // occasionally very slow +@NullUnmarked public class LineBufferTest extends IoTestCase { public void testProcess() throws IOException { diff --git a/guava-tests/test/com/google/common/io/LittleEndianDataInputStreamTest.java b/guava-tests/test/com/google/common/io/LittleEndianDataInputStreamTest.java index faa0b9549835..e5280bc90aee 100644 --- a/guava-tests/test/com/google/common/io/LittleEndianDataInputStreamTest.java +++ b/guava-tests/test/com/google/common/io/LittleEndianDataInputStreamTest.java @@ -27,12 +27,14 @@ import java.io.EOFException; import java.io.IOException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test class for {@link LittleEndianDataInputStream}. * * @author Chris Nokleberg */ +@NullUnmarked public class LittleEndianDataInputStreamTest extends TestCase { private byte[] data; diff --git a/guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java b/guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java index 8f2f02e7f14f..a1643a62a8b2 100644 --- a/guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java +++ b/guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java @@ -25,12 +25,14 @@ import java.io.DataInputStream; import java.io.IOException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test class for {@link LittleEndianDataOutputStream}. * * @author Keith Bottner */ +@NullUnmarked public class LittleEndianDataOutputStreamTest extends TestCase { private ByteArrayOutputStream baos = new ByteArrayOutputStream(); diff --git a/guava-tests/test/com/google/common/io/MoreFilesFileTraverserTest.java b/guava-tests/test/com/google/common/io/MoreFilesFileTraverserTest.java index 8b26b498ca6a..399d8017e6f2 100644 --- a/guava-tests/test/com/google/common/io/MoreFilesFileTraverserTest.java +++ b/guava-tests/test/com/google/common/io/MoreFilesFileTraverserTest.java @@ -26,6 +26,7 @@ import java.nio.file.Files; import java.nio.file.Path; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link MoreFiles#fileTraverser()}. @@ -33,6 +34,7 @@ * @author Jens Nyman */ +@NullUnmarked public class MoreFilesFileTraverserTest extends TestCase { private Path rootDir; diff --git a/guava-tests/test/com/google/common/io/MoreFilesTest.java b/guava-tests/test/com/google/common/io/MoreFilesTest.java index 4df285ed07b0..1b6dad0b9109 100644 --- a/guava-tests/test/com/google/common/io/MoreFilesTest.java +++ b/guava-tests/test/com/google/common/io/MoreFilesTest.java @@ -47,6 +47,7 @@ import java.util.concurrent.Future; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link MoreFiles}. @@ -56,6 +57,7 @@ * @author Colin Decker */ +@NullUnmarked public class MoreFilesTest extends TestCase { public static TestSuite suite() { diff --git a/guava-tests/test/com/google/common/io/MultiInputStreamTest.java b/guava-tests/test/com/google/common/io/MultiInputStreamTest.java index 2b68595201af..d9e30620ea62 100644 --- a/guava-tests/test/com/google/common/io/MultiInputStreamTest.java +++ b/guava-tests/test/com/google/common/io/MultiInputStreamTest.java @@ -23,12 +23,14 @@ import java.io.InputStream; import java.util.Collections; import java.util.List; +import org.jspecify.annotations.NullUnmarked; /** * Test class for {@link MultiInputStream}. * * @author Chris Nokleberg */ +@NullUnmarked public class MultiInputStreamTest extends IoTestCase { public void testJoin() throws Exception { diff --git a/guava-tests/test/com/google/common/io/MultiReaderTest.java b/guava-tests/test/com/google/common/io/MultiReaderTest.java index 20b4042b6c24..0b335d9da3ac 100644 --- a/guava-tests/test/com/google/common/io/MultiReaderTest.java +++ b/guava-tests/test/com/google/common/io/MultiReaderTest.java @@ -22,8 +22,12 @@ import java.io.Reader; import java.io.StringReader; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author ricebin */ +/** + * @author ricebin + */ +@NullUnmarked public class MultiReaderTest extends TestCase { public void testOnlyOneOpen() throws Exception { diff --git a/guava-tests/test/com/google/common/io/PackageSanityTests.java b/guava-tests/test/com/google/common/io/PackageSanityTests.java index cae49682e796..3beef50c6bae 100644 --- a/guava-tests/test/com/google/common/io/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/io/PackageSanityTests.java @@ -22,6 +22,7 @@ import java.lang.reflect.Method; import java.nio.channels.FileChannel.MapMode; import java.nio.charset.CharsetEncoder; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -29,6 +30,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { setDefault(BaseEncoding.class, BaseEncoding.base64()); diff --git a/guava-tests/test/com/google/common/io/PatternFilenameFilterTest.java b/guava-tests/test/com/google/common/io/PatternFilenameFilterTest.java index 699b2a458999..ecd914ae1821 100644 --- a/guava-tests/test/com/google/common/io/PatternFilenameFilterTest.java +++ b/guava-tests/test/com/google/common/io/PatternFilenameFilterTest.java @@ -24,12 +24,14 @@ import java.io.FilenameFilter; import java.util.regex.PatternSyntaxException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link PatternFilenameFilter}. * * @author Chris Nokleberg */ +@NullUnmarked public class PatternFilenameFilterTest extends TestCase { public void testSyntaxException() { diff --git a/guava-tests/test/com/google/common/io/RandomAmountInputStream.java b/guava-tests/test/com/google/common/io/RandomAmountInputStream.java index d457ec7dcf8c..468db514b4cd 100644 --- a/guava-tests/test/com/google/common/io/RandomAmountInputStream.java +++ b/guava-tests/test/com/google/common/io/RandomAmountInputStream.java @@ -22,8 +22,10 @@ import java.io.IOException; import java.io.InputStream; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** Returns a random portion of the requested bytes on each call. */ +@NullUnmarked class RandomAmountInputStream extends FilterInputStream { private final Random random; diff --git a/guava-tests/test/com/google/common/io/ResourcesTest.java b/guava-tests/test/com/google/common/io/ResourcesTest.java index c5f3e26c2a8f..1e8a3026d7c1 100644 --- a/guava-tests/test/com/google/common/io/ResourcesTest.java +++ b/guava-tests/test/com/google/common/io/ResourcesTest.java @@ -33,6 +33,7 @@ import java.util.ArrayList; import java.util.List; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Resources}. @@ -40,6 +41,7 @@ * @author Chris Nokleberg */ +@NullUnmarked public class ResourcesTest extends IoTestCase { @AndroidIncompatible // wouldn't run anyway, but strip the source entirely because of b/230620681 diff --git a/guava-tests/test/com/google/common/io/SourceSinkFactories.java b/guava-tests/test/com/google/common/io/SourceSinkFactories.java index 4cc8a7306f75..e61ec6d27ede 100644 --- a/guava-tests/test/com/google/common/io/SourceSinkFactories.java +++ b/guava-tests/test/com/google/common/io/SourceSinkFactories.java @@ -41,6 +41,7 @@ import java.util.Arrays; import java.util.logging.Level; import java.util.logging.Logger; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -48,6 +49,7 @@ * * @author Colin Decker */ +@NullUnmarked public class SourceSinkFactories { private SourceSinkFactories() {} diff --git a/guava-tests/test/com/google/common/io/SourceSinkFactory.java b/guava-tests/test/com/google/common/io/SourceSinkFactory.java index b8cbc919ecf5..9d086c0d4ae3 100644 --- a/guava-tests/test/com/google/common/io/SourceSinkFactory.java +++ b/guava-tests/test/com/google/common/io/SourceSinkFactory.java @@ -18,6 +18,7 @@ import java.io.File; import java.io.IOException; +import org.jspecify.annotations.NullUnmarked; /** * A test factory for byte or char sources or sinks. In addition to creating sources or sinks, the @@ -32,6 +33,7 @@ * @param the data type (byte[] or String) * @author Colin Decker */ +@NullUnmarked public interface SourceSinkFactory { /** diff --git a/guava-tests/test/com/google/common/io/SourceSinkTester.java b/guava-tests/test/com/google/common/io/SourceSinkTester.java index 544467f9dfc4..28bf66f853d3 100644 --- a/guava-tests/test/com/google/common/io/SourceSinkTester.java +++ b/guava-tests/test/com/google/common/io/SourceSinkTester.java @@ -28,6 +28,7 @@ import java.lang.reflect.Modifier; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * @param the source or sink type @@ -36,6 +37,7 @@ * @author Colin Decker */ @AndroidIncompatible // TODO(b/230620681): Make this available (even though we won't run it). +@NullUnmarked public class SourceSinkTester> extends TestCase { static final String LOREM_IPSUM = diff --git a/guava-tests/test/com/google/common/io/TestByteSink.java b/guava-tests/test/com/google/common/io/TestByteSink.java index b7eeef0d7ac8..756fdd133d9f 100644 --- a/guava-tests/test/com/google/common/io/TestByteSink.java +++ b/guava-tests/test/com/google/common/io/TestByteSink.java @@ -20,12 +20,14 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; +import org.jspecify.annotations.NullUnmarked; /** * A byte sink for testing that has configurable behavior. * * @author Colin Decker */ +@NullUnmarked public class TestByteSink extends ByteSink implements TestStreamSupplier { private final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); diff --git a/guava-tests/test/com/google/common/io/TestByteSource.java b/guava-tests/test/com/google/common/io/TestByteSource.java index 54ee982dad5e..1f068c423b23 100644 --- a/guava-tests/test/com/google/common/io/TestByteSource.java +++ b/guava-tests/test/com/google/common/io/TestByteSource.java @@ -23,12 +23,14 @@ import java.io.IOException; import java.io.InputStream; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * A byte source for testing that has configurable behavior. * * @author Colin Decker */ +@NullUnmarked public final class TestByteSource extends ByteSource implements TestStreamSupplier { private final byte[] bytes; diff --git a/guava-tests/test/com/google/common/io/TestCharSink.java b/guava-tests/test/com/google/common/io/TestCharSink.java index f98deed59faf..e87642cab8a6 100644 --- a/guava-tests/test/com/google/common/io/TestCharSink.java +++ b/guava-tests/test/com/google/common/io/TestCharSink.java @@ -22,12 +22,14 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; +import org.jspecify.annotations.NullUnmarked; /** * A char sink for testing that has configurable behavior. * * @author Colin Decker */ +@NullUnmarked public class TestCharSink extends CharSink implements TestStreamSupplier { private final TestByteSink byteSink; diff --git a/guava-tests/test/com/google/common/io/TestCharSource.java b/guava-tests/test/com/google/common/io/TestCharSource.java index 8b414db01324..f7c589a33624 100644 --- a/guava-tests/test/com/google/common/io/TestCharSource.java +++ b/guava-tests/test/com/google/common/io/TestCharSource.java @@ -21,12 +21,14 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; +import org.jspecify.annotations.NullUnmarked; /** * A char source for testing that has configurable options. * * @author Colin Decker */ +@NullUnmarked public class TestCharSource extends CharSource implements TestStreamSupplier { private final TestByteSource byteSource; diff --git a/guava-tests/test/com/google/common/io/TestInputStream.java b/guava-tests/test/com/google/common/io/TestInputStream.java index c885cf75f4cf..18fa18e8ba60 100644 --- a/guava-tests/test/com/google/common/io/TestInputStream.java +++ b/guava-tests/test/com/google/common/io/TestInputStream.java @@ -27,8 +27,12 @@ import java.io.IOException; import java.io.InputStream; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; -/** @author Colin Decker */ +/** + * @author Colin Decker + */ +@NullUnmarked public class TestInputStream extends FilterInputStream { private final ImmutableSet options; diff --git a/guava-tests/test/com/google/common/io/TestOption.java b/guava-tests/test/com/google/common/io/TestOption.java index 5ebd1f1f6c6e..b370476161d4 100644 --- a/guava-tests/test/com/google/common/io/TestOption.java +++ b/guava-tests/test/com/google/common/io/TestOption.java @@ -16,11 +16,14 @@ package com.google.common.io; +import org.jspecify.annotations.NullUnmarked; + /** * Options controlling the behavior of sources/sinks/streams for testing. * * @author Colin Decker */ +@NullUnmarked public enum TestOption { OPEN_THROWS, SKIP_THROWS, diff --git a/guava-tests/test/com/google/common/io/TestOutputStream.java b/guava-tests/test/com/google/common/io/TestOutputStream.java index 1a40b837cfed..56847e360b55 100644 --- a/guava-tests/test/com/google/common/io/TestOutputStream.java +++ b/guava-tests/test/com/google/common/io/TestOutputStream.java @@ -26,8 +26,12 @@ import java.io.IOException; import java.io.OutputStream; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; -/** @author Colin Decker */ +/** + * @author Colin Decker + */ +@NullUnmarked public class TestOutputStream extends FilterOutputStream { private final ImmutableSet options; diff --git a/guava-tests/test/com/google/common/io/TestReader.java b/guava-tests/test/com/google/common/io/TestReader.java index b45ede0aab08..9f41cbdc8312 100644 --- a/guava-tests/test/com/google/common/io/TestReader.java +++ b/guava-tests/test/com/google/common/io/TestReader.java @@ -23,8 +23,12 @@ import java.io.FilterReader; import java.io.IOException; import java.io.InputStreamReader; +import org.jspecify.annotations.NullUnmarked; -/** @author Colin Decker */ +/** + * @author Colin Decker + */ +@NullUnmarked public class TestReader extends FilterReader { private final TestInputStream in; diff --git a/guava-tests/test/com/google/common/io/TestStreamSupplier.java b/guava-tests/test/com/google/common/io/TestStreamSupplier.java index dcaa20b8944b..e5beeed6f8aa 100644 --- a/guava-tests/test/com/google/common/io/TestStreamSupplier.java +++ b/guava-tests/test/com/google/common/io/TestStreamSupplier.java @@ -16,6 +16,8 @@ package com.google.common.io; +import org.jspecify.annotations.NullUnmarked; + /** * Interface for a supplier of streams that can report whether a stream was opened and whether that * stream was closed. Intended for use in a test where only a single stream should be opened and @@ -23,6 +25,7 @@ * * @author Colin Decker */ +@NullUnmarked public interface TestStreamSupplier { /** Returns whether or not a new stream was opened. */ diff --git a/guava-tests/test/com/google/common/io/TestWriter.java b/guava-tests/test/com/google/common/io/TestWriter.java index 4f73f50dcb86..50f5fe9608c5 100644 --- a/guava-tests/test/com/google/common/io/TestWriter.java +++ b/guava-tests/test/com/google/common/io/TestWriter.java @@ -22,8 +22,12 @@ import java.io.FilterWriter; import java.io.IOException; import java.io.OutputStreamWriter; +import org.jspecify.annotations.NullUnmarked; -/** @author Colin Decker */ +/** + * @author Colin Decker + */ +@NullUnmarked public class TestWriter extends FilterWriter { private final TestOutputStream out; diff --git a/guava-tests/test/com/google/common/math/BigDecimalMathTest.java b/guava-tests/test/com/google/common/math/BigDecimalMathTest.java index b200a3840673..bb383a0d891d 100644 --- a/guava-tests/test/com/google/common/math/BigDecimalMathTest.java +++ b/guava-tests/test/com/google/common/math/BigDecimalMathTest.java @@ -35,8 +35,10 @@ import java.util.EnumSet; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; @GwtIncompatible +@NullUnmarked public class BigDecimalMathTest extends TestCase { private static final class RoundToDoubleTester { private final BigDecimal input; diff --git a/guava-tests/test/com/google/common/math/DoubleMathTest.java b/guava-tests/test/com/google/common/math/DoubleMathTest.java index 70ae02c6e540..48e72054023f 100644 --- a/guava-tests/test/com/google/common/math/DoubleMathTest.java +++ b/guava-tests/test/com/google/common/math/DoubleMathTest.java @@ -53,6 +53,7 @@ import java.util.Arrays; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code DoubleMath}. @@ -60,6 +61,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class DoubleMathTest extends TestCase { private static final BigDecimal MAX_INT_AS_BIG_DECIMAL = BigDecimal.valueOf(Integer.MAX_VALUE); diff --git a/guava-tests/test/com/google/common/math/DoubleUtilsTest.java b/guava-tests/test/com/google/common/math/DoubleUtilsTest.java index d3014731ef18..94c6c5a625a5 100644 --- a/guava-tests/test/com/google/common/math/DoubleUtilsTest.java +++ b/guava-tests/test/com/google/common/math/DoubleUtilsTest.java @@ -25,12 +25,14 @@ import java.lang.reflect.Method; import java.math.BigInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link DoubleUtils}. * * @author Louis Wasserman */ +@NullUnmarked public class DoubleUtilsTest extends TestCase { @AndroidIncompatible // no FpUtils and no Math.nextDown in old versions public void testNextDown() throws Exception { diff --git a/guava-tests/test/com/google/common/math/IntMathTest.java b/guava-tests/test/com/google/common/math/IntMathTest.java index 320992478d3e..cd78b28b97e2 100644 --- a/guava-tests/test/com/google/common/math/IntMathTest.java +++ b/guava-tests/test/com/google/common/math/IntMathTest.java @@ -39,6 +39,7 @@ import java.math.RoundingMode; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link IntMath}. @@ -46,6 +47,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class IntMathTest extends TestCase { public void testMaxSignedPowerOfTwo() { assertTrue(IntMath.isPowerOfTwo(IntMath.MAX_SIGNED_POWER_OF_TWO)); diff --git a/guava-tests/test/com/google/common/math/LinearTransformationTest.java b/guava-tests/test/com/google/common/math/LinearTransformationTest.java index a9d028980245..c18b7d6360a5 100644 --- a/guava-tests/test/com/google/common/math/LinearTransformationTest.java +++ b/guava-tests/test/com/google/common/math/LinearTransformationTest.java @@ -24,12 +24,14 @@ import static org.junit.Assert.assertThrows; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link LinearTransformation}. * * @author Pete Gillin */ +@NullUnmarked public class LinearTransformationTest extends TestCase { private static final double ALLOWED_ERROR = 1e-10; diff --git a/guava-tests/test/com/google/common/math/LongMathTest.java b/guava-tests/test/com/google/common/math/LongMathTest.java index 2b783840a8c2..85270faf2fa3 100644 --- a/guava-tests/test/com/google/common/math/LongMathTest.java +++ b/guava-tests/test/com/google/common/math/LongMathTest.java @@ -42,6 +42,7 @@ import java.util.EnumSet; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for LongMath. @@ -49,6 +50,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class LongMathTest extends TestCase { @SuppressWarnings("ConstantOverflow") public void testMaxSignedPowerOfTwo() { diff --git a/guava-tests/test/com/google/common/math/MathBenchmarking.java b/guava-tests/test/com/google/common/math/MathBenchmarking.java index 0c2aecfbba33..6f46dfe6c2a8 100644 --- a/guava-tests/test/com/google/common/math/MathBenchmarking.java +++ b/guava-tests/test/com/google/common/math/MathBenchmarking.java @@ -18,6 +18,7 @@ import java.math.BigInteger; import java.util.Random; +import org.jspecify.annotations.NullUnmarked; /** * Utilities for benchmarks. @@ -28,6 +29,7 @@ * * @author Louis Wasserman */ +@NullUnmarked final class MathBenchmarking { static final int ARRAY_SIZE = 0x10000; static final int ARRAY_MASK = 0x0ffff; diff --git a/guava-tests/test/com/google/common/math/MathPreconditionsTest.java b/guava-tests/test/com/google/common/math/MathPreconditionsTest.java index 8a50627ce53b..8f7b396d2c2c 100644 --- a/guava-tests/test/com/google/common/math/MathPreconditionsTest.java +++ b/guava-tests/test/com/google/common/math/MathPreconditionsTest.java @@ -23,6 +23,7 @@ import java.math.BigInteger; import java.math.RoundingMode; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link MathPreconditions}. @@ -30,6 +31,7 @@ * @author Ben Yu */ @GwtCompatible +@NullUnmarked public class MathPreconditionsTest extends TestCase { public void testCheckPositive_zeroInt() { diff --git a/guava-tests/test/com/google/common/math/MathTesting.java b/guava-tests/test/com/google/common/math/MathTesting.java index 0e49835d8ce7..7e2fdc4a5737 100644 --- a/guava-tests/test/com/google/common/math/MathTesting.java +++ b/guava-tests/test/com/google/common/math/MathTesting.java @@ -36,6 +36,7 @@ import com.google.common.primitives.Doubles; import java.math.BigInteger; import java.math.RoundingMode; +import org.jspecify.annotations.NullUnmarked; /** * Exhaustive input sets for every integral type. @@ -43,6 +44,7 @@ * @author Louis Wasserman */ @GwtCompatible +@NullUnmarked public class MathTesting { static final ImmutableSet ALL_ROUNDING_MODES = ImmutableSet.copyOf(RoundingMode.values()); diff --git a/guava-tests/test/com/google/common/math/PackageSanityTests.java b/guava-tests/test/com/google/common/math/PackageSanityTests.java index 1fc7cc7c23bf..a46527b6c2c2 100644 --- a/guava-tests/test/com/google/common/math/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/math/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.math; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -24,6 +25,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { publicApiOnly(); diff --git a/guava-tests/test/com/google/common/math/PairedStatsAccumulatorTest.java b/guava-tests/test/com/google/common/math/PairedStatsAccumulatorTest.java index 3f0d28e9a4da..326ea0c70ea1 100644 --- a/guava-tests/test/com/google/common/math/PairedStatsAccumulatorTest.java +++ b/guava-tests/test/com/google/common/math/PairedStatsAccumulatorTest.java @@ -49,6 +49,7 @@ import com.google.common.math.StatsTesting.ManyValues; import java.util.Collections; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link PairedStatsAccumulator}. This tests the stats methods for instances built with @@ -58,6 +59,7 @@ * * @author Pete Gillin */ +@NullUnmarked public class PairedStatsAccumulatorTest extends TestCase { private PairedStatsAccumulator emptyAccumulator; diff --git a/guava-tests/test/com/google/common/math/PairedStatsTest.java b/guava-tests/test/com/google/common/math/PairedStatsTest.java index 95ca1241b772..307ed451fefc 100644 --- a/guava-tests/test/com/google/common/math/PairedStatsTest.java +++ b/guava-tests/test/com/google/common/math/PairedStatsTest.java @@ -57,6 +57,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link PairedStats}. This tests instances created by {@link @@ -64,6 +65,7 @@ * * @author Pete Gillin */ +@NullUnmarked public class PairedStatsTest extends TestCase { public void testCount() { diff --git a/guava-tests/test/com/google/common/math/QuantilesAlgorithm.java b/guava-tests/test/com/google/common/math/QuantilesAlgorithm.java index ddb2064e20b6..9a6fe1d39cd4 100644 --- a/guava-tests/test/com/google/common/math/QuantilesAlgorithm.java +++ b/guava-tests/test/com/google/common/math/QuantilesAlgorithm.java @@ -21,6 +21,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Map; +import org.jspecify.annotations.NullUnmarked; /** * Enumerates several algorithms providing equivalent functionality to {@link Quantiles}, for use in @@ -31,6 +32,7 @@ * @author Pete Gillin * @since 20.0 */ +@NullUnmarked enum QuantilesAlgorithm { /** diff --git a/guava-tests/test/com/google/common/math/QuantilesAlgorithmTest.java b/guava-tests/test/com/google/common/math/QuantilesAlgorithmTest.java index 87a962a61299..cd4179dd3a89 100644 --- a/guava-tests/test/com/google/common/math/QuantilesAlgorithmTest.java +++ b/guava-tests/test/com/google/common/math/QuantilesAlgorithmTest.java @@ -25,11 +25,13 @@ import java.util.Random; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests that the different algorithms benchmarked in {@link QuantilesBenchmark} are actually all * returning more-or-less the same answers. */ +@NullUnmarked public class QuantilesAlgorithmTest extends TestCase { private static final Random RNG = new Random(82674067L); diff --git a/guava-tests/test/com/google/common/math/QuantilesTest.java b/guava-tests/test/com/google/common/math/QuantilesTest.java index 788abb7f7c23..aed6208630a4 100644 --- a/guava-tests/test/com/google/common/math/QuantilesTest.java +++ b/guava-tests/test/com/google/common/math/QuantilesTest.java @@ -43,6 +43,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -50,6 +51,7 @@ * * @author Pete Gillin */ +@NullUnmarked public class QuantilesTest extends TestCase { /* diff --git a/guava-tests/test/com/google/common/math/StatsAccumulatorTest.java b/guava-tests/test/com/google/common/math/StatsAccumulatorTest.java index 1ecc1e82da2e..7a160315b710 100644 --- a/guava-tests/test/com/google/common/math/StatsAccumulatorTest.java +++ b/guava-tests/test/com/google/common/math/StatsAccumulatorTest.java @@ -62,6 +62,7 @@ import com.google.common.primitives.Doubles; import com.google.common.primitives.Longs; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link StatsAccumulator}. This tests the stats methods for instances built with {@link @@ -71,6 +72,7 @@ * * @author Pete Gillin */ +@NullUnmarked public class StatsAccumulatorTest extends TestCase { private StatsAccumulator emptyAccumulator; diff --git a/guava-tests/test/com/google/common/math/StatsTest.java b/guava-tests/test/com/google/common/math/StatsTest.java index 357b6ea5e61b..252066589ce1 100644 --- a/guava-tests/test/com/google/common/math/StatsTest.java +++ b/guava-tests/test/com/google/common/math/StatsTest.java @@ -90,6 +90,7 @@ import java.nio.ByteOrder; import java.util.DoubleSummaryStatistics; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Stats}. This tests instances created by both {@link Stats#of} and {@link @@ -97,6 +98,7 @@ * * @author Pete Gillin */ +@NullUnmarked public class StatsTest extends TestCase { public void testCount() { diff --git a/guava-tests/test/com/google/common/math/StatsTesting.java b/guava-tests/test/com/google/common/math/StatsTesting.java index 7f4fb1f2f336..8203efc81cfd 100644 --- a/guava-tests/test/com/google/common/math/StatsTesting.java +++ b/guava-tests/test/com/google/common/math/StatsTesting.java @@ -33,6 +33,7 @@ import java.math.BigInteger; import java.util.List; import java.util.stream.DoubleStream; +import org.jspecify.annotations.NullUnmarked; /** * Inputs, expected outputs, and helper methods for tests of {@link StatsAccumulator}, {@link @@ -40,6 +41,7 @@ * * @author Pete Gillin */ +@NullUnmarked class StatsTesting { // TODO(cpovirk): Convince myself that this larger error makes sense. static final double ALLOWED_ERROR = isAndroid() ? .25 : 1e-10; diff --git a/guava-tests/test/com/google/common/math/TestPlatform.java b/guava-tests/test/com/google/common/math/TestPlatform.java index 86d8e50a6a7b..ba05ce7294bf 100644 --- a/guava-tests/test/com/google/common/math/TestPlatform.java +++ b/guava-tests/test/com/google/common/math/TestPlatform.java @@ -17,9 +17,13 @@ package com.google.common.math; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; -/** @author Chris Povirk */ +/** + * @author Chris Povirk + */ @GwtCompatible(emulated = true) +@NullUnmarked class TestPlatform { static boolean intsCanGoOutOfRange() { return false; diff --git a/guava-tests/test/com/google/common/net/HostAndPortTest.java b/guava-tests/test/com/google/common/net/HostAndPortTest.java index ba583eff657b..3b55c9f9ff0d 100644 --- a/guava-tests/test/com/google/common/net/HostAndPortTest.java +++ b/guava-tests/test/com/google/common/net/HostAndPortTest.java @@ -22,6 +22,7 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.SerializableTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -30,6 +31,7 @@ * @author Paul Marks */ @GwtCompatible +@NullUnmarked public class HostAndPortTest extends TestCase { public void testFromStringWellFormed() { diff --git a/guava-tests/test/com/google/common/net/HostSpecifierTest.java b/guava-tests/test/com/google/common/net/HostSpecifierTest.java index 8112879a86d9..6b7ca2f39902 100644 --- a/guava-tests/test/com/google/common/net/HostSpecifierTest.java +++ b/guava-tests/test/com/google/common/net/HostSpecifierTest.java @@ -23,6 +23,7 @@ import com.google.common.testing.NullPointerTester; import java.text.ParseException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * {@link TestCase} for {@link HostSpecifier}. This is a relatively cursory test, as HostSpecifier @@ -32,6 +33,7 @@ * * @author Craig Berry */ +@NullUnmarked public final class HostSpecifierTest extends TestCase { private static final ImmutableList GOOD_IPS = diff --git a/guava-tests/test/com/google/common/net/HttpHeadersTest.java b/guava-tests/test/com/google/common/net/HttpHeadersTest.java index 2a18eabf364b..b89202ec9347 100644 --- a/guava-tests/test/com/google/common/net/HttpHeadersTest.java +++ b/guava-tests/test/com/google/common/net/HttpHeadersTest.java @@ -25,12 +25,14 @@ import java.lang.reflect.Field; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the HttpHeaders class. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class HttpHeadersTest extends TestCase { public void testConstantNameMatchesString() throws Exception { diff --git a/guava-tests/test/com/google/common/net/InetAddressesTest.java b/guava-tests/test/com/google/common/net/InetAddressesTest.java index 5bf1ee861a16..3f442deaab98 100644 --- a/guava-tests/test/com/google/common/net/InetAddressesTest.java +++ b/guava-tests/test/com/google/common/net/InetAddressesTest.java @@ -30,12 +30,14 @@ import java.net.UnknownHostException; import java.util.Enumeration; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link InetAddresses}. * * @author Erik Kline */ +@NullUnmarked public class InetAddressesTest extends TestCase { public void testNulls() { diff --git a/guava-tests/test/com/google/common/net/InternetDomainNameTest.java b/guava-tests/test/com/google/common/net/InternetDomainNameTest.java index 77c06ea13530..aece7235ebb7 100644 --- a/guava-tests/test/com/google/common/net/InternetDomainNameTest.java +++ b/guava-tests/test/com/google/common/net/InternetDomainNameTest.java @@ -28,6 +28,7 @@ import com.google.common.testing.EqualsTester; import com.google.common.testing.NullPointerTester; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * {@link TestCase} for {@link InternetDomainName}. @@ -35,6 +36,7 @@ * @author Craig Berry */ @GwtCompatible(emulated = true) +@NullUnmarked public final class InternetDomainNameTest extends TestCase { private static final InternetDomainName UNICODE_EXAMPLE = InternetDomainName.from("j\u00f8rpeland.no"); diff --git a/guava-tests/test/com/google/common/net/MediaTypeTest.java b/guava-tests/test/com/google/common/net/MediaTypeTest.java index e22a316382be..da6c4914b0b6 100644 --- a/guava-tests/test/com/google/common/net/MediaTypeTest.java +++ b/guava-tests/test/com/google/common/net/MediaTypeTest.java @@ -51,6 +51,7 @@ import java.nio.charset.UnsupportedCharsetException; import java.util.Arrays; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link MediaType}. @@ -58,6 +59,7 @@ * @author Gregory Kick */ @GwtCompatible(emulated = true) +@NullUnmarked public class MediaTypeTest extends TestCase { @J2ktIncompatible @GwtIncompatible // reflection diff --git a/guava-tests/test/com/google/common/net/PackageSanityTests.java b/guava-tests/test/com/google/common/net/PackageSanityTests.java index 3d18ad6dee6b..1a0a4c452f7a 100644 --- a/guava-tests/test/com/google/common/net/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/net/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.net; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Basic sanity tests for the entire package. @@ -24,6 +25,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { setDefault(InternetDomainName.class, InternetDomainName.from("google.com")); diff --git a/guava-tests/test/com/google/common/net/PercentEscaperTest.java b/guava-tests/test/com/google/common/net/PercentEscaperTest.java index f5ce13541894..6f33ba1078be 100644 --- a/guava-tests/test/com/google/common/net/PercentEscaperTest.java +++ b/guava-tests/test/com/google/common/net/PercentEscaperTest.java @@ -26,6 +26,7 @@ import com.google.common.base.Preconditions; import com.google.common.escape.UnicodeEscaper; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link PercentEscaper}. @@ -33,6 +34,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked public class PercentEscaperTest extends TestCase { /** Tests that the simple escaper treats 0-9, a-z and A-Z as safe */ diff --git a/guava-tests/test/com/google/common/net/UrlEscaperTesting.java b/guava-tests/test/com/google/common/net/UrlEscaperTesting.java index 4aad01f8c3e5..9992a1898ce1 100644 --- a/guava-tests/test/com/google/common/net/UrlEscaperTesting.java +++ b/guava-tests/test/com/google/common/net/UrlEscaperTesting.java @@ -24,6 +24,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.escape.UnicodeEscaper; +import org.jspecify.annotations.NullUnmarked; /** * Testing utilities for {@link UrlEscapers} and {@link LegacyUrlEscapersTest}. @@ -31,6 +32,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked final class UrlEscaperTesting { /** * Helper to assert common expected behaviour of uri escapers. You should call diff --git a/guava-tests/test/com/google/common/net/UrlEscapersTest.java b/guava-tests/test/com/google/common/net/UrlEscapersTest.java index fefd50d76bee..e9c0cd0a85d2 100644 --- a/guava-tests/test/com/google/common/net/UrlEscapersTest.java +++ b/guava-tests/test/com/google/common/net/UrlEscapersTest.java @@ -27,6 +27,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.escape.UnicodeEscaper; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the {@link UrlEscapers} class. @@ -34,6 +35,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked public class UrlEscapersTest extends TestCase { public void testUrlFormParameterEscaper() { UnicodeEscaper e = (UnicodeEscaper) urlFormParameterEscaper(); diff --git a/guava-tests/test/com/google/common/primitives/ByteArrayAsListTest.java b/guava-tests/test/com/google/common/primitives/ByteArrayAsListTest.java index c7e693655f78..12388907e8c4 100644 --- a/guava-tests/test/com/google/common/primitives/ByteArrayAsListTest.java +++ b/guava-tests/test/com/google/common/primitives/ByteArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Bytes#asList(byte[])}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class ByteArrayAsListTest extends TestCase { private static List asList(Byte[] values) { diff --git a/guava-tests/test/com/google/common/primitives/CharArrayAsListTest.java b/guava-tests/test/com/google/common/primitives/CharArrayAsListTest.java index 7e521f1a75fd..162d03358dfc 100644 --- a/guava-tests/test/com/google/common/primitives/CharArrayAsListTest.java +++ b/guava-tests/test/com/google/common/primitives/CharArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Chars#asList(char[])}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class CharArrayAsListTest extends TestCase { private static List asList(Character[] values) { diff --git a/guava-tests/test/com/google/common/primitives/DoubleArrayAsListTest.java b/guava-tests/test/com/google/common/primitives/DoubleArrayAsListTest.java index e7cd4f38edcb..7515073fce9b 100644 --- a/guava-tests/test/com/google/common/primitives/DoubleArrayAsListTest.java +++ b/guava-tests/test/com/google/common/primitives/DoubleArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Doubles#asList(double[])}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class DoubleArrayAsListTest extends TestCase { private static List asList(Double[] values) { diff --git a/guava-tests/test/com/google/common/primitives/FloatArrayAsListTest.java b/guava-tests/test/com/google/common/primitives/FloatArrayAsListTest.java index c70a8b5d031c..9fee9033ce08 100644 --- a/guava-tests/test/com/google/common/primitives/FloatArrayAsListTest.java +++ b/guava-tests/test/com/google/common/primitives/FloatArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Floats#asList(float[])})}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class FloatArrayAsListTest extends TestCase { private static List asList(Float[] values) { diff --git a/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java b/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java index 789b6de6d694..7cbb29d71fcc 100644 --- a/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java +++ b/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java @@ -43,11 +43,13 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class ImmutableDoubleArrayTest extends TestCase { // Test all creation paths very lazily: by assuming asList() works diff --git a/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java b/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java index 7d7a83f3fe85..184ae1e15206 100644 --- a/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java +++ b/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java @@ -43,9 +43,13 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; -/** @author Kevin Bourrillion */ +/** + * @author Kevin Bourrillion + */ @GwtCompatible(emulated = true) +@NullUnmarked public class ImmutableIntArrayTest extends TestCase { // Test all creation paths very lazily: by assuming asList() works diff --git a/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java b/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java index d351335cabdb..f8e32747fbb4 100644 --- a/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java +++ b/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java @@ -43,9 +43,13 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; -/** @author Kevin Bourrillion */ +/** + * @author Kevin Bourrillion + */ @GwtCompatible(emulated = true) +@NullUnmarked public class ImmutableLongArrayTest extends TestCase { // Test all creation paths very lazily: by assuming asList() works diff --git a/guava-tests/test/com/google/common/primitives/IntArrayAsListTest.java b/guava-tests/test/com/google/common/primitives/IntArrayAsListTest.java index 46611f388f80..8f5732ff22c0 100644 --- a/guava-tests/test/com/google/common/primitives/IntArrayAsListTest.java +++ b/guava-tests/test/com/google/common/primitives/IntArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Ints#asList(int[])}. @@ -40,6 +41,7 @@ */ @GwtCompatible(emulated = true) @SuppressWarnings("cast") // redundant casts are intentional and harmless +@NullUnmarked public class IntArrayAsListTest extends TestCase { private static List asList(Integer[] values) { diff --git a/guava-tests/test/com/google/common/primitives/LongArrayAsListTest.java b/guava-tests/test/com/google/common/primitives/LongArrayAsListTest.java index 4a63251532fb..76c54bdbf1ba 100644 --- a/guava-tests/test/com/google/common/primitives/LongArrayAsListTest.java +++ b/guava-tests/test/com/google/common/primitives/LongArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Longs#asList(long[])}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class LongArrayAsListTest extends TestCase { private static List asList(Long[] values) { diff --git a/guava-tests/test/com/google/common/primitives/PackageSanityTests.java b/guava-tests/test/com/google/common/primitives/PackageSanityTests.java index 3f3e74539dac..eaa6ba09a51e 100644 --- a/guava-tests/test/com/google/common/primitives/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/primitives/PackageSanityTests.java @@ -17,6 +17,7 @@ package com.google.common.primitives; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** * Tests basic sanity for each class in the package. @@ -24,6 +25,7 @@ * @author Ben Yu */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests { public PackageSanityTests() { setDefault(String.class, "string"); diff --git a/guava-tests/test/com/google/common/primitives/PrimitivesTest.java b/guava-tests/test/com/google/common/primitives/PrimitivesTest.java index 621e7bcdb3ee..d3bd1cc84241 100644 --- a/guava-tests/test/com/google/common/primitives/PrimitivesTest.java +++ b/guava-tests/test/com/google/common/primitives/PrimitivesTest.java @@ -25,6 +25,7 @@ import com.google.common.testing.NullPointerTester; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Primitives}. @@ -32,6 +33,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class PrimitivesTest extends TestCase { public void testIsWrapperType() { assertThat(Primitives.isWrapperType(Void.class)).isTrue(); diff --git a/guava-tests/test/com/google/common/primitives/ShortArrayAsListTest.java b/guava-tests/test/com/google/common/primitives/ShortArrayAsListTest.java index a79211a316bd..c6c4dea4d304 100644 --- a/guava-tests/test/com/google/common/primitives/ShortArrayAsListTest.java +++ b/guava-tests/test/com/google/common/primitives/ShortArrayAsListTest.java @@ -32,6 +32,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Test suite covering {@link Shorts#asList(short[])}. @@ -39,6 +40,7 @@ * @author Kevin Bourrillion */ @GwtCompatible(emulated = true) +@NullUnmarked public class ShortArrayAsListTest extends TestCase { private static List asList(Short[] values) { diff --git a/guava-tests/test/com/google/common/primitives/TestPlatform.java b/guava-tests/test/com/google/common/primitives/TestPlatform.java index 094c9d7fc09d..944b1f3dc39c 100644 --- a/guava-tests/test/com/google/common/primitives/TestPlatform.java +++ b/guava-tests/test/com/google/common/primitives/TestPlatform.java @@ -17,8 +17,10 @@ package com.google.common.primitives; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; @GwtCompatible(emulated = true) +@NullUnmarked class TestPlatform { static int reduceIterationsIfGwt(int iterations) { return iterations; diff --git a/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java b/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java index 823be04f3392..da00a4274088 100644 --- a/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java +++ b/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link UnsignedBytes}. @@ -37,6 +38,7 @@ * @author Kevin Bourrillion * @author Louis Wasserman */ +@NullUnmarked public class UnsignedBytesTest extends TestCase { private static final byte LEAST = 0; private static final byte GREATEST = (byte) 255; diff --git a/guava-tests/test/com/google/common/primitives/UnsignedIntegerTest.java b/guava-tests/test/com/google/common/primitives/UnsignedIntegerTest.java index 9eddfe51b740..4116438a58ca 100644 --- a/guava-tests/test/com/google/common/primitives/UnsignedIntegerTest.java +++ b/guava-tests/test/com/google/common/primitives/UnsignedIntegerTest.java @@ -27,6 +27,7 @@ import com.google.common.testing.SerializableTester; import java.math.BigInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code UnsignedInteger}. @@ -34,6 +35,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class UnsignedIntegerTest extends TestCase { private static final ImmutableSet TEST_INTS; private static final ImmutableSet TEST_LONGS; diff --git a/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java b/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java index 448f3f780905..bd2376afc3cc 100644 --- a/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java +++ b/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for UnsignedInts @@ -36,6 +37,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class UnsignedIntsTest extends TestCase { private static final long[] UNSIGNED_INTS = { 0L, diff --git a/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java b/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java index 9dfc75f97875..8bbe2cac52da 100644 --- a/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java +++ b/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java @@ -27,6 +27,7 @@ import com.google.common.testing.SerializableTester; import java.math.BigInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@code UnsignedLong}. @@ -34,6 +35,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class UnsignedLongTest extends TestCase { private static final ImmutableSet TEST_LONGS; private static final ImmutableSet TEST_BIG_INTEGERS; diff --git a/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java b/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java index 8cd171bd86ab..3993a416a57f 100644 --- a/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java +++ b/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java @@ -31,6 +31,7 @@ import java.util.List; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for UnsignedLongs @@ -39,6 +40,7 @@ * @author Louis Wasserman */ @GwtCompatible(emulated = true) +@NullUnmarked public class UnsignedLongsTest extends TestCase { private static final long LEAST = 0L; private static final long GREATEST = 0xffffffffffffffffL; diff --git a/guava-tests/test/com/google/common/reflect/AbstractInvocationHandlerTest.java b/guava-tests/test/com/google/common/reflect/AbstractInvocationHandlerTest.java index 310878f98283..17a45870e71b 100644 --- a/guava-tests/test/com/google/common/reflect/AbstractInvocationHandlerTest.java +++ b/guava-tests/test/com/google/common/reflect/AbstractInvocationHandlerTest.java @@ -26,6 +26,7 @@ import java.lang.reflect.Proxy; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -33,6 +34,7 @@ * * @author Ben Yu */ +@NullUnmarked public class AbstractInvocationHandlerTest extends TestCase { private static final ImmutableList LIST1 = ImmutableList.of("one", "two"); diff --git a/guava-tests/test/com/google/common/reflect/ClassPathTest.java b/guava-tests/test/com/google/common/reflect/ClassPathTest.java index 36ba6ba6171a..55b55e5e3cbe 100644 --- a/guava-tests/test/com/google/common/reflect/ClassPathTest.java +++ b/guava-tests/test/com/google/common/reflect/ClassPathTest.java @@ -53,9 +53,11 @@ import java.util.logging.Logger; import java.util.zip.ZipEntry; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.junit.Test; /** Functional tests of {@link ClassPath}. */ +@NullUnmarked public class ClassPathTest extends TestCase { private static final Logger log = Logger.getLogger(ClassPathTest.class.getName()); private static final File FILE = new File("."); diff --git a/guava-tests/test/com/google/common/reflect/ImmutableTypeToInstanceMapTest.java b/guava-tests/test/com/google/common/reflect/ImmutableTypeToInstanceMapTest.java index 3c9304527abd..56493b56e483 100644 --- a/guava-tests/test/com/google/common/reflect/ImmutableTypeToInstanceMapTest.java +++ b/guava-tests/test/com/google/common/reflect/ImmutableTypeToInstanceMapTest.java @@ -33,12 +33,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link ImmutableTypeToInstanceMap}. * * @author Ben Yu */ +@NullUnmarked public class ImmutableTypeToInstanceMapTest extends TestCase { @AndroidIncompatible // problem with suite builders on Android diff --git a/guava-tests/test/com/google/common/reflect/InvokableTest.java b/guava-tests/test/com/google/common/reflect/InvokableTest.java index e9c0104b8867..04ac9d0bc789 100644 --- a/guava-tests/test/com/google/common/reflect/InvokableTest.java +++ b/guava-tests/test/com/google/common/reflect/InvokableTest.java @@ -35,6 +35,7 @@ import java.lang.reflect.TypeVariable; import java.util.Collections; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -43,6 +44,7 @@ * @author Ben Yu */ @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class InvokableTest extends TestCase { // Historically Invokable inherited from java.lang.reflect.AccessibleObject. That's no longer the // case, but we do check that its API still has the same public methods. We exclude some methods diff --git a/guava-tests/test/com/google/common/reflect/MutableTypeToInstanceMapTest.java b/guava-tests/test/com/google/common/reflect/MutableTypeToInstanceMapTest.java index 10b4f2ecabf1..42dc61a9f2db 100644 --- a/guava-tests/test/com/google/common/reflect/MutableTypeToInstanceMapTest.java +++ b/guava-tests/test/com/google/common/reflect/MutableTypeToInstanceMapTest.java @@ -32,12 +32,14 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Unit test of {@link MutableTypeToInstanceMap}. * * @author Ben Yu */ +@NullUnmarked public class MutableTypeToInstanceMapTest extends TestCase { @AndroidIncompatible // problem with suite builders on Android diff --git a/guava-tests/test/com/google/common/reflect/PackageSanityTests.java b/guava-tests/test/com/google/common/reflect/PackageSanityTests.java index ba11fe80c778..9d3a4a2cf3b6 100644 --- a/guava-tests/test/com/google/common/reflect/PackageSanityTests.java +++ b/guava-tests/test/com/google/common/reflect/PackageSanityTests.java @@ -17,7 +17,9 @@ package com.google.common.reflect; import com.google.common.testing.AbstractPackageSanityTests; +import org.jspecify.annotations.NullUnmarked; /** Tests nulls for the entire package. */ +@NullUnmarked public class PackageSanityTests extends AbstractPackageSanityTests {} diff --git a/guava-tests/test/com/google/common/reflect/ParameterTest.java b/guava-tests/test/com/google/common/reflect/ParameterTest.java index 86ea0104fa93..890ae32a0313 100644 --- a/guava-tests/test/com/google/common/reflect/ParameterTest.java +++ b/guava-tests/test/com/google/common/reflect/ParameterTest.java @@ -20,12 +20,14 @@ import com.google.common.testing.NullPointerTester; import java.lang.reflect.Method; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Parameter}. * * @author Ben Yu */ +@NullUnmarked public class ParameterTest extends TestCase { public void testNulls() { diff --git a/guava-tests/test/com/google/common/reflect/ReflectionTest.java b/guava-tests/test/com/google/common/reflect/ReflectionTest.java index 83d0168a63ea..6a0a7ce34b18 100644 --- a/guava-tests/test/com/google/common/reflect/ReflectionTest.java +++ b/guava-tests/test/com/google/common/reflect/ReflectionTest.java @@ -23,8 +23,10 @@ import java.lang.reflect.Method; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link Reflection} */ +@NullUnmarked public class ReflectionTest extends TestCase { public void testGetPackageName() throws Exception { diff --git a/guava-tests/test/com/google/common/reflect/SubtypeTester.java b/guava-tests/test/com/google/common/reflect/SubtypeTester.java index 7cd61c129dad..5caca8c420b8 100644 --- a/guava-tests/test/com/google/common/reflect/SubtypeTester.java +++ b/guava-tests/test/com/google/common/reflect/SubtypeTester.java @@ -30,6 +30,7 @@ import java.util.Arrays; import java.util.Comparator; import javax.lang.model.element.Modifier; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -65,6 +66,7 @@ *

The declaration methods must be public. */ @AndroidIncompatible // only used by android incompatible tests. +@NullUnmarked abstract class SubtypeTester implements Cloneable { /** Annotates a public method that declares subtype assertion. */ diff --git a/guava-tests/test/com/google/common/reflect/TypeParameterTest.java b/guava-tests/test/com/google/common/reflect/TypeParameterTest.java index ca49283a6c6e..e1d2cb021c50 100644 --- a/guava-tests/test/com/google/common/reflect/TypeParameterTest.java +++ b/guava-tests/test/com/google/common/reflect/TypeParameterTest.java @@ -23,12 +23,14 @@ import java.lang.reflect.Method; import java.lang.reflect.TypeVariable; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link TypeParameter}. * * @author Ben Yu */ +@NullUnmarked public class TypeParameterTest extends TestCase { public void testCaptureTypeParameter() throws Exception { diff --git a/guava-tests/test/com/google/common/reflect/TypeResolverTest.java b/guava-tests/test/com/google/common/reflect/TypeResolverTest.java index 5eba7052debe..464eebdd466c 100644 --- a/guava-tests/test/com/google/common/reflect/TypeResolverTest.java +++ b/guava-tests/test/com/google/common/reflect/TypeResolverTest.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests of {@link TypeResolver}. @@ -30,6 +31,7 @@ * @author Ben Yu */ @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class TypeResolverTest extends TestCase { public void testWhere_noMapping() { diff --git a/guava-tests/test/com/google/common/reflect/TypeTokenResolutionTest.java b/guava-tests/test/com/google/common/reflect/TypeTokenResolutionTest.java index 0a7a9da321f8..72e452beee43 100644 --- a/guava-tests/test/com/google/common/reflect/TypeTokenResolutionTest.java +++ b/guava-tests/test/com/google/common/reflect/TypeTokenResolutionTest.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link TypeToken} and {@link TypeResolver}. @@ -37,6 +38,7 @@ * @author Ben Yu */ @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class TypeTokenResolutionTest extends TestCase { private static class Foo { diff --git a/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java b/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java index 067f03c37dc2..542d77f61df5 100644 --- a/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java +++ b/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java @@ -23,8 +23,10 @@ import java.util.Comparator; import java.util.List; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class TypeTokenSubtypeTest extends TestCase { public void testOwnerTypeSubtypes() throws Exception { diff --git a/guava-tests/test/com/google/common/reflect/TypeTokenTest.java b/guava-tests/test/com/google/common/reflect/TypeTokenTest.java index 5022e2802bb2..4acb5a1086ed 100644 --- a/guava-tests/test/com/google/common/reflect/TypeTokenTest.java +++ b/guava-tests/test/com/google/common/reflect/TypeTokenTest.java @@ -45,6 +45,7 @@ import java.util.List; import java.util.Map; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test cases for {@link TypeToken}. @@ -53,6 +54,7 @@ * @author Ben Yu */ @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class TypeTokenTest extends TestCase { private abstract static class StringList implements List {} diff --git a/guava-tests/test/com/google/common/reflect/TypeVisitorTest.java b/guava-tests/test/com/google/common/reflect/TypeVisitorTest.java index 4cb53cfee481..d466067c8970 100644 --- a/guava-tests/test/com/google/common/reflect/TypeVisitorTest.java +++ b/guava-tests/test/com/google/common/reflect/TypeVisitorTest.java @@ -24,12 +24,14 @@ import java.util.ArrayList; import java.util.EnumSet; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests of {@link TypeVisitor}. * * @author Ben Yu */ +@NullUnmarked public class TypeVisitorTest extends TestCase { public void testVisitNull() { diff --git a/guava-tests/test/com/google/common/reflect/TypesTest.java b/guava-tests/test/com/google/common/reflect/TypesTest.java index f1f4ae3f4e48..42ac44f5bbda 100644 --- a/guava-tests/test/com/google/common/reflect/TypesTest.java +++ b/guava-tests/test/com/google/common/reflect/TypesTest.java @@ -37,6 +37,7 @@ import java.util.Map; import java.util.Map.Entry; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Types}. @@ -44,6 +45,7 @@ * @author Ben Yu */ @AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations? +@NullUnmarked public class TypesTest extends TestCase { public void testNewParameterizedType_ownerTypeImplied() throws Exception { ParameterizedType jvmType = diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java index c1297abc2fae..8f690b60c682 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java @@ -36,6 +36,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -43,6 +44,7 @@ * different "source Future" for {@link AbstractFuture#setFuture} calls. */ @GwtCompatible(emulated = true) +@NullUnmarked abstract class AbstractAbstractFutureTest extends TestCase { private TestedFuture future; private AbstractFuture delegate; diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractChainedListenableFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractChainedListenableFutureTest.java index 83c193cd9935..261c14637992 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractChainedListenableFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractChainedListenableFutureTest.java @@ -23,6 +23,7 @@ import com.google.common.util.concurrent.testing.MockFutureListener; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for any listenable future that chains other listenable futures. Unit tests need only @@ -30,6 +31,7 @@ * * @author Nishant Thakkar */ +@NullUnmarked public abstract class AbstractChainedListenableFutureTest extends TestCase { protected static final int EXCEPTION_DATA = -1; protected static final int VALID_INPUT_DATA = 1; diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractClosingFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractClosingFutureTest.java index cf04413f6aea..10e6942ab7de 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractClosingFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractClosingFutureTest.java @@ -75,6 +75,7 @@ import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.mockito.Mockito; /** @@ -83,6 +84,7 @@ * ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)} paths to complete a * {@link ClosingFuture} pipeline. */ +@NullUnmarked public abstract class AbstractClosingFutureTest extends TestCase { // TODO(dpb): Use Expect once that supports JUnit 3, or we can use JUnit 4. final List failures = new ArrayList<>(); diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java index cd7fc344ae05..82126ef425b0 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java @@ -31,12 +31,14 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link AbstractExecutionThreadService}. * * @author Jesse Wilson */ +@NullUnmarked public class AbstractExecutionThreadServiceTest extends TestCase { private final TearDownStack tearDownStack = new TearDownStack(true); diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java b/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java index c9c2038a5f27..a4d53d778573 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java @@ -25,9 +25,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.locks.AbstractQueuedSynchronizer; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** Utilities for the AbstractFutureBenchmarks */ +@NullUnmarked final class AbstractFutureBenchmarks { private AbstractFutureBenchmarks() {} diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureCancellationCauseTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractFutureCancellationCauseTest.java index d00f95f311db..a5eb4f792bff 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureCancellationCauseTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractFutureCancellationCauseTest.java @@ -29,10 +29,12 @@ import java.util.concurrent.TimeUnit; import javax.annotation.concurrent.GuardedBy; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link AbstractFuture} with the cancellation cause system property set */ @AndroidIncompatible // custom classloading +@NullUnmarked public class AbstractFutureCancellationCauseTest extends TestCase { private ClassLoader oldClassLoader; diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java index f106dee2e074..bd56df06c1b5 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java @@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import sun.misc.Unsafe; /** @@ -45,6 +46,7 @@ * test methods in these degenerate classloaders. */ +@NullUnmarked public class AbstractFutureFallbackAtomicHelperTest extends TestCase { // stash these in static fields to avoid loading them over and over again (speeds up test diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java index f66383e198a8..d955501aabd3 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java @@ -58,6 +58,7 @@ import java.util.concurrent.locks.LockSupport; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -65,6 +66,7 @@ * * @author Brian Stoler */ +@NullUnmarked public class AbstractFutureTest extends TestCase { public void testSuccess() throws ExecutionException, InterruptedException { final Object value = new Object(); diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractIdleServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractIdleServiceTest.java index 4f3252649765..f46960f55a2a 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractIdleServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractIdleServiceTest.java @@ -26,6 +26,7 @@ import java.util.concurrent.Executor; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link AbstractIdleService}. @@ -33,6 +34,7 @@ * @author Chris Nokleberg * @author Ben Yu */ +@NullUnmarked public class AbstractIdleServiceTest extends TestCase { public void testStart() { TestService service = new TestService(); diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractListeningExecutorServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractListeningExecutorServiceTest.java index 139581f7c1dd..bd2c95b0e520 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractListeningExecutorServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractListeningExecutorServiceTest.java @@ -23,12 +23,14 @@ import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link AbstractListeningExecutorService}. * * @author Colin Decker */ +@NullUnmarked public class AbstractListeningExecutorServiceTest extends TestCase { public void testSubmit() throws Exception { diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java index 13335631ad06..fd33281c0037 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java @@ -44,6 +44,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -51,6 +52,7 @@ * * @author Luke Sandberg */ +@NullUnmarked public class AbstractScheduledServiceTest extends TestCase { volatile Scheduler configuration = newFixedDelaySchedule(0, 10, MILLISECONDS); diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/AbstractServiceTest.java index a3fc96aeb3e9..f3828d7dacaa 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractServiceTest.java @@ -35,12 +35,14 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link AbstractService}. * * @author Jesse Wilson */ +@NullUnmarked public class AbstractServiceTest extends TestCase { private static final long LONG_TIMEOUT_MILLIS = 10000; diff --git a/guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java b/guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java index 9ddcea9b7132..1ed1d10d77d6 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; /** * Tests our AtomicHelper fallback strategy in AggregateFutureState. @@ -45,6 +46,7 @@ * test methods in these degenerate classloaders. */ +@NullUnmarked public class AggregateFutureStateFallbackAtomicHelperTest extends TestCase { /** diff --git a/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java b/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java index 1faad134d174..1bf69b79f709 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java @@ -20,8 +20,10 @@ import com.google.common.annotations.J2ktIncompatible; import com.google.common.testing.NullPointerTester; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; /** Unit test for {@link AtomicDoubleArray}. */ +@NullUnmarked public class AtomicDoubleArrayTest extends JSR166TestCase { private static final double[] VALUES = { diff --git a/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java b/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java index a50dd565c7a8..2f52fb776f0e 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java @@ -16,7 +16,10 @@ import static com.google.common.truth.Truth.assertThat; import static java.lang.Math.max; +import org.jspecify.annotations.NullUnmarked; + /** Unit test for {@link AtomicDouble}. */ +@NullUnmarked public class AtomicDoubleTest extends JSR166TestCase { private static final double[] VALUES = { diff --git a/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java b/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java index 44212922a0a1..994ddaca9906 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java @@ -27,6 +27,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Basher test for {@link AtomicLongMap}. @@ -35,6 +36,7 @@ */ @J2ktIncompatible // threads @GwtIncompatible // threads +@NullUnmarked public class AtomicLongMapBasherTest extends TestCase { private final Random random = new Random(301); diff --git a/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java b/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java index aa37eae1898c..0eccd0c43be0 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java @@ -27,6 +27,7 @@ import java.util.Random; import java.util.Set; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link AtomicLongMap}. @@ -34,6 +35,7 @@ * @author mike nonemacher */ @GwtCompatible(emulated = true) +@NullUnmarked public class AtomicLongMapTest extends TestCase { private static final int ITERATIONS = 100; private static final int MAX_ADDEND = 100; diff --git a/guava-tests/test/com/google/common/util/concurrent/AtomicsTest.java b/guava-tests/test/com/google/common/util/concurrent/AtomicsTest.java index 90f0f6f76b8f..1cb9fd8c4c00 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AtomicsTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/AtomicsTest.java @@ -21,12 +21,14 @@ import com.google.common.testing.NullPointerTester; import java.util.concurrent.atomic.AtomicReferenceArray; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link Atomics}. * * @author Kurt Alfred Kluever */ +@NullUnmarked public class AtomicsTest extends TestCase { private static final Object OBJECT = new Object(); diff --git a/guava-tests/test/com/google/common/util/concurrent/CallablesTest.java b/guava-tests/test/com/google/common/util/concurrent/CallablesTest.java index f7537369e0c9..dccd36366f88 100644 --- a/guava-tests/test/com/google/common/util/concurrent/CallablesTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/CallablesTest.java @@ -29,6 +29,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -37,6 +38,7 @@ * @author Isaac Shum */ @GwtCompatible(emulated = true) +@NullUnmarked public class CallablesTest extends TestCase { @J2ktIncompatible // TODO(b/324550390): Enable diff --git a/guava-tests/test/com/google/common/util/concurrent/ClassPathUtil.java b/guava-tests/test/com/google/common/util/concurrent/ClassPathUtil.java index a36aa34e4e56..16e88a5df94c 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ClassPathUtil.java +++ b/guava-tests/test/com/google/common/util/concurrent/ClassPathUtil.java @@ -23,9 +23,11 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; +import org.jspecify.annotations.NullUnmarked; // TODO(b/65488446): Make this a public API. /** Utility method to parse the system class path. */ +@NullUnmarked final class ClassPathUtil { private ClassPathUtil() {} diff --git a/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java index 29ce341e1077..c42357cac0b2 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java @@ -26,8 +26,10 @@ import com.google.common.util.concurrent.ClosingFuture.DeferredCloser; import java.io.Closeable; import java.util.concurrent.ExecutionException; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link ClosingFuture} that exercise {@link ClosingFuture#finishToFuture()}. */ +@NullUnmarked public class ClosingFutureFinishToFutureTest extends AbstractClosingFutureTest { public void testFinishToFuture_throwsIfCalledTwice() throws Exception { ClosingFuture closingFuture = diff --git a/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java b/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java index c249eca34073..c03230315189 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java @@ -33,11 +33,13 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ClosingFuture} that exercise {@link * ClosingFuture#finishToValueAndCloser(ValueAndCloserConsumer, Executor)}. */ +@NullUnmarked public class ClosingFutureFinishToValueAndCloserTest extends AbstractClosingFutureTest { private final ExecutorService finishToValueAndCloserExecutor = newSingleThreadExecutor(); private volatile ValueAndCloser valueAndCloser; diff --git a/guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java b/guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java index 050609af25f5..ba7d11ef8f67 100644 --- a/guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java @@ -29,12 +29,14 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantReadWriteLock; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unittests for {@link CycleDetectingLockFactory}. * * @author Darick Tong */ +@NullUnmarked public class CycleDetectingLockFactoryTest extends TestCase { private ReentrantLock lockA; diff --git a/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java b/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java index 8d2920610087..da262806a3ec 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link ExecutionList}. @@ -32,6 +33,7 @@ * @author Nishant Thakkar * @author Sven Mawson */ +@NullUnmarked public class ExecutionListTest extends TestCase { private final ExecutionList list = new ExecutionList(); diff --git a/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java b/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java index b09f35fa4700..4a07ef071959 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java @@ -37,9 +37,11 @@ import java.util.concurrent.Future; import java.util.logging.Logger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** Tests for {@link ExecutionSequencer} */ +@NullUnmarked public class ExecutionSequencerTest extends TestCase { ExecutorService executor; diff --git a/guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java b/guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java index 78f4374d7b03..922e02747e4f 100644 --- a/guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java @@ -23,12 +23,14 @@ import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link FakeTimeLimiter}. * * @author Jens Nyman */ +@NullUnmarked public class FakeTimeLimiterTest extends TestCase { private static final int DELAY_MS = 50; diff --git a/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingDequeTest.java b/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingDequeTest.java index 35cecee71e2a..002ad8581176 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingDequeTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingDequeTest.java @@ -17,12 +17,14 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test for {@link ForwardingBlockingDeque} * * @author Emily Soldal */ +@NullUnmarked public class ForwardingBlockingDequeTest extends TestCase { public void testForwarding() { diff --git a/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingQueueTest.java b/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingQueueTest.java index eda852f6cedc..0c7c1b4c45b1 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingQueueTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ForwardingBlockingQueueTest.java @@ -17,8 +17,10 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link ForwardingBlockingQueue} */ +@NullUnmarked public class ForwardingBlockingQueueTest extends TestCase { public void testForwarding() { ForwardingObjectTester.testForwardingObject(ForwardingBlockingQueue.class); diff --git a/guava-tests/test/com/google/common/util/concurrent/ForwardingExecutorServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/ForwardingExecutorServiceTest.java index ccd3eb8000e9..f2474e7f6ff3 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ForwardingExecutorServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ForwardingExecutorServiceTest.java @@ -17,8 +17,10 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link ForwardingExecutorService} */ +@NullUnmarked public class ForwardingExecutorServiceTest extends TestCase { public void testForwarding() { ForwardingObjectTester.testForwardingObject(ForwardingExecutorService.class); diff --git a/guava-tests/test/com/google/common/util/concurrent/ForwardingFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/ForwardingFutureTest.java index f5d282a141f9..eaf8e964ff70 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ForwardingFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ForwardingFutureTest.java @@ -17,8 +17,10 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link ForwardingFuture} */ +@NullUnmarked public class ForwardingFutureTest extends TestCase { public void testForwarding() { ForwardingObjectTester.testForwardingObject(ForwardingFuture.class); diff --git a/guava-tests/test/com/google/common/util/concurrent/ForwardingListenableFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/ForwardingListenableFutureTest.java index 827f50ea55d1..435d17d49d1d 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ForwardingListenableFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ForwardingListenableFutureTest.java @@ -17,12 +17,14 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ForwardingListenableFuture}. * * @author Ben Yu */ +@NullUnmarked public class ForwardingListenableFutureTest extends TestCase { public void testForwarding() { ForwardingObjectTester.testForwardingObject(ForwardingListenableFuture.class); diff --git a/guava-tests/test/com/google/common/util/concurrent/ForwardingListeningExecutorServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/ForwardingListeningExecutorServiceTest.java index ecfa7ddb32bb..1eabe021238d 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ForwardingListeningExecutorServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ForwardingListeningExecutorServiceTest.java @@ -17,8 +17,10 @@ package com.google.common.util.concurrent; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link ForwardingListeningExecutorService} */ +@NullUnmarked public class ForwardingListeningExecutorServiceTest extends TestCase { public void testForwarding() { ForwardingObjectTester.testForwardingObject(ForwardingListeningExecutorService.class); diff --git a/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTester.java b/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTester.java index ad391efdc5d1..24eff3ef47b3 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTester.java +++ b/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTester.java @@ -26,12 +26,14 @@ import com.google.common.testing.ForwardingWrapperTester; import java.lang.reflect.Method; import java.util.Arrays; +import org.jspecify.annotations.NullUnmarked; /** * Tester for typical subclass of {@link ForwardingObject} by using Mockito. * * @author Ben Yu */ +@NullUnmarked final class ForwardingObjectTester { private static final Method DELEGATE_METHOD; diff --git a/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTesterTest.java b/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTesterTest.java index 51a0842af36d..d96ef1e2ddbe 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTesterTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTesterTest.java @@ -18,12 +18,14 @@ import com.google.common.collect.ForwardingObject; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ForwardingObjectTester}. * * @author Ben Yu */ +@NullUnmarked public class ForwardingObjectTesterTest extends TestCase { public void testFailsToForward() { diff --git a/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java b/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java index df112c169776..107af768917b 100644 --- a/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java @@ -26,6 +26,7 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.Executor; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -34,6 +35,7 @@ * @author Anthony Zana */ @GwtCompatible +@NullUnmarked public class FutureCallbackTest extends TestCase { public void testSameThreadSuccess() { SettableFuture f = SettableFuture.create(); diff --git a/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedInputs.java b/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedInputs.java index 0ae248837af5..d2b7a3f400db 100644 --- a/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedInputs.java +++ b/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedInputs.java @@ -19,11 +19,13 @@ import com.google.common.annotations.GwtCompatible; import java.util.concurrent.Future; import javax.annotation.CheckForNull; +import org.jspecify.annotations.NullUnmarked; /** * Classes and futures used in {@link FuturesGetCheckedTest} and {@link FuturesGetUncheckedTest}. */ @GwtCompatible +@NullUnmarked final class FuturesGetCheckedInputs { static final Exception CHECKED_EXCEPTION = new Exception("mymessage"); static final Future FAILED_FUTURE_CHECKED_EXCEPTION = diff --git a/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java b/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java index c08881620245..7a9e818df755 100644 --- a/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java @@ -49,8 +49,10 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link Futures#getChecked(Future, Class)}. */ +@NullUnmarked public class FuturesGetCheckedTest extends TestCase { // Boring untimed-get tests: diff --git a/guava-tests/test/com/google/common/util/concurrent/FuturesGetDoneTest.java b/guava-tests/test/com/google/common/util/concurrent/FuturesGetDoneTest.java index c19f62d8cbb6..9a8b1e6dff74 100644 --- a/guava-tests/test/com/google/common/util/concurrent/FuturesGetDoneTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/FuturesGetDoneTest.java @@ -25,10 +25,12 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** Unit tests for {@link Futures#getDone}. */ @GwtCompatible +@NullUnmarked public class FuturesGetDoneTest extends TestCase { public void testSuccessful() throws ExecutionException { assertThat(getDone(immediateFuture("a"))).isEqualTo("a"); diff --git a/guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java b/guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java index 3d2e1673986b..b2cb616bd710 100644 --- a/guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java @@ -36,9 +36,11 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.Future; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link Futures#getUnchecked(Future)}. */ @GwtCompatible(emulated = true) +@NullUnmarked public class FuturesGetUncheckedTest extends TestCase { public void testGetUnchecked_success() { assertEquals("foo", getUnchecked(immediateFuture("foo"))); diff --git a/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java b/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java index 133bd37d97fb..9c58e89c1e6d 100644 --- a/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java @@ -27,12 +27,14 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Futures#transformAsync(ListenableFuture, AsyncFunction, Executor)}. * * @author Nishant Thakkar */ +@NullUnmarked public class FuturesTransformAsyncTest extends AbstractChainedListenableFutureTest { protected static final int SLOW_OUTPUT_VALID_INPUT_DATA = 2; protected static final int SLOW_FUNC_VALID_INPUT_DATA = 3; diff --git a/guava-tests/test/com/google/common/util/concurrent/FuturesTransformTest.java b/guava-tests/test/com/google/common/util/concurrent/FuturesTransformTest.java index 9f211dd8b8b2..301bdb6a6fc0 100644 --- a/guava-tests/test/com/google/common/util/concurrent/FuturesTransformTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/FuturesTransformTest.java @@ -21,12 +21,14 @@ import com.google.common.base.Function; import java.lang.reflect.UndeclaredThrowableException; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Futures#transform(ListenableFuture, Function, Executor)}. * * @author Nishant Thakkar */ +@NullUnmarked public class FuturesTransformTest extends AbstractChainedListenableFutureTest { private static final String RESULT_DATA = "SUCCESS"; private static final UndeclaredThrowableException WRAPPED_EXCEPTION = diff --git a/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java b/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java index 5276b189fafe..bda4dcac5e85 100644 --- a/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java @@ -34,6 +34,7 @@ import java.util.concurrent.TimeUnit; import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -46,6 +47,7 @@ * * @author Justin T. Sampson */ +@NullUnmarked public class GeneratedMonitorTest extends TestCase { public static TestSuite suite() { diff --git a/guava-tests/test/com/google/common/util/concurrent/InterruptibleMonitorTest.java b/guava-tests/test/com/google/common/util/concurrent/InterruptibleMonitorTest.java index bb3b43b9d16b..44126f5fed51 100644 --- a/guava-tests/test/com/google/common/util/concurrent/InterruptibleMonitorTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/InterruptibleMonitorTest.java @@ -16,12 +16,14 @@ package com.google.common.util.concurrent; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Monitor}'s interruptible methods. * * @author Justin T. Sampson */ +@NullUnmarked public class InterruptibleMonitorTest extends MonitorTestCase { public InterruptibleMonitorTest() { diff --git a/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java b/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java index 2cf436524be3..cdeb907d8207 100644 --- a/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java @@ -24,8 +24,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.locks.LockSupport; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; +@NullUnmarked public final class InterruptibleTaskTest extends TestCase { // Regression test for a deadlock where a task could be stuck busy waiting for the task to diff --git a/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java b/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java index 919b0c8cec62..7460daad43cf 100644 --- a/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java +++ b/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java @@ -25,6 +25,7 @@ import com.google.common.testing.TearDownAccepter; import java.util.concurrent.TimeUnit; import java.util.logging.Logger; +import org.jspecify.annotations.NullUnmarked; /** * Utilities for performing thread interruption in tests @@ -32,6 +33,7 @@ * @author Kevin Bourrillion * @author Chris Povirk */ +@NullUnmarked final class InterruptionUtil { private static final Logger logger = Logger.getLogger(InterruptionUtil.class.getName()); diff --git a/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java b/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java index 5c0ad33f9e4b..d95939b56c0f 100644 --- a/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java +++ b/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java @@ -48,6 +48,7 @@ import java.util.concurrent.atomic.AtomicReference; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Base class for JSR166 Junit TCK tests. Defines some constants, utility methods and classes, as @@ -101,6 +102,7 @@ */ // We call threadUnexpectedException, which does the right thing for errors. @SuppressWarnings("AssertionFailureIgnored") +@NullUnmarked abstract class JSR166TestCase extends TestCase { private static final boolean useSecurityManager = Boolean.getBoolean("jsr166.useSecurityManager"); diff --git a/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java b/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java index a702606d2303..d762292408f9 100644 --- a/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java @@ -33,6 +33,7 @@ import java.util.concurrent.TimeUnit; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link JdkFutureAdapters}. @@ -40,6 +41,7 @@ * @author Sven Mawson * @author Kurt Alfred Kluever */ +@NullUnmarked public class JdkFutureAdaptersTest extends TestCase { private static final String DATA1 = "data"; diff --git a/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java b/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java index a0911e09119d..4661e1df9a3f 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java @@ -26,12 +26,14 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test case for {@link ListenableFutureTask}. * * @author Sven Mawson */ +@NullUnmarked public class ListenableFutureTaskTest extends TestCase { private ExecutorService exec; diff --git a/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTest.java index 5c12696abe83..e9efc76df802 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTest.java @@ -21,8 +21,10 @@ import java.util.concurrent.Executor; import java.util.concurrent.Future; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Test for {@link ListenableFuture}. */ +@NullUnmarked public class ListenableFutureTest extends TestCase { public void testNoNewApis() throws Exception { assertWithMessage( diff --git a/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java b/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java index cadfce5224a7..96bf05887b96 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java +++ b/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java @@ -30,6 +30,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -37,6 +38,7 @@ * * @author Sven Mawson */ +@NullUnmarked public class ListenableFutureTester { private final ExecutorService exec; diff --git a/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java b/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java index e0eb32e6a54f..7cf21dd72298 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java @@ -31,8 +31,10 @@ import java.util.logging.Level; import java.util.logging.Logger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for {@link ListenerCallQueue}. */ +@NullUnmarked public class ListenerCallQueueTest extends TestCase { private static final ListenerCallQueue.Event THROWING_EVENT = diff --git a/guava-tests/test/com/google/common/util/concurrent/ListeningExecutorServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/ListeningExecutorServiceTest.java index 1b1bcb6794bf..30c477c8678f 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ListeningExecutorServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ListeningExecutorServiceTest.java @@ -32,7 +32,9 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; +@NullUnmarked public final class ListeningExecutorServiceTest extends TestCase { private Collection> recordedTasks; diff --git a/guava-tests/test/com/google/common/util/concurrent/ListeningScheduledExecutorServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/ListeningScheduledExecutorServiceTest.java index 39953bc046c1..f0de0941bf44 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ListeningScheduledExecutorServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ListeningScheduledExecutorServiceTest.java @@ -28,8 +28,10 @@ import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Tests for default methods of the interface. */ +@NullUnmarked public class ListeningScheduledExecutorServiceTest extends TestCase { private Runnable recordedCommand; diff --git a/guava-tests/test/com/google/common/util/concurrent/MonitorTestCase.java b/guava-tests/test/com/google/common/util/concurrent/MonitorTestCase.java index 44f8d31f2896..317b858c10c4 100644 --- a/guava-tests/test/com/google/common/util/concurrent/MonitorTestCase.java +++ b/guava-tests/test/com/google/common/util/concurrent/MonitorTestCase.java @@ -20,12 +20,14 @@ import com.google.common.testing.TearDownStack; import java.util.Random; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Monitor}, either interruptible or uninterruptible. * * @author Justin T. Sampson */ +@NullUnmarked public abstract class MonitorTestCase extends TestCase { public class TestGuard extends Monitor.Guard { diff --git a/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java b/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java index 0687e287acbb..f592e7995afb 100644 --- a/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java @@ -75,6 +75,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; import org.mockito.InOrder; import org.mockito.Mockito; @@ -84,6 +85,7 @@ * * @author Kyle Littlefield (klittle) */ +@NullUnmarked public class MoreExecutorsTest extends JSR166TestCase { private static final Runnable EMPTY_RUNNABLE = diff --git a/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java b/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java index 08dfa6514fb6..a73e127916c4 100644 --- a/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java @@ -38,6 +38,7 @@ import java.util.Random; import java.util.concurrent.TimeUnit; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; import org.mockito.Mockito; /** @@ -45,6 +46,7 @@ * * @author Dimitris Andreou */ +@NullUnmarked public class RateLimiterTest extends TestCase { private static final double EPSILON = 1e-8; diff --git a/guava-tests/test/com/google/common/util/concurrent/RunnablesTest.java b/guava-tests/test/com/google/common/util/concurrent/RunnablesTest.java index c4bd1c7c4ec6..6203761caf15 100644 --- a/guava-tests/test/com/google/common/util/concurrent/RunnablesTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/RunnablesTest.java @@ -18,6 +18,7 @@ import com.google.common.annotations.GwtCompatible; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit tests for {@link Runnables}. @@ -25,6 +26,7 @@ * @author Olivier Pernet */ @GwtCompatible +@NullUnmarked public class RunnablesTest extends TestCase { public void testDoNothingRunnableIsSingleton() { assertSame(Runnables.doNothing(), Runnables.doNothing()); diff --git a/guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java b/guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java index 7e7d4ea6e3df..3b4ac0383381 100644 --- a/guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java @@ -38,12 +38,14 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests {@link SequentialExecutor}. * * @author JJ Furman */ +@NullUnmarked public class SequentialExecutorTest extends TestCase { private static class FakeExecutor implements Executor { diff --git a/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java b/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java index 12052571452a..be35f06ad917 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java @@ -48,6 +48,7 @@ import java.util.logging.LogRecord; import java.util.logging.Logger; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link ServiceManager}. @@ -55,6 +56,7 @@ * @author Luke Sandberg * @author Chris Nokleberg */ +@NullUnmarked public class ServiceManagerTest extends TestCase { private static class NoOpService extends AbstractService { diff --git a/guava-tests/test/com/google/common/util/concurrent/ServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/ServiceTest.java index 98b8033d901b..53e299c70dc3 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ServiceTest.java @@ -25,8 +25,10 @@ import java.util.Locale; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** Unit tests for {@link Service} */ +@NullUnmarked public class ServiceTest extends TestCase { /** Assert on the comparison ordering of the State enum since we guarantee it. */ diff --git a/guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java index 5934fd9df998..23c39af8effe 100644 --- a/guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java @@ -24,12 +24,14 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test cases for {@link SettableFuture}. * * @author Sven Mawson */ +@NullUnmarked public class SettableFutureTest extends TestCase { private SettableFuture future; diff --git a/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java b/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java index 314b754aa833..88d12176d8e7 100644 --- a/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java @@ -28,6 +28,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Unit test for {@link SimpleTimeLimiter}. @@ -35,6 +36,7 @@ * @author kevinb * @author Jens Nyman */ +@NullUnmarked public class SimpleTimeLimiterTest extends TestCase { private static final long DELAY_MS = 50; diff --git a/guava-tests/test/com/google/common/util/concurrent/StripedTest.java b/guava-tests/test/com/google/common/util/concurrent/StripedTest.java index ff826c32e32b..dadba8cc3ec5 100644 --- a/guava-tests/test/com/google/common/util/concurrent/StripedTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/StripedTest.java @@ -37,12 +37,14 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantReadWriteLock; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for Striped. * * @author Dimitris Andreou */ +@NullUnmarked public class StripedTest extends TestCase { private static List> strongImplementations() { return ImmutableList.of( diff --git a/guava-tests/test/com/google/common/util/concurrent/SupplementalMonitorTest.java b/guava-tests/test/com/google/common/util/concurrent/SupplementalMonitorTest.java index 62b69aec7bca..1fcbf03b280d 100644 --- a/guava-tests/test/com/google/common/util/concurrent/SupplementalMonitorTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/SupplementalMonitorTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Supplemental tests for {@link Monitor}. @@ -34,6 +35,7 @@ * * @author Justin T. Sampson */ +@NullUnmarked public class SupplementalMonitorTest extends TestCase { public void testLeaveWithoutEnterThrowsIMSE() { diff --git a/guava-tests/test/com/google/common/util/concurrent/TestExceptions.java b/guava-tests/test/com/google/common/util/concurrent/TestExceptions.java index 4f71d8e2a860..3a0496818fbe 100644 --- a/guava-tests/test/com/google/common/util/concurrent/TestExceptions.java +++ b/guava-tests/test/com/google/common/util/concurrent/TestExceptions.java @@ -17,9 +17,11 @@ package com.google.common.util.concurrent; import com.google.common.annotations.GwtCompatible; +import org.jspecify.annotations.NullUnmarked; /** Exception classes for use in tests. */ @GwtCompatible +@NullUnmarked final class TestExceptions { static class SomeError extends Error {} diff --git a/guava-tests/test/com/google/common/util/concurrent/TestThread.java b/guava-tests/test/com/google/common/util/concurrent/TestThread.java index d615f929eafd..7c3186da5fc5 100644 --- a/guava-tests/test/com/google/common/util/concurrent/TestThread.java +++ b/guava-tests/test/com/google/common/util/concurrent/TestThread.java @@ -29,6 +29,7 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.TimeoutException; import junit.framework.AssertionFailedError; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -48,6 +49,7 @@ * @param the type of the lock-like object to be used * @author Justin T. Sampson */ +@NullUnmarked public final class TestThread extends Thread implements TearDown { private static final long DUE_DILIGENCE_MILLIS = 100; diff --git a/guava-tests/test/com/google/common/util/concurrent/ThreadFactoryBuilderTest.java b/guava-tests/test/com/google/common/util/concurrent/ThreadFactoryBuilderTest.java index 09b3ec7ee7af..c29e8cb04f99 100644 --- a/guava-tests/test/com/google/common/util/concurrent/ThreadFactoryBuilderTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/ThreadFactoryBuilderTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for ThreadFactoryBuilder. @@ -32,6 +33,7 @@ * @author Kurt Alfred Kluever * @author Martin Buchholz */ +@NullUnmarked public class ThreadFactoryBuilderTest extends TestCase { private final Runnable monitoredRunnable = new Runnable() { diff --git a/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java index 1f2eccad932d..f2934358cbc0 100644 --- a/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java @@ -19,12 +19,14 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.util.concurrent.AbstractFuture.TrustedFuture; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link AbstractFuture} that use a {@link TrustedFuture} for {@link * AbstractFuture#setFuture} calls. */ @GwtCompatible +@NullUnmarked public class TrustedInputFutureTest extends AbstractAbstractFutureTest { @Override AbstractFuture newDelegate() { diff --git a/guava-tests/test/com/google/common/util/concurrent/UncaughtExceptionHandlersTest.java b/guava-tests/test/com/google/common/util/concurrent/UncaughtExceptionHandlersTest.java index 4a26b4976578..f488040b8d1d 100644 --- a/guava-tests/test/com/google/common/util/concurrent/UncaughtExceptionHandlersTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/UncaughtExceptionHandlersTest.java @@ -21,8 +21,12 @@ import com.google.common.util.concurrent.UncaughtExceptionHandlers.Exiter; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; -/** @author Gregory Kick */ +/** + * @author Gregory Kick + */ +@NullUnmarked public class UncaughtExceptionHandlersTest extends TestCase { private Runtime runtimeMock; diff --git a/guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java b/guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java index 405772279512..52975562a499 100644 --- a/guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java +++ b/guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java @@ -23,6 +23,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import org.jspecify.annotations.NullUnmarked; /** * A {@link Future} implementation which always throws directly from calls to {@code get()} (i.e. @@ -34,6 +35,7 @@ * @author Anthony Zana */ @GwtCompatible +@NullUnmarked final class UncheckedThrowingFuture extends AbstractFuture { public static ListenableFuture throwingError(Error error) { diff --git a/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java index 7ddaf9952c99..512de121e264 100644 --- a/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java @@ -33,6 +33,7 @@ import java.util.concurrent.FutureTask; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; // TODO(cpovirk): Should this be merged into UninterruptiblesTest? /** @@ -41,6 +42,7 @@ * @author Kevin Bourrillion * @author Chris Povirk */ +@NullUnmarked public class UninterruptibleFutureTest extends TestCase { private SleepingRunnable sleeper; private Future delayedFuture; diff --git a/guava-tests/test/com/google/common/util/concurrent/UninterruptibleMonitorTest.java b/guava-tests/test/com/google/common/util/concurrent/UninterruptibleMonitorTest.java index 3e775bab5676..29c881126056 100644 --- a/guava-tests/test/com/google/common/util/concurrent/UninterruptibleMonitorTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/UninterruptibleMonitorTest.java @@ -16,12 +16,14 @@ package com.google.common.util.concurrent; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Monitor}'s uninterruptible methods. * * @author Justin T. Sampson */ +@NullUnmarked public class UninterruptibleMonitorTest extends MonitorTestCase { public UninterruptibleMonitorTest() { diff --git a/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java b/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java index a7ce880c0440..366dc00017f6 100644 --- a/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java @@ -49,12 +49,14 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link Uninterruptibles}. * * @author Anthony Zana */ +@NullUnmarked public class UninterruptiblesTest extends TestCase { private static final String EXPECTED_TAKE = "expectedTake"; diff --git a/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java index a6241d2e7120..df673a8cf7f0 100644 --- a/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java @@ -19,12 +19,14 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.util.concurrent.AbstractFuture.TrustedFuture; +import org.jspecify.annotations.NullUnmarked; /** * Tests for {@link AbstractFuture} that use a non-{@link TrustedFuture} for {@link * AbstractFuture#setFuture} calls. */ @GwtCompatible +@NullUnmarked public class UntrustedInputFutureTest extends AbstractAbstractFutureTest { @Override AbstractFuture newDelegate() { diff --git a/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java index 4b4d2afb129f..941acc6a8b2a 100644 --- a/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java @@ -36,12 +36,14 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test for {@link WrappingExecutorService} * * @author Chris Nokleberg */ +@NullUnmarked public class WrappingExecutorServiceTest extends TestCase { private static final String RESULT_VALUE = "ran"; // Uninteresting delegations diff --git a/guava-tests/test/com/google/common/util/concurrent/WrappingScheduledExecutorServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/WrappingScheduledExecutorServiceTest.java index 9eefb61e7fe4..548a45273a1b 100644 --- a/guava-tests/test/com/google/common/util/concurrent/WrappingScheduledExecutorServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/WrappingScheduledExecutorServiceTest.java @@ -31,12 +31,14 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Test for {@link WrappingScheduledExecutorService} * * @author Luke Sandberg */ +@NullUnmarked public class WrappingScheduledExecutorServiceTest extends TestCase { private static final Runnable DO_NOTHING = new Runnable() { diff --git a/guava-tests/test/com/google/common/xml/XmlEscapersTest.java b/guava-tests/test/com/google/common/xml/XmlEscapersTest.java index 00b5cf16b60b..d491115b19e1 100644 --- a/guava-tests/test/com/google/common/xml/XmlEscapersTest.java +++ b/guava-tests/test/com/google/common/xml/XmlEscapersTest.java @@ -22,6 +22,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.escape.CharEscaper; import junit.framework.TestCase; +import org.jspecify.annotations.NullUnmarked; /** * Tests for the {@link XmlEscapers} class. @@ -30,6 +31,7 @@ * @author David Beaumont */ @GwtCompatible +@NullUnmarked public class XmlEscapersTest extends TestCase { public void testXmlContentEscaper() throws Exception { diff --git a/guava/src/com/google/common/cache/LocalCache.java b/guava/src/com/google/common/cache/LocalCache.java index 73dcee0683c4..7e000990e2f0 100644 --- a/guava/src/com/google/common/cache/LocalCache.java +++ b/guava/src/com/google/common/cache/LocalCache.java @@ -87,6 +87,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; +import org.jspecify.annotations.NullUnmarked; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -104,7 +105,7 @@ "nullness", // too much trouble for the payoff }) @GwtCompatible(emulated = true) -// TODO(cpovirk): Annotate for nullness. +@NullUnmarked // TODO(cpovirk): Annotate for nullness. class LocalCache extends AbstractMap implements ConcurrentMap { /* diff --git a/guava/src/com/google/common/collect/MapMakerInternalMap.java b/guava/src/com/google/common/collect/MapMakerInternalMap.java index 44e64ebc2629..fbdae74af5a7 100644 --- a/guava/src/com/google/common/collect/MapMakerInternalMap.java +++ b/guava/src/com/google/common/collect/MapMakerInternalMap.java @@ -51,6 +51,7 @@ import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.concurrent.locks.ReentrantLock; import javax.annotation.CheckForNull; +import org.jspecify.annotations.NullUnmarked; /** * The concurrent hash map implementation built by {@link MapMaker}. @@ -73,7 +74,7 @@ "GuardedBy", // TODO(b/35466881): Fix or suppress. "nullness", // too much trouble for the payoff }) -// TODO(cpovirk): Annotate for nullness. +@NullUnmarked // TODO(cpovirk): Annotate for nullness. class MapMakerInternalMap< K, V,