diff --git a/guava-31.1-jre/com/google/common/base/Equivalence.java b/guava-31.1-jre/com/google/common/base/Equivalence.java index 082360c2..6e335127 100644 --- a/guava-31.1-jre/com/google/common/base/Equivalence.java +++ b/guava-31.1-jre/com/google/common/base/Equivalence.java @@ -5,6 +5,7 @@ import com.google.errorprone.annotations.ForOverride; import java.io.Serializable; import java.util.function.BiPredicate; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -36,7 +37,7 @@ public abstract class Equivalence implements BiPredicate { @ForOverride protected abstract int doHash(T var1); - public final Equivalence onResultOf(Function function) { + public final Equivalence onResultOf(Function function) { return new FunctionalEquivalence<>(function, this); } @@ -49,7 +50,7 @@ public abstract class Equivalence implements BiPredicate { return new PairwiseEquivalence<>(this); } - public final Predicate equivalentTo(@CheckForNull T target) { + public final Predicate<@Nullable T> equivalentTo(@CheckForNull T target) { return new Equivalence.EquivalentToPredicate<>(this, target); } diff --git a/guava-31.1-jre/com/google/common/base/FunctionalEquivalence.java b/guava-31.1-jre/com/google/common/base/FunctionalEquivalence.java index d2758cf9..bac999d4 100644 --- a/guava-31.1-jre/com/google/common/base/FunctionalEquivalence.java +++ b/guava-31.1-jre/com/google/common/base/FunctionalEquivalence.java @@ -4,16 +4,17 @@ import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; import java.io.Serializable; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @Beta @GwtCompatible final class FunctionalEquivalence extends Equivalence implements Serializable { private static final long serialVersionUID = 0L; - private final Function function; + private final Function function; private final Equivalence resultEquivalence; - FunctionalEquivalence(Function function, Equivalence resultEquivalence) { + FunctionalEquivalence(Function function, Equivalence resultEquivalence) { this.function = Preconditions.checkNotNull(function); this.resultEquivalence = Preconditions.checkNotNull(resultEquivalence); } diff --git a/guava-31.1-jre/com/google/common/base/Functions.java b/guava-31.1-jre/com/google/common/base/Functions.java index a4a69432..83cac577 100644 --- a/guava-31.1-jre/com/google/common/base/Functions.java +++ b/guava-31.1-jre/com/google/common/base/Functions.java @@ -4,6 +4,7 @@ import com.google.common.annotations.GwtCompatible; import java.io.Serializable; import java.util.Map; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -35,7 +36,7 @@ public final class Functions { return new Functions.PredicateFunction<>(predicate); } - public static Function constant(@ParametricNullness E value) { + public static Function<@Nullable Object, E> constant(@ParametricNullness E value) { return new Functions.ConstantFunction<>(value); } diff --git a/guava-31.1-jre/com/google/common/base/Joiner.java b/guava-31.1-jre/com/google/common/base/Joiner.java index 2321d051..2b551d74 100644 --- a/guava-31.1-jre/com/google/common/base/Joiner.java +++ b/guava-31.1-jre/com/google/common/base/Joiner.java @@ -10,6 +10,7 @@ import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -33,12 +34,12 @@ public class Joiner { } @CanIgnoreReturnValue - public A appendTo(A appendable, Iterable parts) throws IOException { + public A appendTo(A appendable, Iterable parts) throws IOException { return this.appendTo(appendable, parts.iterator()); } @CanIgnoreReturnValue - public A appendTo(A appendable, Iterator parts) throws IOException { + public A appendTo(A appendable, Iterator parts) throws IOException { Preconditions.checkNotNull(appendable); if (parts.hasNext()) { appendable.append(this.toString(parts.next())); @@ -53,22 +54,22 @@ public class Joiner { } @CanIgnoreReturnValue - public final A appendTo(A appendable, Object[] parts) throws IOException { + public final A appendTo(A appendable, @Nullable Object[] parts) throws IOException { return this.appendTo(appendable, Arrays.asList(parts)); } @CanIgnoreReturnValue - public final A appendTo(A appendable, @CheckForNull Object first, @CheckForNull Object second, Object... rest) throws IOException { + public final A appendTo(A appendable, @CheckForNull Object first, @CheckForNull Object second, @Nullable Object... rest) throws IOException { return this.appendTo(appendable, iterable(first, second, rest)); } @CanIgnoreReturnValue - public final StringBuilder appendTo(StringBuilder builder, Iterable parts) { + public final StringBuilder appendTo(StringBuilder builder, Iterable parts) { return this.appendTo(builder, parts.iterator()); } @CanIgnoreReturnValue - public final StringBuilder appendTo(StringBuilder builder, Iterator parts) { + public final StringBuilder appendTo(StringBuilder builder, Iterator parts) { try { this.appendTo(builder, parts); return builder; @@ -78,28 +79,28 @@ public class Joiner { } @CanIgnoreReturnValue - public final StringBuilder appendTo(StringBuilder builder, Object[] parts) { + public final StringBuilder appendTo(StringBuilder builder, @Nullable Object[] parts) { return this.appendTo(builder, Arrays.asList(parts)); } @CanIgnoreReturnValue - public final StringBuilder appendTo(StringBuilder builder, @CheckForNull Object first, @CheckForNull Object second, Object... rest) { + public final StringBuilder appendTo(StringBuilder builder, @CheckForNull Object first, @CheckForNull Object second, @Nullable Object... rest) { return this.appendTo(builder, iterable(first, second, rest)); } - public final String join(Iterable parts) { + public final String join(Iterable parts) { return this.join(parts.iterator()); } - public final String join(Iterator parts) { + public final String join(Iterator parts) { return this.appendTo(new StringBuilder(), parts).toString(); } - public final String join(Object[] parts) { + public final String join(@Nullable Object[] parts) { return this.join(Arrays.asList(parts)); } - public final String join(@CheckForNull Object first, @CheckForNull Object second, Object... rest) { + public final String join(@CheckForNull Object first, @CheckForNull Object second, @Nullable Object... rest) { return this.join(iterable(first, second, rest)); } @@ -126,7 +127,7 @@ public class Joiner { public Joiner skipNulls() { return new Joiner(this) { @Override - public A appendTo(A appendable, Iterator parts) throws IOException { + public A appendTo(A appendable, Iterator parts) throws IOException { Preconditions.checkNotNull(appendable, "appendable"); Preconditions.checkNotNull(parts, "parts"); @@ -174,7 +175,7 @@ public class Joiner { return (CharSequence)(part instanceof CharSequence ? (CharSequence)part : part.toString()); } - private static Iterable iterable(@CheckForNull final Object first, @CheckForNull final Object second, final Object[] rest) { + private static Iterable<@Nullable Object> iterable(@CheckForNull final Object first, @CheckForNull final Object second, final @Nullable Object[] rest) { Preconditions.checkNotNull(rest); return new AbstractList() { @Override diff --git a/guava-31.1-jre/com/google/common/base/Objects.java b/guava-31.1-jre/com/google/common/base/Objects.java index da27e4ba..afd7a60b 100644 --- a/guava-31.1-jre/com/google/common/base/Objects.java +++ b/guava-31.1-jre/com/google/common/base/Objects.java @@ -3,6 +3,7 @@ package com.google.common.base; import com.google.common.annotations.GwtCompatible; import java.util.Arrays; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -14,7 +15,7 @@ public final class Objects extends ExtraObjectsMethodsForWeb { return a == b || a != null && a.equals(b); } - public static int hashCode(@CheckForNull Object... objects) { + public static int hashCode(@CheckForNull @Nullable Object... objects) { return Arrays.hashCode(objects); } } diff --git a/guava-31.1-jre/com/google/common/base/Preconditions.java b/guava-31.1-jre/com/google/common/base/Preconditions.java index 26c695ef..9b47897a 100644 --- a/guava-31.1-jre/com/google/common/base/Preconditions.java +++ b/guava-31.1-jre/com/google/common/base/Preconditions.java @@ -3,6 +3,7 @@ package com.google.common.base; import com.google.common.annotations.GwtCompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -22,7 +23,7 @@ public final class Preconditions { } } - public static void checkArgument(boolean expression, String errorMessageTemplate, @CheckForNull Object... errorMessageArgs) { + public static void checkArgument(boolean expression, String errorMessageTemplate, @CheckForNull @Nullable Object... errorMessageArgs) { if (!expression) { throw new IllegalArgumentException(Strings.lenientFormat(errorMessageTemplate, errorMessageArgs)); } @@ -174,7 +175,7 @@ public final class Preconditions { } } - public static void checkState(boolean expression, @CheckForNull String errorMessageTemplate, @CheckForNull Object... errorMessageArgs) { + public static void checkState(boolean expression, @CheckForNull String errorMessageTemplate, @CheckForNull @Nullable Object... errorMessageArgs) { if (!expression) { throw new IllegalStateException(Strings.lenientFormat(errorMessageTemplate, errorMessageArgs)); } @@ -333,7 +334,7 @@ public final class Preconditions { } @CanIgnoreReturnValue - public static T checkNotNull(@CheckForNull T reference, String errorMessageTemplate, @CheckForNull Object... errorMessageArgs) { + public static T checkNotNull(@CheckForNull T reference, String errorMessageTemplate, @CheckForNull @Nullable Object... errorMessageArgs) { if (reference == null) { throw new NullPointerException(Strings.lenientFormat(errorMessageTemplate, errorMessageArgs)); } else { diff --git a/guava-31.1-jre/com/google/common/base/Strings.java b/guava-31.1-jre/com/google/common/base/Strings.java index 8a00d066..9ef6e722 100644 --- a/guava-31.1-jre/com/google/common/base/Strings.java +++ b/guava-31.1-jre/com/google/common/base/Strings.java @@ -7,6 +7,7 @@ import com.google.errorprone.annotations.InlineMeValidationDisabled; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -129,7 +130,7 @@ public final class Strings { && Character.isLowSurrogate(string.charAt(index + 1)); } - public static String lenientFormat(@CheckForNull String template, @CheckForNull Object... args) { + public static String lenientFormat(@CheckForNull String template, @CheckForNull @Nullable Object... args) { template = String.valueOf(template); if (args == null) { args = new Object[]{"(Object[])null"}; diff --git a/guava-31.1-jre/com/google/common/base/Suppliers.java b/guava-31.1-jre/com/google/common/base/Suppliers.java index b4eaf0c9..29ebe840 100644 --- a/guava-31.1-jre/com/google/common/base/Suppliers.java +++ b/guava-31.1-jre/com/google/common/base/Suppliers.java @@ -5,6 +5,7 @@ import com.google.common.annotations.VisibleForTesting; import java.io.Serializable; import java.util.concurrent.TimeUnit; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -234,7 +235,7 @@ public final class Suppliers { INSTANCE; @CheckForNull - public Object apply(Supplier input) { + public Object apply(Supplier<@Nullable Object> input) { return input.get(); } diff --git a/guava-31.1-jre/com/google/common/base/Verify.java b/guava-31.1-jre/com/google/common/base/Verify.java index f15ff3b1..361c4f4d 100644 --- a/guava-31.1-jre/com/google/common/base/Verify.java +++ b/guava-31.1-jre/com/google/common/base/Verify.java @@ -3,6 +3,7 @@ package com.google.common.base; import com.google.common.annotations.GwtCompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -13,7 +14,7 @@ public final class Verify { } } - public static void verify(boolean expression, String errorMessageTemplate, @CheckForNull Object... errorMessageArgs) { + public static void verify(boolean expression, String errorMessageTemplate, @CheckForNull @Nullable Object... errorMessageArgs) { if (!expression) { throw new VerifyException(Strings.lenientFormat(errorMessageTemplate, errorMessageArgs)); } @@ -159,7 +160,7 @@ public final class Verify { } @CanIgnoreReturnValue - public static T verifyNotNull(@CheckForNull T reference, String errorMessageTemplate, @CheckForNull Object... errorMessageArgs) { + public static T verifyNotNull(@CheckForNull T reference, String errorMessageTemplate, @CheckForNull @Nullable Object... errorMessageArgs) { if (reference == null) { throw new VerifyException(Strings.lenientFormat(errorMessageTemplate, errorMessageArgs)); } else { diff --git a/guava-31.1-jre/com/google/common/cache/CacheBuilder.java b/guava-31.1-jre/com/google/common/cache/CacheBuilder.java index 15dbaabf..989fff9e 100644 --- a/guava-31.1-jre/com/google/common/cache/CacheBuilder.java +++ b/guava-31.1-jre/com/google/common/cache/CacheBuilder.java @@ -68,23 +68,16 @@ public final class CacheBuilder { int concurrencyLevel = -1; long maximumSize = -1L; long maximumWeight = -1L; - @Nullable - Weigher weigher; - @Nullable - LocalCache.Strength keyStrength; - @Nullable - LocalCache.Strength valueStrength; + @Nullable Weigher weigher; + LocalCache.@Nullable Strength keyStrength; + LocalCache.@Nullable Strength valueStrength; long expireAfterWriteNanos = -1L; long expireAfterAccessNanos = -1L; long refreshNanos = -1L; - @Nullable - Equivalence keyEquivalence; - @Nullable - Equivalence valueEquivalence; - @Nullable - RemovalListener removalListener; - @Nullable - Ticker ticker; + @Nullable Equivalence keyEquivalence; + @Nullable Equivalence valueEquivalence; + @Nullable RemovalListener removalListener; + @Nullable Ticker ticker; Supplier statsCounterSupplier = NULL_STATS_COUNTER; private CacheBuilder() { diff --git a/guava-31.1-jre/com/google/common/cache/LocalCache.java b/guava-31.1-jre/com/google/common/cache/LocalCache.java index 911df133..76aa6e93 100644 --- a/guava-31.1-jre/com/google/common/cache/LocalCache.java +++ b/guava-31.1-jre/com/google/common/cache/LocalCache.java @@ -86,8 +86,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap final Ticker ticker; final LocalCache.EntryFactory entryFactory; final AbstractCache.StatsCounter globalStatsCounter; - @Nullable - final CacheLoader defaultLoader; + final @Nullable CacheLoader defaultLoader; static final LocalCache.ValueReference UNSET = new LocalCache.ValueReference() { @Override public Object get() { @@ -155,14 +154,11 @@ class LocalCache extends AbstractMap implements ConcurrentMap } }; @RetainedWith - @Nullable - Set keySet; + @Nullable Set keySet; @RetainedWith - @Nullable - Collection values; + @Nullable Collection values; @RetainedWith - @Nullable - Set> entrySet; + @Nullable Set> entrySet; LocalCache(CacheBuilder builder, @Nullable CacheLoader loader) { this.concurrencyLevel = Math.min(builder.getConcurrencyLevel(), 65536); @@ -364,8 +360,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap return new LocalCache.Segment<>(this, initialCapacity, maxSegmentWeight, statsCounter); } - @Nullable - V getLiveValue(ReferenceEntry entry, long now) { + @Nullable V getLiveValue(ReferenceEntry entry, long now) { if (entry.getKey() == null) { return null; } else { @@ -472,9 +467,8 @@ class LocalCache extends AbstractMap implements ConcurrentMap return Ints.saturatedCast(this.longSize()); } - @Nullable @Override - public V get(@Nullable Object key) { + public @Nullable V get(@Nullable Object key) { if (key == null) { return null; } @@ -488,8 +482,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap return this.segmentFor(hash).get(key, hash, loader); } - @Nullable - public V getIfPresent(Object key) { + public @Nullable V getIfPresent(Object key) { int hash = this.hash(Preconditions.checkNotNull(key)); V value = this.segmentFor(hash).get(key, hash); if (value == null) { @@ -501,9 +494,8 @@ class LocalCache extends AbstractMap implements ConcurrentMap return value; } - @Nullable @Override - public V getOrDefault(@Nullable Object key, @Nullable V defaultValue) { + public @Nullable V getOrDefault(@Nullable Object key, @Nullable V defaultValue) { V result = this.get(key); return result != null ? result : defaultValue; } @@ -585,8 +577,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap return var17; } - @Nullable - Map loadAll(Set keys, CacheLoader loader) throws ExecutionException { + @Nullable Map loadAll(Set keys, CacheLoader loader) throws ExecutionException { Preconditions.checkNotNull(loader); Preconditions.checkNotNull(keys); Stopwatch stopwatch = Stopwatch.createStarted(); @@ -728,7 +719,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap } @Override - public V compute(K key, BiFunction function) { + public V compute(K key, BiFunction function) { Preconditions.checkNotNull(key); Preconditions.checkNotNull(function); int hash = this.hash(key); @@ -1285,14 +1276,11 @@ class LocalCache extends AbstractMap implements ConcurrentMap abstract class HashIterator implements Iterator { int nextSegmentIndex = LocalCache.this.segments.length - 1; int nextTableIndex = -1; - @Nullable - LocalCache.Segment currentSegment; - @Nullable - AtomicReferenceArray> currentTable; - @Nullable - ReferenceEntry nextEntry; - LocalCache.WriteThroughEntry nextExternal; - LocalCache.WriteThroughEntry lastReturned; + LocalCache.@Nullable Segment currentSegment; + @Nullable AtomicReferenceArray> currentTable; + @Nullable ReferenceEntry nextEntry; + LocalCache.@Nullable WriteThroughEntry nextExternal; + LocalCache.@Nullable WriteThroughEntry lastReturned; HashIterator() { this.advance(); @@ -1412,8 +1400,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap static final class LoadingSerializationProxy extends LocalCache.ManualSerializationProxy implements LoadingCache, Serializable { private static final long serialVersionUID = 1L; - @Nullable - transient LoadingCache autoDelegate; + transient @Nullable LoadingCache autoDelegate; LoadingSerializationProxy(LocalCache cache) { super(cache); @@ -1531,7 +1518,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap } } - public V compute(K key, BiFunction function) { + public V compute(K key, BiFunction function) { this.stopwatch.start(); V previousValue; @@ -1636,9 +1623,8 @@ class LocalCache extends AbstractMap implements ConcurrentMap this.localCache = localCache; } - @Nullable @Override - public V getIfPresent(Object key) { + public @Nullable V getIfPresent(Object key) { return this.localCache.getIfPresent(key); } @@ -1728,11 +1714,9 @@ class LocalCache extends AbstractMap implements ConcurrentMap final Weigher weigher; final int concurrencyLevel; final RemovalListener removalListener; - @Nullable - final Ticker ticker; + final @Nullable Ticker ticker; final CacheLoader loader; - @Nullable - transient Cache delegate; + transient @Nullable Cache delegate; ManualSerializationProxy(LocalCache cache) { this( @@ -1918,13 +1902,10 @@ class LocalCache extends AbstractMap implements ConcurrentMap long totalWeight; int modCount; int threshold; - @Nullable - volatile AtomicReferenceArray> table; + volatile @Nullable AtomicReferenceArray> table; final long maxSegmentWeight; - @Nullable - final ReferenceQueue keyReferenceQueue; - @Nullable - final ReferenceQueue valueReferenceQueue; + final @Nullable ReferenceQueue keyReferenceQueue; + final @Nullable ReferenceQueue valueReferenceQueue; final Queue> recencyQueue; final AtomicInteger readCount = new AtomicInteger(); @GuardedBy("this") @@ -2029,8 +2010,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap } } - @Nullable - V get(Object key, int hash) { + @Nullable V get(Object key, int hash) { try { if (this.count != 0) { long now = this.map.ticker.read(); @@ -2155,7 +2135,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap return (V)var7; } - V compute(K key, int hash, BiFunction function) { + V compute(K key, int hash, BiFunction function) { LocalCache.ValueReference valueReference = null; LocalCache.ComputingValueReference computingValueReference = null; boolean createNewEntry = true; @@ -2290,8 +2270,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap return oldValue; } - @Nullable - V refresh(K key, int hash, CacheLoader loader, boolean checkTime) { + @Nullable V refresh(K key, int hash, CacheLoader loader, boolean checkTime) { LocalCache.LoadingValueReference loadingValueReference = this.insertLoadingValueReference(key, hash, checkTime); if (loadingValueReference == null) { return null; @@ -2308,8 +2287,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap return null; } - @Nullable - LocalCache.LoadingValueReference insertLoadingValueReference(K key, int hash, boolean checkTime) { + LocalCache.@Nullable LoadingValueReference insertLoadingValueReference(K key, int hash, boolean checkTime) { ReferenceEntry e = null; this.lock(); @@ -2534,8 +2512,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap return table.get(hash & table.length() - 1); } - @Nullable - ReferenceEntry getEntry(Object key, int hash) { + @Nullable ReferenceEntry getEntry(Object key, int hash) { for (ReferenceEntry e = this.getFirst(hash); e != null; e = e.getNext()) { if (e.getHash() == hash) { K entryKey = e.getKey(); @@ -2550,8 +2527,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap return null; } - @Nullable - ReferenceEntry getLiveEntry(Object key, int hash, long now) { + @Nullable ReferenceEntry getLiveEntry(Object key, int hash, long now) { ReferenceEntry e = this.getEntry(key, hash); if (e == null) { return null; @@ -2626,8 +2602,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap } } - @Nullable - V put(K key, int hash, V value, boolean onlyIfAbsent) { + @Nullable V put(K key, int hash, V value, boolean onlyIfAbsent) { this.lock(); try { @@ -2790,8 +2765,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap } } - @Nullable - V replace(K key, int hash, V newValue) { + @Nullable V replace(K key, int hash, V newValue) { this.lock(); try { @@ -2834,8 +2808,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap } } - @Nullable - V remove(Object key, int hash) { + @Nullable V remove(Object key, int hash) { this.lock(); try { @@ -3012,8 +2985,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap } @GuardedBy("this") - @Nullable - ReferenceEntry removeValueFromChain( + @Nullable ReferenceEntry removeValueFromChain( ReferenceEntry first, ReferenceEntry entry, @Nullable K key, @@ -3034,8 +3006,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap } @GuardedBy("this") - @Nullable - ReferenceEntry removeEntryFromChain(ReferenceEntry first, ReferenceEntry entry) { + @Nullable ReferenceEntry removeEntryFromChain(ReferenceEntry first, ReferenceEntry entry) { int newCount = this.count; ReferenceEntry newFirst = entry.getNext(); @@ -3438,8 +3409,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap static class StrongEntry extends LocalCache.AbstractReferenceEntry { final K key; final int hash; - @Nullable - final ReferenceEntry next; + final @Nullable ReferenceEntry next; volatile LocalCache.ValueReference valueReference = LocalCache.unset(); StrongEntry(K key, int hash, @Nullable ReferenceEntry next) { @@ -3574,15 +3544,13 @@ class LocalCache extends AbstractMap implements ConcurrentMap } interface ValueReference { - @Nullable - V get(); + @Nullable V get(); V waitForValue() throws ExecutionException; int getWeight(); - @Nullable - ReferenceEntry getEntry(); + @Nullable ReferenceEntry getEntry(); LocalCache.ValueReference copyFor(ReferenceQueue var1, @Nullable V var2, ReferenceEntry var3); @@ -3757,8 +3725,7 @@ class LocalCache extends AbstractMap implements ConcurrentMap static class WeakEntry extends WeakReference implements ReferenceEntry { final int hash; - @Nullable - final ReferenceEntry next; + final @Nullable ReferenceEntry next; volatile LocalCache.ValueReference valueReference = LocalCache.unset(); WeakEntry(ReferenceQueue queue, K key, int hash, @Nullable ReferenceEntry next) { diff --git a/guava-31.1-jre/com/google/common/cache/Striped64.java b/guava-31.1-jre/com/google/common/cache/Striped64.java index 87e5d559..3cfe34df 100644 --- a/guava-31.1-jre/com/google/common/cache/Striped64.java +++ b/guava-31.1-jre/com/google/common/cache/Striped64.java @@ -7,12 +7,13 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.Random; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; import sun.misc.Unsafe; @ElementTypesAreNonnullByDefault @GwtIncompatible abstract class Striped64 extends Number { - static final ThreadLocal threadHashCode = new ThreadLocal<>(); + static final ThreadLocal threadHashCode = new ThreadLocal<>(); static final Random rng = new Random(); static final int NCPU = Runtime.getRuntime().availableProcessors(); @CheckForNull diff --git a/guava-31.1-jre/com/google/common/collect/AbstractBiMap.java b/guava-31.1-jre/com/google/common/collect/AbstractBiMap.java index fe5358ba..cb434ede 100644 --- a/guava-31.1-jre/com/google/common/collect/AbstractBiMap.java +++ b/guava-31.1-jre/com/google/common/collect/AbstractBiMap.java @@ -17,6 +17,7 @@ import java.util.Set; import java.util.Map.Entry; import java.util.function.BiFunction; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -420,7 +421,7 @@ abstract class AbstractBiMap extends ForwardingMap implements BiMap< } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { return this.standardToArray(); } diff --git a/guava-31.1-jre/com/google/common/collect/ArrayTable.java b/guava-31.1-jre/com/google/common/collect/ArrayTable.java index 723d9016..d2cfc143 100644 --- a/guava-31.1-jre/com/google/common/collect/ArrayTable.java +++ b/guava-31.1-jre/com/google/common/collect/ArrayTable.java @@ -18,6 +18,7 @@ import java.util.Set; import java.util.Spliterator; import java.util.Map.Entry; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @Beta @@ -27,7 +28,7 @@ public final class ArrayTable extends AbstractTable implements private final ImmutableList columnList; private final ImmutableMap rowKeyToIndex; private final ImmutableMap columnKeyToIndex; - private final V[][] array; + private final @Nullable V[][][][] array; @CheckForNull private transient ArrayTable.ColumnMap columnMap; @CheckForNull @@ -38,7 +39,7 @@ public final class ArrayTable extends AbstractTable implements return new ArrayTable<>(rowKeys, columnKeys); } - public static ArrayTable create(Table table) { + public static ArrayTable create(Table table) { return table instanceof ArrayTable ? new ArrayTable<>((ArrayTable)table) : new ArrayTable<>(table); } @@ -53,7 +54,7 @@ public final class ArrayTable extends AbstractTable implements this.eraseAll(); } - private ArrayTable(Table table) { + private ArrayTable(Table table) { this(table.rowKeySet(), table.columnKeySet()); this.putAll(table); } @@ -175,7 +176,7 @@ public final class ArrayTable extends AbstractTable implements } @Override - public void putAll(Table table) { + public void putAll(Table table) { super.putAll(table); } @@ -202,14 +203,14 @@ public final class ArrayTable extends AbstractTable implements } @Override - public Set> cellSet() { + public Set> cellSet() { return super.cellSet(); } @Override - Iterator> cellIterator() { + Iterator> cellIterator() { return new AbstractIndexedListIterator>(this.size()) { - protected Table.Cell get(int index) { + protected Table.Cell get(int index) { return ArrayTable.this.getCell(index); } }; @@ -220,7 +221,7 @@ public final class ArrayTable extends AbstractTable implements return CollectSpliterators.indexed(this.size(), 273, this::getCell); } - private Table.Cell getCell(final int index) { + private Table.Cell getCell(final int index) { return new Tables.AbstractCell() { final int rowIndex = index / ArrayTable.this.columnList.size(); final int columnIndex = index % ArrayTable.this.columnList.size(); @@ -251,7 +252,7 @@ public final class ArrayTable extends AbstractTable implements } @Override - public Map column(C columnKey) { + public Map column(C columnKey) { Preconditions.checkNotNull(columnKey); Integer columnIndex = this.columnKeyToIndex.get(columnKey); return (Map)(columnIndex == null ? Collections.emptyMap() : new ArrayTable.Column(columnIndex)); @@ -262,13 +263,13 @@ public final class ArrayTable extends AbstractTable implements } @Override - public Map> columnMap() { + public Map> columnMap() { ArrayTable.ColumnMap map = this.columnMap; return map == null ? (this.columnMap = new ArrayTable.ColumnMap()) : map; } @Override - public Map row(R rowKey) { + public Map row(R rowKey) { Preconditions.checkNotNull(rowKey); Integer rowIndex = this.rowKeyToIndex.get(rowKey); return (Map)(rowIndex == null ? Collections.emptyMap() : new ArrayTable.Row(rowIndex)); @@ -279,18 +280,18 @@ public final class ArrayTable extends AbstractTable implements } @Override - public Map> rowMap() { + public Map> rowMap() { ArrayTable.RowMap map = this.rowMap; return map == null ? (this.rowMap = new ArrayTable.RowMap()) : map; } @Override - public Collection values() { + public Collection<@Nullable V> values() { return super.values(); } @Override - Iterator valuesIterator() { + Iterator<@Nullable V> valuesIterator() { return new AbstractIndexedListIterator(this.size()) { @CheckForNull @Override @@ -457,16 +458,16 @@ public final class ArrayTable extends AbstractTable implements return "Column"; } - Map getValue(int index) { + Map getValue(int index) { return ArrayTable.this.new Column(index); } - Map setValue(int index, Map newValue) { + Map setValue(int index, Map newValue) { throw new UnsupportedOperationException(); } @CheckForNull - public Map put(C key, Map value) { + public Map put(C key, Map value) { throw new UnsupportedOperationException(); } } @@ -507,16 +508,16 @@ public final class ArrayTable extends AbstractTable implements return "Row"; } - Map getValue(int index) { + Map getValue(int index) { return ArrayTable.this.new Row(index); } - Map setValue(int index, Map newValue) { + Map setValue(int index, Map newValue) { throw new UnsupportedOperationException(); } @CheckForNull - public Map put(R key, Map value) { + public Map put(R key, Map value) { throw new UnsupportedOperationException(); } } diff --git a/guava-31.1-jre/com/google/common/collect/Collections2.java b/guava-31.1-jre/com/google/common/collect/Collections2.java index 458d12a3..13487c56 100644 --- a/guava-31.1-jre/com/google/common/collect/Collections2.java +++ b/guava-31.1-jre/com/google/common/collect/Collections2.java @@ -19,6 +19,7 @@ import java.util.Objects; import java.util.Spliterator; import java.util.function.Consumer; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -219,7 +220,7 @@ public final class Collections2 { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { return Lists.newArrayList(this.iterator()).toArray(); } diff --git a/guava-31.1-jre/com/google/common/collect/CompactHashMap.java b/guava-31.1-jre/com/google/common/collect/CompactHashMap.java index e60516f3..be94256a 100644 --- a/guava-31.1-jre/com/google/common/collect/CompactHashMap.java +++ b/guava-31.1-jre/com/google/common/collect/CompactHashMap.java @@ -43,10 +43,10 @@ class CompactHashMap extends AbstractMap implements Serializable { transient int[] entries; @CheckForNull @VisibleForTesting - transient Object[] keys; + transient @Nullable Object[] keys; @CheckForNull @VisibleForTesting - transient Object[] values; + transient @Nullable Object[] values; private transient int metadata; private transient int size; @CheckForNull @@ -320,8 +320,7 @@ class CompactHashMap extends AbstractMap implements Serializable { return (V)(oldValue == NOT_FOUND ? null : oldValue); } - @Nullable - private Object removeHelper(@CheckForNull Object key) { + private @Nullable Object removeHelper(@CheckForNull Object key) { if (this.needsAllocArrays()) { return NOT_FOUND; } @@ -577,11 +576,11 @@ class CompactHashMap extends AbstractMap implements Serializable { return java.util.Objects.requireNonNull(this.entries); } - private Object[] requireKeys() { + private @Nullable Object[] requireKeys() { return java.util.Objects.requireNonNull(this.keys); } - private Object[] requireValues() { + private @Nullable Object[] requireValues() { return java.util.Objects.requireNonNull(this.values); } @@ -738,7 +737,7 @@ class CompactHashMap extends AbstractMap implements Serializable { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { if (CompactHashMap.this.needsAllocArrays()) { return new Object[0]; } @@ -892,7 +891,7 @@ class CompactHashMap extends AbstractMap implements Serializable { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { if (CompactHashMap.this.needsAllocArrays()) { return new Object[0]; } diff --git a/guava-31.1-jre/com/google/common/collect/CompactHashSet.java b/guava-31.1-jre/com/google/common/collect/CompactHashSet.java index b3bcdb2f..d40bd6a7 100644 --- a/guava-31.1-jre/com/google/common/collect/CompactHashSet.java +++ b/guava-31.1-jre/com/google/common/collect/CompactHashSet.java @@ -24,6 +24,7 @@ import java.util.Spliterator; import java.util.Spliterators; import java.util.function.Consumer; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtIncompatible @@ -37,7 +38,7 @@ class CompactHashSet extends AbstractSet implements Serializable { private transient int[] entries; @CheckForNull @VisibleForTesting - transient Object[] elements; + transient @Nullable Object[] elements; private transient int metadata; private transient int size; @@ -434,7 +435,7 @@ class CompactHashSet extends AbstractSet implements Serializable { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { if (this.needsAllocArrays()) { return new Object[0]; } @@ -531,7 +532,7 @@ class CompactHashSet extends AbstractSet implements Serializable { return java.util.Objects.requireNonNull(this.entries); } - private Object[] requireElements() { + private @Nullable Object[] requireElements() { return java.util.Objects.requireNonNull(this.elements); } diff --git a/guava-31.1-jre/com/google/common/collect/CompactHashing.java b/guava-31.1-jre/com/google/common/collect/CompactHashing.java index 8f8bcbed..2f9dea40 100644 --- a/guava-31.1-jre/com/google/common/collect/CompactHashing.java +++ b/guava-31.1-jre/com/google/common/collect/CompactHashing.java @@ -4,6 +4,7 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.base.Objects; import java.util.Arrays; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtIncompatible @@ -81,7 +82,15 @@ final class CompactHashing { return prefix & ~mask | suffix & mask; } - static int remove(@CheckForNull Object key, @CheckForNull Object value, int mask, Object table, int[] entries, Object[] keys, @CheckForNull Object[] values) { + static int remove( + @CheckForNull Object key, + @CheckForNull Object value, + int mask, + Object table, + int[] entries, + @Nullable Object[] keys, + @CheckForNull @Nullable Object[] values + ) { int hash = Hashing.smearedHash(key); int tableIndex = hash & mask; int next = tableGet(table, tableIndex); diff --git a/guava-31.1-jre/com/google/common/collect/CompactLinkedHashMap.java b/guava-31.1-jre/com/google/common/collect/CompactLinkedHashMap.java index 3818d23d..4a434b6e 100644 --- a/guava-31.1-jre/com/google/common/collect/CompactLinkedHashMap.java +++ b/guava-31.1-jre/com/google/common/collect/CompactLinkedHashMap.java @@ -13,6 +13,7 @@ import java.util.Spliterator; import java.util.Spliterators; import java.util.Map.Entry; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtIncompatible @@ -174,7 +175,7 @@ class CompactLinkedHashMap extends CompactHashMap { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { return ObjectArrays.toArrayImpl(this); } @@ -199,7 +200,7 @@ class CompactLinkedHashMap extends CompactHashMap { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { return ObjectArrays.toArrayImpl(this); } diff --git a/guava-31.1-jre/com/google/common/collect/CompactLinkedHashSet.java b/guava-31.1-jre/com/google/common/collect/CompactLinkedHashSet.java index 8c0d9a47..c3b5fe6e 100644 --- a/guava-31.1-jre/com/google/common/collect/CompactLinkedHashSet.java +++ b/guava-31.1-jre/com/google/common/collect/CompactLinkedHashSet.java @@ -10,6 +10,7 @@ import java.util.Set; import java.util.Spliterator; import java.util.Spliterators; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtIncompatible @@ -144,7 +145,7 @@ class CompactLinkedHashSet extends CompactHashSet { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { return ObjectArrays.toArrayImpl(this); } diff --git a/guava-31.1-jre/com/google/common/collect/DenseImmutableTable.java b/guava-31.1-jre/com/google/common/collect/DenseImmutableTable.java index e67d843f..52a20cbc 100644 --- a/guava-31.1-jre/com/google/common/collect/DenseImmutableTable.java +++ b/guava-31.1-jre/com/google/common/collect/DenseImmutableTable.java @@ -6,6 +6,7 @@ import java.util.Map; import java.util.Objects; import java.util.Map.Entry; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @Immutable(containerOf = {"R", "C", "V"}) @ElementTypesAreNonnullByDefault @@ -17,7 +18,7 @@ final class DenseImmutableTable extends RegularImmutableTable private final ImmutableMap> columnMap; private final int[] rowCounts; private final int[] columnCounts; - private final V[][] values; + private final @Nullable V[][][][] values; private final int[] cellRowIndices; private final int[] cellColumnIndices; diff --git a/guava-31.1-jre/com/google/common/collect/DescendingMultiset.java b/guava-31.1-jre/com/google/common/collect/DescendingMultiset.java index d013c8fd..86715019 100644 --- a/guava-31.1-jre/com/google/common/collect/DescendingMultiset.java +++ b/guava-31.1-jre/com/google/common/collect/DescendingMultiset.java @@ -6,6 +6,7 @@ import java.util.Iterator; import java.util.NavigableSet; import java.util.Set; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -115,7 +116,7 @@ abstract class DescendingMultiset extends ForwardingMultiset implements So } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { return this.standardToArray(); } diff --git a/guava-31.1-jre/com/google/common/collect/FluentIterable.java b/guava-31.1-jre/com/google/common/collect/FluentIterable.java index 6f1b9e3e..57939812 100644 --- a/guava-31.1-jre/com/google/common/collect/FluentIterable.java +++ b/guava-31.1-jre/com/google/common/collect/FluentIterable.java @@ -19,6 +19,7 @@ import java.util.List; import java.util.SortedSet; import java.util.stream.Stream; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -246,7 +247,7 @@ public abstract class FluentIterable implements Iterable { } @GwtIncompatible - public final E[] toArray(Class type) { + public final @Nullable E[][] toArray(Class type) { return Iterables.toArray(this.getDelegate(), type); } diff --git a/guava-31.1-jre/com/google/common/collect/ForwardingCollection.java b/guava-31.1-jre/com/google/common/collect/ForwardingCollection.java index ea4c3782..93c77ba5 100644 --- a/guava-31.1-jre/com/google/common/collect/ForwardingCollection.java +++ b/guava-31.1-jre/com/google/common/collect/ForwardingCollection.java @@ -6,6 +6,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Collection; import java.util.Iterator; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -76,7 +77,7 @@ public abstract class ForwardingCollection extends ForwardingObject implement } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { return this.delegate().toArray(); } diff --git a/guava-31.1-jre/com/google/common/collect/HashBiMap.java b/guava-31.1-jre/com/google/common/collect/HashBiMap.java index 4cc405ff..321a59bf 100644 --- a/guava-31.1-jre/com/google/common/collect/HashBiMap.java +++ b/guava-31.1-jre/com/google/common/collect/HashBiMap.java @@ -22,13 +22,14 @@ import java.util.Map.Entry; import java.util.function.BiConsumer; import java.util.function.BiFunction; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) public final class HashBiMap extends Maps.IteratorBasedAbstractMap implements BiMap, Serializable { private static final double LOAD_FACTOR = 1.0; - private transient HashBiMap.BiEntry[] hashTableKToV; - private transient HashBiMap.BiEntry[] hashTableVToK; + private transient HashBiMap.@Nullable BiEntry[] hashTableKToV; + private transient HashBiMap.@Nullable BiEntry[] hashTableVToK; @CheckForNull @Weak private transient HashBiMap.BiEntry firstInKeyInsertionOrder; diff --git a/guava-31.1-jre/com/google/common/collect/ImmutableCollection.java b/guava-31.1-jre/com/google/common/collect/ImmutableCollection.java index b1bd3819..b0cc3aac 100644 --- a/guava-31.1-jre/com/google/common/collect/ImmutableCollection.java +++ b/guava-31.1-jre/com/google/common/collect/ImmutableCollection.java @@ -13,6 +13,7 @@ import java.util.Spliterator; import java.util.Spliterators; import java.util.function.Predicate; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @DoNotMock("Use ImmutableList.of or another implementation") @ElementTypesAreNonnullByDefault @@ -140,7 +141,7 @@ public abstract class ImmutableCollection extends AbstractCollection imple abstract boolean isPartialView(); @CanIgnoreReturnValue - int copyIntoArray(Object[] dst, int offset) { + int copyIntoArray(@Nullable Object[] dst, int offset) { for (E e : this) { dst[offset++] = e; } diff --git a/guava-31.1-jre/com/google/common/collect/ImmutableList.java b/guava-31.1-jre/com/google/common/collect/ImmutableList.java index f7644fd8..925877ae 100644 --- a/guava-31.1-jre/com/google/common/collect/ImmutableList.java +++ b/guava-31.1-jre/com/google/common/collect/ImmutableList.java @@ -22,6 +22,7 @@ import java.util.function.Consumer; import java.util.function.UnaryOperator; import java.util.stream.Collector; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true, emulated = true) @@ -155,7 +156,7 @@ public abstract class ImmutableList extends ImmutableCollection implements return asImmutableList(elements, elements.length); } - static ImmutableList asImmutableList(Object[] elements, int length) { + static ImmutableList asImmutableList(@Nullable Object[] elements, int length) { switch (length) { case 0: return of(); @@ -288,7 +289,7 @@ public abstract class ImmutableList extends ImmutableCollection implements } @Override - int copyIntoArray(Object[] dst, int offset) { + int copyIntoArray(@Nullable Object[] dst, int offset) { int size = this.size(); for (int i = 0; i < size; i++) { @@ -341,7 +342,7 @@ public abstract class ImmutableList extends ImmutableCollection implements public static final class Builder extends ImmutableCollection.Builder { @VisibleForTesting - Object[] contents; + @Nullable Object[] contents; private int size; private boolean forceCopy; @@ -379,7 +380,7 @@ public abstract class ImmutableList extends ImmutableCollection implements return this; } - private void add(Object[] elements, int n) { + private void add(@Nullable Object[] elements, int n) { this.getReadyToExpandTo(this.size + n); System.arraycopy(elements, 0, this.contents, this.size, n); this.size += n; diff --git a/guava-31.1-jre/com/google/common/collect/ImmutableMap.java b/guava-31.1-jre/com/google/common/collect/ImmutableMap.java index 78d5ec8c..38a7de0d 100644 --- a/guava-31.1-jre/com/google/common/collect/ImmutableMap.java +++ b/guava-31.1-jre/com/google/common/collect/ImmutableMap.java @@ -29,6 +29,7 @@ import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.stream.Collector; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @DoNotMock("Use ImmutableMap.of or another implementation") @ElementTypesAreNonnullByDefault @@ -264,7 +265,7 @@ public abstract class ImmutableMap implements Map, Serializable { @Deprecated @DoNotCall("Always throws UnsupportedOperationException") @Override - public final V compute(K key, BiFunction remappingFunction) { + public final V compute(K key, BiFunction remappingFunction) { throw new UnsupportedOperationException(); } @@ -415,7 +416,7 @@ public abstract class ImmutableMap implements Map, Serializable { public static class Builder { @CheckForNull Comparator valueComparator; - Entry[] entries; + @Nullable Entry[] entries; int size; boolean entriesUsed; diff --git a/guava-31.1-jre/com/google/common/collect/ImmutableMapEntrySet.java b/guava-31.1-jre/com/google/common/collect/ImmutableMapEntrySet.java index e3d66ffb..59c02197 100644 --- a/guava-31.1-jre/com/google/common/collect/ImmutableMapEntrySet.java +++ b/guava-31.1-jre/com/google/common/collect/ImmutableMapEntrySet.java @@ -7,6 +7,7 @@ import java.util.Spliterator; import java.util.Map.Entry; import java.util.function.Consumer; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -85,7 +86,7 @@ abstract class ImmutableMapEntrySet extends ImmutableSet.CachingAsList extends BaseImmutableMultimap valueCollection : this.multimap.map.values()) { offset = valueCollection.copyIntoArray(dst, offset); } diff --git a/guava-31.1-jre/com/google/common/collect/ImmutableMultiset.java b/guava-31.1-jre/com/google/common/collect/ImmutableMultiset.java index d97db6be..be84accc 100644 --- a/guava-31.1-jre/com/google/common/collect/ImmutableMultiset.java +++ b/guava-31.1-jre/com/google/common/collect/ImmutableMultiset.java @@ -18,6 +18,7 @@ import java.util.function.Function; import java.util.function.ToIntFunction; import java.util.stream.Collector; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true, emulated = true) @@ -174,7 +175,7 @@ public abstract class ImmutableMultiset extends ImmutableMultisetGwtSerializa @GwtIncompatible @Override - int copyIntoArray(Object[] dst, int offset) { + int copyIntoArray(@Nullable Object[] dst, int offset) { for (Multiset.Entry entry : this.entrySet()) { Arrays.fill(dst, offset, offset + entry.getCount(), entry.getElement()); offset += entry.getCount(); diff --git a/guava-31.1-jre/com/google/common/collect/ImmutableRangeMap.java b/guava-31.1-jre/com/google/common/collect/ImmutableRangeMap.java index 7e796edb..8e973b0b 100644 --- a/guava-31.1-jre/com/google/common/collect/ImmutableRangeMap.java +++ b/guava-31.1-jre/com/google/common/collect/ImmutableRangeMap.java @@ -16,6 +16,7 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Collector; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @Beta @@ -143,7 +144,7 @@ public class ImmutableRangeMap, V> implements RangeMap range, @CheckForNull V value, BiFunction remappingFunction) { + public final void merge(Range range, @CheckForNull V value, BiFunction remappingFunction) { throw new UnsupportedOperationException(); } diff --git a/guava-31.1-jre/com/google/common/collect/ImmutableSet.java b/guava-31.1-jre/com/google/common/collect/ImmutableSet.java index f23a7f1f..3aee5f2d 100644 --- a/guava-31.1-jre/com/google/common/collect/ImmutableSet.java +++ b/guava-31.1-jre/com/google/common/collect/ImmutableSet.java @@ -346,7 +346,7 @@ public abstract class ImmutableSet extends ImmutableCollection implements } @Override - int copyIntoArray(Object[] dst, int offset) { + int copyIntoArray(@Nullable Object[] dst, int offset) { return this.asList().copyIntoArray(dst, offset); } @@ -405,8 +405,7 @@ public abstract class ImmutableSet extends ImmutableCollection implements } private static final class RegularSetBuilderImpl extends ImmutableSet.SetBuilderImpl { - @Nullable - private Object[] hashTable; + private @Nullable Object @Nullable [] hashTable; private int maxRunBeforeFallback; private int expandTableThreshold; private int hashCode; @@ -547,7 +546,7 @@ public abstract class ImmutableSet extends ImmutableCollection implements this.expandTableThreshold = (int)(0.7 * newTableSize); } - static boolean hashFloodingDetected(Object[] hashTable) { + static boolean hashFloodingDetected(@Nullable Object[] hashTable) { int maxRunBeforeFallback = maxRunBeforeFallback(hashTable.length); int mask = hashTable.length - 1; int knownRunStart = 0; diff --git a/guava-31.1-jre/com/google/common/collect/ImmutableSortedMap.java b/guava-31.1-jre/com/google/common/collect/ImmutableSortedMap.java index 97d9bb3b..6f8ec480 100644 --- a/guava-31.1-jre/com/google/common/collect/ImmutableSortedMap.java +++ b/guava-31.1-jre/com/google/common/collect/ImmutableSortedMap.java @@ -20,6 +20,7 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collector; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true, emulated = true) @@ -196,7 +197,7 @@ public final class ImmutableSortedMap extends ImmutableSortedMapFauxveride } private static ImmutableSortedMap fromEntries( - final Comparator comparator, boolean sameComparator, Entry[] entryArray, int size + final Comparator comparator, boolean sameComparator, @Nullable Entry[] entryArray, int size ) { switch (size) { case 0: diff --git a/guava-31.1-jre/com/google/common/collect/IndexedImmutableSet.java b/guava-31.1-jre/com/google/common/collect/IndexedImmutableSet.java index b035a676..456490b9 100644 --- a/guava-31.1-jre/com/google/common/collect/IndexedImmutableSet.java +++ b/guava-31.1-jre/com/google/common/collect/IndexedImmutableSet.java @@ -5,6 +5,7 @@ import com.google.common.annotations.GwtIncompatible; import com.google.common.base.Preconditions; import java.util.Spliterator; import java.util.function.Consumer; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -33,7 +34,7 @@ abstract class IndexedImmutableSet extends ImmutableSet.CachingAsList { @GwtIncompatible @Override - int copyIntoArray(Object[] dst, int offset) { + int copyIntoArray(@Nullable Object[] dst, int offset) { return this.asList().copyIntoArray(dst, offset); } diff --git a/guava-31.1-jre/com/google/common/collect/Iterables.java b/guava-31.1-jre/com/google/common/collect/Iterables.java index d31e06e4..8d6d7b09 100644 --- a/guava-31.1-jre/com/google/common/collect/Iterables.java +++ b/guava-31.1-jre/com/google/common/collect/Iterables.java @@ -20,6 +20,7 @@ import java.util.Spliterator; import java.util.function.Consumer; import java.util.stream.Stream; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -43,7 +44,7 @@ public final class Iterables { return iterable instanceof Collection ? ((Collection)iterable).size() : Iterators.size(iterable.iterator()); } - public static boolean contains(Iterable iterable, @CheckForNull Object element) { + public static boolean contains(Iterable iterable, @CheckForNull Object element) { if (iterable instanceof Collection) { Collection collection = (Collection)iterable; return Collections2.safeContains(collection, element); @@ -114,7 +115,7 @@ public final class Iterables { } @GwtIncompatible - public static T[] toArray(Iterable iterable, Class type) { + public static @Nullable T[][] toArray(Iterable iterable, Class type) { return toArray(iterable, ObjectArrays.newArray(type, 0)); } @@ -123,7 +124,7 @@ public final class Iterables { return (T[])collection.toArray(array); } - static Object[] toArray(Iterable iterable) { + static @Nullable Object[] toArray(Iterable iterable) { return castOrCopyToCollection(iterable).toArray(); } @@ -208,12 +209,12 @@ public final class Iterables { }; } - public static Iterable> paddedPartition(final Iterable iterable, final int size) { + public static Iterable> paddedPartition(final Iterable iterable, final int size) { Preconditions.checkNotNull(iterable); Preconditions.checkArgument(size > 0); return new FluentIterable>() { @Override - public Iterator> iterator() { + public Iterator> iterator() { return Iterators.paddedPartition(iterable.iterator(), size); } }; diff --git a/guava-31.1-jre/com/google/common/collect/Iterators.java b/guava-31.1-jre/com/google/common/collect/Iterators.java index 5b608593..d1d8aae5 100644 --- a/guava-31.1-jre/com/google/common/collect/Iterators.java +++ b/guava-31.1-jre/com/google/common/collect/Iterators.java @@ -25,6 +25,7 @@ import java.util.NoSuchElementException; import java.util.PriorityQueue; import java.util.Queue; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -259,7 +260,7 @@ public final class Iterators { return cycle(Lists.newArrayList(elements)); } - private static > Iterator consumingForArray(final I... elements) { + private static > Iterator consumingForArray(final @Nullable I[]... elements) { return new UnmodifiableIterator() { int index = 0; @@ -322,11 +323,11 @@ public final class Iterators { return partitionImpl(iterator, size, false); } - public static UnmodifiableIterator> paddedPartition(Iterator iterator, int size) { + public static UnmodifiableIterator> paddedPartition(Iterator iterator, int size) { return partitionImpl(iterator, size, true); } - private static UnmodifiableIterator> partitionImpl(final Iterator iterator, final int size, final boolean pad) { + private static UnmodifiableIterator> partitionImpl(final Iterator iterator, final int size, final boolean pad) { Preconditions.checkNotNull(iterator); Preconditions.checkArgument(size > 0); return new UnmodifiableIterator>() { diff --git a/guava-31.1-jre/com/google/common/collect/JdkBackedImmutableBiMap.java b/guava-31.1-jre/com/google/common/collect/JdkBackedImmutableBiMap.java index 652100ec..bef74ec2 100644 --- a/guava-31.1-jre/com/google/common/collect/JdkBackedImmutableBiMap.java +++ b/guava-31.1-jre/com/google/common/collect/JdkBackedImmutableBiMap.java @@ -8,6 +8,7 @@ import java.util.Map; import java.util.Objects; import java.util.Map.Entry; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -21,7 +22,7 @@ final class JdkBackedImmutableBiMap extends ImmutableBiMap { private transient JdkBackedImmutableBiMap inverse; @VisibleForTesting - static ImmutableBiMap create(int n, Entry[] entryArray) { + static ImmutableBiMap create(int n, @Nullable Entry[] entryArray) { Map forwardDelegate = Maps.newHashMapWithExpectedSize(n); Map backwardDelegate = Maps.newHashMapWithExpectedSize(n); diff --git a/guava-31.1-jre/com/google/common/collect/LinkedHashMultimap.java b/guava-31.1-jre/com/google/common/collect/LinkedHashMultimap.java index 54af5990..d8d3e13d 100644 --- a/guava-31.1-jre/com/google/common/collect/LinkedHashMultimap.java +++ b/guava-31.1-jre/com/google/common/collect/LinkedHashMultimap.java @@ -21,6 +21,7 @@ import java.util.Spliterators; import java.util.Map.Entry; import java.util.function.Consumer; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true, emulated = true) @@ -273,7 +274,7 @@ public final class LinkedHashMultimap extends LinkedHashMultimapGwtSeriali @ParametricNullness private final Object key; @VisibleForTesting - LinkedHashMultimap.ValueEntry[] hashTable; + LinkedHashMultimap.@Nullable ValueEntry[] hashTable; private int size = 0; private int modCount = 0; private LinkedHashMultimap.ValueSetLink firstEntry; diff --git a/guava-31.1-jre/com/google/common/collect/MapMakerInternalMap.java b/guava-31.1-jre/com/google/common/collect/MapMakerInternalMap.java index f9b6813b..2cc1aba7 100644 --- a/guava-31.1-jre/com/google/common/collect/MapMakerInternalMap.java +++ b/guava-31.1-jre/com/google/common/collect/MapMakerInternalMap.java @@ -69,12 +69,9 @@ class MapMakerInternalMap keySet; - @Nullable - transient Collection values; - @Nullable - transient Set> entrySet; + transient @Nullable Set keySet; + transient @Nullable Collection values; + transient @Nullable Set> entrySet; private static final long serialVersionUID = 5L; private MapMakerInternalMap(MapMaker builder, MapMakerInternalMap.InternalEntryHelper entryHelper) { @@ -501,8 +498,7 @@ class MapMakerInternalMap { final K key; final int hash; - @Nullable - final E next; + final @Nullable E next; AbstractStrongKeyEntry(K key, int hash, @Nullable E next) { this.key = key; @@ -530,8 +526,7 @@ class MapMakerInternalMap implements MapMakerInternalMap.InternalEntry { final int hash; - @Nullable - final E next; + final @Nullable E next; AbstractWeakKeyEntry(ReferenceQueue queue, K key, int hash, @Nullable E next) { super(key, queue); @@ -661,14 +656,11 @@ class MapMakerInternalMap implements Iterator { int nextSegmentIndex = MapMakerInternalMap.this.segments.length - 1; int nextTableIndex = -1; - @Nullable - MapMakerInternalMap.Segment currentSegment; - @Nullable - AtomicReferenceArray currentTable; - @Nullable - MapMakerInternalMap.InternalEntry nextEntry; - MapMakerInternalMap.WriteThroughEntry nextExternal; - MapMakerInternalMap.WriteThroughEntry lastReturned; + MapMakerInternalMap.@Nullable Segment currentSegment; + @Nullable AtomicReferenceArray currentTable; + MapMakerInternalMap.@Nullable InternalEntry nextEntry; + MapMakerInternalMap.@Nullable WriteThroughEntry nextExternal; + MapMakerInternalMap.@Nullable WriteThroughEntry lastReturned; HashIterator() { this.advance(); @@ -846,8 +838,7 @@ class MapMakerInternalMap table; + volatile @Nullable AtomicReferenceArray table; final int maxSegmentSize; final AtomicInteger readCount = new AtomicInteger(); @@ -916,7 +907,7 @@ class MapMakerInternalMap entry, @Nullable MapMakerInternalMap.InternalEntry newNext) { + E copyForTesting(MapMakerInternalMap.InternalEntry entry, MapMakerInternalMap.@Nullable InternalEntry newNext) { return this.map.entryHelper.copy(this.self(), this.castForTesting(entry), this.castForTesting(newNext)); } @@ -924,7 +915,7 @@ class MapMakerInternalMap next) { + E newEntryForTesting(K key, int hash, MapMakerInternalMap.@Nullable InternalEntry next) { return this.map.entryHelper.newEntry(this.self(), key, hash, this.castForTesting(next)); } @@ -937,8 +928,7 @@ class MapMakerInternalMap entry) { + @Nullable V getLiveValueForTesting(MapMakerInternalMap.InternalEntry entry) { return this.getLiveValue(this.castForTesting(entry)); } @@ -1475,8 +1465,7 @@ class MapMakerInternalMap extends MapMakerInternalMap.AbstractStrongKeyEntry> implements MapMakerInternalMap.StrongValueEntry> { - StrongKeyDummyValueEntry(K key, int hash, @Nullable MapMakerInternalMap.StrongKeyDummyValueEntry next) { + StrongKeyDummyValueEntry(K key, int hash, MapMakerInternalMap.@Nullable StrongKeyDummyValueEntry next) { super(key, hash, next); } @@ -1616,7 +1605,7 @@ class MapMakerInternalMap copy( MapMakerInternalMap.StrongKeyDummyValueSegment segment, MapMakerInternalMap.StrongKeyDummyValueEntry entry, - @Nullable MapMakerInternalMap.StrongKeyDummyValueEntry newNext + MapMakerInternalMap.@Nullable StrongKeyDummyValueEntry newNext ) { return entry.copy(newNext); } @@ -1627,7 +1616,7 @@ class MapMakerInternalMap newEntry( - MapMakerInternalMap.StrongKeyDummyValueSegment segment, K key, int hash, @Nullable MapMakerInternalMap.StrongKeyDummyValueEntry next + MapMakerInternalMap.StrongKeyDummyValueSegment segment, K key, int hash, MapMakerInternalMap.@Nullable StrongKeyDummyValueEntry next ) { return new MapMakerInternalMap.StrongKeyDummyValueEntry<>(key, hash, next); } @@ -1656,16 +1645,14 @@ class MapMakerInternalMap extends MapMakerInternalMap.AbstractStrongKeyEntry> implements MapMakerInternalMap.StrongValueEntry> { - @Nullable - private volatile V value = (V)null; + private volatile @Nullable V value = (V)null; - StrongKeyStrongValueEntry(K key, int hash, @Nullable MapMakerInternalMap.StrongKeyStrongValueEntry next) { + StrongKeyStrongValueEntry(K key, int hash, MapMakerInternalMap.@Nullable StrongKeyStrongValueEntry next) { super(key, hash, next); } - @Nullable @Override - public V getValue() { + public @Nullable V getValue() { return this.value; } @@ -1708,7 +1695,7 @@ class MapMakerInternalMap copy( MapMakerInternalMap.StrongKeyStrongValueSegment segment, MapMakerInternalMap.StrongKeyStrongValueEntry entry, - @Nullable MapMakerInternalMap.StrongKeyStrongValueEntry newNext + MapMakerInternalMap.@Nullable StrongKeyStrongValueEntry newNext ) { return entry.copy(newNext); } @@ -1718,7 +1705,7 @@ class MapMakerInternalMap newEntry( - MapMakerInternalMap.StrongKeyStrongValueSegment segment, K key, int hash, @Nullable MapMakerInternalMap.StrongKeyStrongValueEntry next + MapMakerInternalMap.StrongKeyStrongValueSegment segment, K key, int hash, MapMakerInternalMap.@Nullable StrongKeyStrongValueEntry next ) { return new MapMakerInternalMap.StrongKeyStrongValueEntry<>(key, hash, next); } @@ -1749,7 +1736,7 @@ class MapMakerInternalMap> { private volatile MapMakerInternalMap.WeakValueReference> valueReference = MapMakerInternalMap.unsetWeakValueReference(); - StrongKeyWeakValueEntry(K key, int hash, @Nullable MapMakerInternalMap.StrongKeyWeakValueEntry next) { + StrongKeyWeakValueEntry(K key, int hash, MapMakerInternalMap.@Nullable StrongKeyWeakValueEntry next) { super(key, hash, next); } @@ -1809,7 +1796,7 @@ class MapMakerInternalMap copy( MapMakerInternalMap.StrongKeyWeakValueSegment segment, MapMakerInternalMap.StrongKeyWeakValueEntry entry, - @Nullable MapMakerInternalMap.StrongKeyWeakValueEntry newNext + MapMakerInternalMap.@Nullable StrongKeyWeakValueEntry newNext ) { return MapMakerInternalMap.Segment.isCollected(entry) ? null : entry.copy(segment.queueForValues, newNext); } @@ -1819,7 +1806,7 @@ class MapMakerInternalMap newEntry( - MapMakerInternalMap.StrongKeyWeakValueSegment segment, K key, int hash, @Nullable MapMakerInternalMap.StrongKeyWeakValueEntry next + MapMakerInternalMap.StrongKeyWeakValueSegment segment, K key, int hash, MapMakerInternalMap.@Nullable StrongKeyWeakValueEntry next ) { return new MapMakerInternalMap.StrongKeyWeakValueEntry<>(key, hash, next); } @@ -1940,7 +1927,7 @@ class MapMakerInternalMap extends MapMakerInternalMap.AbstractWeakKeyEntry> implements MapMakerInternalMap.StrongValueEntry> { - WeakKeyDummyValueEntry(ReferenceQueue queue, K key, int hash, @Nullable MapMakerInternalMap.WeakKeyDummyValueEntry next) { + WeakKeyDummyValueEntry(ReferenceQueue queue, K key, int hash, MapMakerInternalMap.@Nullable WeakKeyDummyValueEntry next) { super(queue, key, hash, next); } @@ -1984,7 +1971,7 @@ class MapMakerInternalMap copy( MapMakerInternalMap.WeakKeyDummyValueSegment segment, MapMakerInternalMap.WeakKeyDummyValueEntry entry, - @Nullable MapMakerInternalMap.WeakKeyDummyValueEntry newNext + MapMakerInternalMap.@Nullable WeakKeyDummyValueEntry newNext ) { return entry.getKey() == null ? null : entry.copy(segment.queueForKeys, newNext); } @@ -1995,7 +1982,7 @@ class MapMakerInternalMap newEntry( - MapMakerInternalMap.WeakKeyDummyValueSegment segment, K key, int hash, @Nullable MapMakerInternalMap.WeakKeyDummyValueEntry next + MapMakerInternalMap.WeakKeyDummyValueSegment segment, K key, int hash, MapMakerInternalMap.@Nullable WeakKeyDummyValueEntry next ) { return new MapMakerInternalMap.WeakKeyDummyValueEntry<>(segment.queueForKeys, key, hash, next); } @@ -2041,16 +2028,14 @@ class MapMakerInternalMap extends MapMakerInternalMap.AbstractWeakKeyEntry> implements MapMakerInternalMap.StrongValueEntry> { - @Nullable - private volatile V value = (V)null; + private volatile @Nullable V value = (V)null; - WeakKeyStrongValueEntry(ReferenceQueue queue, K key, int hash, @Nullable MapMakerInternalMap.WeakKeyStrongValueEntry next) { + WeakKeyStrongValueEntry(ReferenceQueue queue, K key, int hash, MapMakerInternalMap.@Nullable WeakKeyStrongValueEntry next) { super(queue, key, hash, next); } - @Nullable @Override - public V getValue() { + public @Nullable V getValue() { return this.value; } @@ -2095,7 +2080,7 @@ class MapMakerInternalMap copy( MapMakerInternalMap.WeakKeyStrongValueSegment segment, MapMakerInternalMap.WeakKeyStrongValueEntry entry, - @Nullable MapMakerInternalMap.WeakKeyStrongValueEntry newNext + MapMakerInternalMap.@Nullable WeakKeyStrongValueEntry newNext ) { return entry.getKey() == null ? null : entry.copy(segment.queueForKeys, newNext); } @@ -2105,7 +2090,7 @@ class MapMakerInternalMap newEntry( - MapMakerInternalMap.WeakKeyStrongValueSegment segment, K key, int hash, @Nullable MapMakerInternalMap.WeakKeyStrongValueEntry next + MapMakerInternalMap.WeakKeyStrongValueSegment segment, K key, int hash, MapMakerInternalMap.@Nullable WeakKeyStrongValueEntry next ) { return new MapMakerInternalMap.WeakKeyStrongValueEntry<>(segment.queueForKeys, key, hash, next); } @@ -2153,7 +2138,7 @@ class MapMakerInternalMap> { private volatile MapMakerInternalMap.WeakValueReference> valueReference = MapMakerInternalMap.unsetWeakValueReference(); - WeakKeyWeakValueEntry(ReferenceQueue queue, K key, int hash, @Nullable MapMakerInternalMap.WeakKeyWeakValueEntry next) { + WeakKeyWeakValueEntry(ReferenceQueue queue, K key, int hash, MapMakerInternalMap.@Nullable WeakKeyWeakValueEntry next) { super(queue, key, hash, next); } @@ -2217,7 +2202,7 @@ class MapMakerInternalMap copy( MapMakerInternalMap.WeakKeyWeakValueSegment segment, MapMakerInternalMap.WeakKeyWeakValueEntry entry, - @Nullable MapMakerInternalMap.WeakKeyWeakValueEntry newNext + MapMakerInternalMap.@Nullable WeakKeyWeakValueEntry newNext ) { if (entry.getKey() == null) { return null; @@ -2231,7 +2216,7 @@ class MapMakerInternalMap newEntry( - MapMakerInternalMap.WeakKeyWeakValueSegment segment, K key, int hash, @Nullable MapMakerInternalMap.WeakKeyWeakValueEntry next + MapMakerInternalMap.WeakKeyWeakValueSegment segment, K key, int hash, MapMakerInternalMap.@Nullable WeakKeyWeakValueEntry next ) { return new MapMakerInternalMap.WeakKeyWeakValueEntry<>(segment.queueForKeys, key, hash, next); } @@ -2313,8 +2298,7 @@ class MapMakerInternalMap> { - @Nullable - V get(); + @Nullable V get(); E getEntry(); diff --git a/guava-31.1-jre/com/google/common/collect/Maps.java b/guava-31.1-jre/com/google/common/collect/Maps.java index aa42ae0f..ca27f8e7 100644 --- a/guava-31.1-jre/com/google/common/collect/Maps.java +++ b/guava-31.1-jre/com/google/common/collect/Maps.java @@ -1439,7 +1439,7 @@ public final class Maps { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { return Lists.newArrayList(this.iterator()).toArray(); } @@ -1756,7 +1756,7 @@ public final class Maps { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { return Lists.newArrayList(this.iterator()).toArray(); } @@ -2550,7 +2550,7 @@ public final class Maps { } @Override - public V compute(K key, BiFunction remappingFunction) { + public V compute(K key, BiFunction remappingFunction) { throw new UnsupportedOperationException(); } @@ -2746,7 +2746,7 @@ public final class Maps { } @Override - public V compute(K key, BiFunction remappingFunction) { + public V compute(K key, BiFunction remappingFunction) { throw new UnsupportedOperationException(); } diff --git a/guava-31.1-jre/com/google/common/collect/MinMaxPriorityQueue.java b/guava-31.1-jre/com/google/common/collect/MinMaxPriorityQueue.java index f74fce44..039e19ba 100644 --- a/guava-31.1-jre/com/google/common/collect/MinMaxPriorityQueue.java +++ b/guava-31.1-jre/com/google/common/collect/MinMaxPriorityQueue.java @@ -20,6 +20,7 @@ import java.util.NoSuchElementException; import java.util.Objects; import java.util.Queue; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @Beta @@ -29,7 +30,7 @@ public final class MinMaxPriorityQueue extends AbstractQueue { private final MinMaxPriorityQueue.Heap maxHeap; @VisibleForTesting final int maximumSize; - private Object[] queue; + private @Nullable Object[] queue; private int size; private int modCount; private static final int EVEN_POWERS_OF_TWO = 1431655765; diff --git a/guava-31.1-jre/com/google/common/collect/MoreCollectors.java b/guava-31.1-jre/com/google/common/collect/MoreCollectors.java index 861bd531..41ca623c 100644 --- a/guava-31.1-jre/com/google/common/collect/MoreCollectors.java +++ b/guava-31.1-jre/com/google/common/collect/MoreCollectors.java @@ -22,7 +22,7 @@ public final class MoreCollectors { Characteristics.UNORDERED ); private static final Object NULL_PLACEHOLDER = new Object(); - private static final Collector ONLY_ELEMENT = Collector.of( + private static final Collector<@Nullable Object, ?, @Nullable Object> ONLY_ELEMENT = Collector.of( MoreCollectors.ToOptionalState::new, (state, o) -> state.add(o == null ? NULL_PLACEHOLDER : o), MoreCollectors.ToOptionalState::combine, state -> { Object result = state.getElement(); return result == NULL_PLACEHOLDER ? null : result; @@ -42,8 +42,7 @@ public final class MoreCollectors { private static final class ToOptionalState { static final int MAX_EXTRAS = 4; - @Nullable - Object element = null; + @Nullable Object element = null; List extras = Collections.emptyList(); ToOptionalState() { diff --git a/guava-31.1-jre/com/google/common/collect/MultimapBuilder.java b/guava-31.1-jre/com/google/common/collect/MultimapBuilder.java index 67ed243d..62488e3e 100644 --- a/guava-31.1-jre/com/google/common/collect/MultimapBuilder.java +++ b/guava-31.1-jre/com/google/common/collect/MultimapBuilder.java @@ -16,6 +16,7 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -25,11 +26,11 @@ public abstract class MultimapBuilder { private MultimapBuilder() { } - public static MultimapBuilder.MultimapBuilderWithKeys hashKeys() { + public static MultimapBuilder.MultimapBuilderWithKeys<@Nullable Object> hashKeys() { return hashKeys(8); } - public static MultimapBuilder.MultimapBuilderWithKeys hashKeys(final int expectedKeys) { + public static MultimapBuilder.MultimapBuilderWithKeys<@Nullable Object> hashKeys(final int expectedKeys) { CollectPreconditions.checkNonnegative(expectedKeys, "expectedKeys"); return new MultimapBuilder.MultimapBuilderWithKeys() { @Override @@ -39,11 +40,11 @@ public abstract class MultimapBuilder { }; } - public static MultimapBuilder.MultimapBuilderWithKeys linkedHashKeys() { + public static MultimapBuilder.MultimapBuilderWithKeys<@Nullable Object> linkedHashKeys() { return linkedHashKeys(8); } - public static MultimapBuilder.MultimapBuilderWithKeys linkedHashKeys(final int expectedKeys) { + public static MultimapBuilder.MultimapBuilderWithKeys<@Nullable Object> linkedHashKeys(final int expectedKeys) { CollectPreconditions.checkNonnegative(expectedKeys, "expectedKeys"); return new MultimapBuilder.MultimapBuilderWithKeys() { @Override @@ -165,11 +166,11 @@ public abstract class MultimapBuilder { abstract Map> createMap(); - public MultimapBuilder.ListMultimapBuilder arrayListValues() { + public MultimapBuilder.ListMultimapBuilder arrayListValues() { return this.arrayListValues(2); } - public MultimapBuilder.ListMultimapBuilder arrayListValues(final int expectedValuesPerKey) { + public MultimapBuilder.ListMultimapBuilder arrayListValues(final int expectedValuesPerKey) { CollectPreconditions.checkNonnegative(expectedValuesPerKey, "expectedValuesPerKey"); return new MultimapBuilder.ListMultimapBuilder() { @Override @@ -179,7 +180,7 @@ public abstract class MultimapBuilder { }; } - public MultimapBuilder.ListMultimapBuilder linkedListValues() { + public MultimapBuilder.ListMultimapBuilder linkedListValues() { return new MultimapBuilder.ListMultimapBuilder() { @Override public ListMultimap build() { @@ -188,11 +189,11 @@ public abstract class MultimapBuilder { }; } - public MultimapBuilder.SetMultimapBuilder hashSetValues() { + public MultimapBuilder.SetMultimapBuilder hashSetValues() { return this.hashSetValues(2); } - public MultimapBuilder.SetMultimapBuilder hashSetValues(final int expectedValuesPerKey) { + public MultimapBuilder.SetMultimapBuilder hashSetValues(final int expectedValuesPerKey) { CollectPreconditions.checkNonnegative(expectedValuesPerKey, "expectedValuesPerKey"); return new MultimapBuilder.SetMultimapBuilder() { @Override @@ -202,11 +203,11 @@ public abstract class MultimapBuilder { }; } - public MultimapBuilder.SetMultimapBuilder linkedHashSetValues() { + public MultimapBuilder.SetMultimapBuilder linkedHashSetValues() { return this.linkedHashSetValues(2); } - public MultimapBuilder.SetMultimapBuilder linkedHashSetValues(final int expectedValuesPerKey) { + public MultimapBuilder.SetMultimapBuilder linkedHashSetValues(final int expectedValuesPerKey) { CollectPreconditions.checkNonnegative(expectedValuesPerKey, "expectedValuesPerKey"); return new MultimapBuilder.SetMultimapBuilder() { @Override diff --git a/guava-31.1-jre/com/google/common/collect/NaturalOrdering.java b/guava-31.1-jre/com/google/common/collect/NaturalOrdering.java index 993c1485..d952c054 100644 --- a/guava-31.1-jre/com/google/common/collect/NaturalOrdering.java +++ b/guava-31.1-jre/com/google/common/collect/NaturalOrdering.java @@ -4,15 +4,16 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.base.Preconditions; import java.io.Serializable; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true) final class NaturalOrdering extends Ordering> implements Serializable { static final NaturalOrdering INSTANCE = new NaturalOrdering(); @CheckForNull - private transient Ordering> nullsFirst; + private transient Ordering<@Nullable Comparable> nullsFirst; @CheckForNull - private transient Ordering> nullsLast; + private transient Ordering<@Nullable Comparable> nullsLast; private static final long serialVersionUID = 0L; public int compare(Comparable left, Comparable right) { diff --git a/guava-31.1-jre/com/google/common/collect/NullsFirstOrdering.java b/guava-31.1-jre/com/google/common/collect/NullsFirstOrdering.java index 158d0dba..0fc05ceb 100644 --- a/guava-31.1-jre/com/google/common/collect/NullsFirstOrdering.java +++ b/guava-31.1-jre/com/google/common/collect/NullsFirstOrdering.java @@ -3,6 +3,7 @@ package com.google.common.collect; import com.google.common.annotations.GwtCompatible; import java.io.Serializable; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true) @@ -36,7 +37,7 @@ final class NullsFirstOrdering extends Ordering implements Serializable { } @Override - public Ordering nullsLast() { + public Ordering<@Nullable S> nullsLast() { return this.ordering.nullsLast(); } diff --git a/guava-31.1-jre/com/google/common/collect/NullsLastOrdering.java b/guava-31.1-jre/com/google/common/collect/NullsLastOrdering.java index ff68c735..9f173448 100644 --- a/guava-31.1-jre/com/google/common/collect/NullsLastOrdering.java +++ b/guava-31.1-jre/com/google/common/collect/NullsLastOrdering.java @@ -3,6 +3,7 @@ package com.google.common.collect; import com.google.common.annotations.GwtCompatible; import java.io.Serializable; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true) @@ -31,7 +32,7 @@ final class NullsLastOrdering extends Ordering implements Serializable { } @Override - public Ordering nullsFirst() { + public Ordering<@Nullable S> nullsFirst() { return this.ordering.nullsFirst(); } diff --git a/guava-31.1-jre/com/google/common/collect/ObjectArrays.java b/guava-31.1-jre/com/google/common/collect/ObjectArrays.java index 43813187..21d68b97 100644 --- a/guava-31.1-jre/com/google/common/collect/ObjectArrays.java +++ b/guava-31.1-jre/com/google/common/collect/ObjectArrays.java @@ -7,6 +7,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.lang.reflect.Array; import java.util.Arrays; import java.util.Collection; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -70,7 +71,7 @@ public final class ObjectArrays { return dst; } - static Object[] toArrayImpl(Collection c) { + static @Nullable Object[] toArrayImpl(Collection c) { return fillArray(c, new Object[c.size()]); } @@ -86,7 +87,7 @@ public final class ObjectArrays { } @CanIgnoreReturnValue - private static Object[] fillArray(Iterable elements, Object[] array) { + private static @Nullable Object[] fillArray(Iterable elements, @Nullable Object[] array) { int i = 0; for (Object element : elements) { diff --git a/guava-31.1-jre/com/google/common/collect/Ordering.java b/guava-31.1-jre/com/google/common/collect/Ordering.java index 3070c213..e85a7816 100644 --- a/guava-31.1-jre/com/google/common/collect/Ordering.java +++ b/guava-31.1-jre/com/google/common/collect/Ordering.java @@ -16,6 +16,7 @@ import java.util.Map.Entry; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicInteger; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -50,7 +51,7 @@ public abstract class Ordering implements Comparator { } @GwtCompatible(serializable = true) - public static Ordering allEqual() { + public static Ordering<@Nullable Object> allEqual() { return AllEqualOrdering.INSTANCE; } @@ -59,7 +60,7 @@ public abstract class Ordering implements Comparator { return UsingToStringOrdering.INSTANCE; } - public static Ordering arbitrary() { + public static Ordering<@Nullable Object> arbitrary() { return Ordering.ArbitraryOrderingHolder.ARBITRARY_ORDERING; } @@ -72,12 +73,12 @@ public abstract class Ordering implements Comparator { } @GwtCompatible(serializable = true) - public Ordering nullsFirst() { + public Ordering<@Nullable S> nullsFirst() { return new NullsFirstOrdering<>(this); } @GwtCompatible(serializable = true) - public Ordering nullsLast() { + public Ordering<@Nullable S> nullsLast() { return new NullsLastOrdering<>(this); } @@ -325,7 +326,7 @@ public abstract class Ordering implements Comparator { } private static class ArbitraryOrderingHolder { - static final Ordering ARBITRARY_ORDERING = new Ordering.ArbitraryOrdering(); + static final Ordering<@Nullable Object> ARBITRARY_ORDERING = new Ordering.ArbitraryOrdering(); } @VisibleForTesting diff --git a/guava-31.1-jre/com/google/common/collect/RangeMap.java b/guava-31.1-jre/com/google/common/collect/RangeMap.java index edac352a..626ea036 100644 --- a/guava-31.1-jre/com/google/common/collect/RangeMap.java +++ b/guava-31.1-jre/com/google/common/collect/RangeMap.java @@ -7,6 +7,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.function.BiFunction; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @DoNotMock("Use ImmutableRangeMap or TreeRangeMap") @ElementTypesAreNonnullByDefault @@ -31,7 +32,7 @@ public interface RangeMap { void remove(Range var1); - void merge(Range var1, @CheckForNull V var2, BiFunction var3); + void merge(Range var1, @CheckForNull V var2, BiFunction var3); Map, V> asMapOfRanges(); diff --git a/guava-31.1-jre/com/google/common/collect/RegularImmutableAsList.java b/guava-31.1-jre/com/google/common/collect/RegularImmutableAsList.java index bd6d446b..759bf1d2 100644 --- a/guava-31.1-jre/com/google/common/collect/RegularImmutableAsList.java +++ b/guava-31.1-jre/com/google/common/collect/RegularImmutableAsList.java @@ -4,6 +4,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import java.util.function.Consumer; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -42,7 +43,7 @@ class RegularImmutableAsList extends ImmutableAsList { @GwtIncompatible @Override - int copyIntoArray(Object[] dst, int offset) { + int copyIntoArray(@Nullable Object[] dst, int offset) { return this.delegateList.copyIntoArray(dst, offset); } diff --git a/guava-31.1-jre/com/google/common/collect/RegularImmutableBiMap.java b/guava-31.1-jre/com/google/common/collect/RegularImmutableBiMap.java index a52f0717..e183814f 100644 --- a/guava-31.1-jre/com/google/common/collect/RegularImmutableBiMap.java +++ b/guava-31.1-jre/com/google/common/collect/RegularImmutableBiMap.java @@ -11,6 +11,7 @@ import java.util.Map.Entry; import java.util.function.BiConsumer; import java.util.function.Consumer; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true, emulated = true) @@ -20,9 +21,9 @@ class RegularImmutableBiMap extends ImmutableBiMap { ); static final double MAX_LOAD_FACTOR = 1.2; @CheckForNull - private final transient ImmutableMapEntry[] keyTable; + private final transient @Nullable ImmutableMapEntry[] keyTable; @CheckForNull - private final transient ImmutableMapEntry[] valueTable; + private final transient @Nullable ImmutableMapEntry[] valueTable; @VisibleForTesting final transient Entry[] entries; private final transient int mask; @@ -77,7 +78,11 @@ class RegularImmutableBiMap extends ImmutableBiMap { } private RegularImmutableBiMap( - @CheckForNull ImmutableMapEntry[] keyTable, @CheckForNull ImmutableMapEntry[] valueTable, Entry[] entries, int mask, int hashCode + @CheckForNull @Nullable ImmutableMapEntry[] keyTable, + @CheckForNull @Nullable ImmutableMapEntry[] valueTable, + Entry[] entries, + int mask, + int hashCode ) { this.keyTable = keyTable; this.valueTable = valueTable; diff --git a/guava-31.1-jre/com/google/common/collect/RegularImmutableList.java b/guava-31.1-jre/com/google/common/collect/RegularImmutableList.java index da3b3a32..d3d0423e 100644 --- a/guava-31.1-jre/com/google/common/collect/RegularImmutableList.java +++ b/guava-31.1-jre/com/google/common/collect/RegularImmutableList.java @@ -4,6 +4,7 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.VisibleForTesting; import java.util.Spliterator; import java.util.Spliterators; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true, emulated = true) @@ -42,7 +43,7 @@ class RegularImmutableList extends ImmutableList { } @Override - int copyIntoArray(Object[] dst, int dstOff) { + int copyIntoArray(@Nullable Object[] dst, int dstOff) { System.arraycopy(this.array, 0, dst, dstOff, this.array.length); return dstOff + this.array.length; } diff --git a/guava-31.1-jre/com/google/common/collect/RegularImmutableMap.java b/guava-31.1-jre/com/google/common/collect/RegularImmutableMap.java index 6df2a913..279e6c44 100644 --- a/guava-31.1-jre/com/google/common/collect/RegularImmutableMap.java +++ b/guava-31.1-jre/com/google/common/collect/RegularImmutableMap.java @@ -26,7 +26,7 @@ final class RegularImmutableMap extends ImmutableMap { @VisibleForTesting final transient Entry[] entries; @CheckForNull - private final transient ImmutableMapEntry[] table; + private final transient @Nullable ImmutableMapEntry[] table; private final transient int mask; private static final long serialVersionUID = 0L; @@ -34,7 +34,7 @@ final class RegularImmutableMap extends ImmutableMap { return fromEntryArray(entries.length, entries, true); } - static ImmutableMap fromEntryArray(int n, Entry[] entryArray, boolean throwIfDuplicateKeys) { + static ImmutableMap fromEntryArray(int n, @Nullable Entry[] entryArray, boolean throwIfDuplicateKeys) { Preconditions.checkPositionIndex(n, entryArray.length); if (n == 0) { return (ImmutableMap)EMPTY; @@ -124,15 +124,14 @@ final class RegularImmutableMap extends ImmutableMap { return makeImmutable(entry, entry.getKey(), entry.getValue()); } - private RegularImmutableMap(Entry[] entries, @CheckForNull ImmutableMapEntry[] table, int mask) { + private RegularImmutableMap(Entry[] entries, @CheckForNull @Nullable ImmutableMapEntry[] table, int mask) { this.entries = entries; this.table = table; this.mask = mask; } @CanIgnoreReturnValue - @Nullable - static ImmutableMapEntry checkNoConflictInKeyBucket( + static @Nullable ImmutableMapEntry checkNoConflictInKeyBucket( Object key, Object newValue, @CheckForNull ImmutableMapEntry keyBucketHead, boolean throwIfDuplicateKeys ) throws RegularImmutableMap.BucketOverflowException { int bucketSize = 0; @@ -170,7 +169,7 @@ final class RegularImmutableMap extends ImmutableMap { } @CheckForNull - static V get(@CheckForNull Object key, @CheckForNull ImmutableMapEntry[] keyTable, int mask) { + static V get(@CheckForNull Object key, @CheckForNull @Nullable ImmutableMapEntry[] keyTable, int mask) { if (key != null && keyTable != null) { int index = Hashing.smear(key.hashCode()) & mask; diff --git a/guava-31.1-jre/com/google/common/collect/RegularImmutableMultiset.java b/guava-31.1-jre/com/google/common/collect/RegularImmutableMultiset.java index b750cb52..fae53b43 100644 --- a/guava-31.1-jre/com/google/common/collect/RegularImmutableMultiset.java +++ b/guava-31.1-jre/com/google/common/collect/RegularImmutableMultiset.java @@ -9,6 +9,7 @@ import com.google.errorprone.annotations.concurrent.LazyInit; import java.util.Arrays; import java.util.Collection; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true, serializable = true) @@ -22,7 +23,7 @@ class RegularImmutableMultiset extends ImmutableMultiset { @VisibleForTesting static final int MAX_HASH_BUCKET_LENGTH = 9; private final transient Multisets.ImmutableEntry[] entries; - private final transient Multisets.ImmutableEntry[] hashTable; + private final transient Multisets.@Nullable ImmutableEntry[] hashTable; private final transient int size; private final transient int hashCode; @LazyInit @@ -69,7 +70,7 @@ class RegularImmutableMultiset extends ImmutableMultiset { : new RegularImmutableMultiset<>(entryArray, hashTable, Ints.saturatedCast(size), hashCode, null)); } - private static boolean hashFloodingDetected(Multisets.ImmutableEntry[] hashTable) { + private static boolean hashFloodingDetected(Multisets.@Nullable ImmutableEntry[] hashTable) { for (int i = 0; i < hashTable.length; i++) { int bucketLength = 0; @@ -84,7 +85,11 @@ class RegularImmutableMultiset extends ImmutableMultiset { } private RegularImmutableMultiset( - Multisets.ImmutableEntry[] entries, Multisets.ImmutableEntry[] hashTable, int size, int hashCode, @CheckForNull ImmutableSet elementSet + Multisets.ImmutableEntry[] entries, + Multisets.@Nullable ImmutableEntry[] hashTable, + int size, + int hashCode, + @CheckForNull ImmutableSet elementSet ) { this.entries = entries; this.hashTable = hashTable; diff --git a/guava-31.1-jre/com/google/common/collect/RegularImmutableSet.java b/guava-31.1-jre/com/google/common/collect/RegularImmutableSet.java index e5eee390..f9af8736 100644 --- a/guava-31.1-jre/com/google/common/collect/RegularImmutableSet.java +++ b/guava-31.1-jre/com/google/common/collect/RegularImmutableSet.java @@ -5,6 +5,7 @@ import com.google.common.annotations.VisibleForTesting; import java.util.Spliterator; import java.util.Spliterators; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true, emulated = true) @@ -14,10 +15,10 @@ final class RegularImmutableSet extends ImmutableSet.CachingAsList { private final transient Object[] elements; private final transient int hashCode; @VisibleForTesting - final transient Object[] table; + final transient @Nullable Object[] table; private final transient int mask; - RegularImmutableSet(Object[] elements, int hashCode, Object[] table, int mask) { + RegularImmutableSet(Object[] elements, int hashCode, @Nullable Object[] table, int mask) { this.elements = elements; this.hashCode = hashCode; this.table = table; @@ -79,7 +80,7 @@ final class RegularImmutableSet extends ImmutableSet.CachingAsList { } @Override - int copyIntoArray(Object[] dst, int offset) { + int copyIntoArray(@Nullable Object[] dst, int offset) { System.arraycopy(this.elements, 0, dst, offset, this.elements.length); return offset + this.elements.length; } diff --git a/guava-31.1-jre/com/google/common/collect/RegularImmutableSortedSet.java b/guava-31.1-jre/com/google/common/collect/RegularImmutableSortedSet.java index bcc87aea..4ae8e45b 100644 --- a/guava-31.1-jre/com/google/common/collect/RegularImmutableSortedSet.java +++ b/guava-31.1-jre/com/google/common/collect/RegularImmutableSortedSet.java @@ -12,6 +12,7 @@ import java.util.Set; import java.util.Spliterator; import java.util.function.Consumer; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true, emulated = true) @@ -128,7 +129,7 @@ final class RegularImmutableSortedSet extends ImmutableSortedSet { } @Override - int copyIntoArray(Object[] dst, int offset) { + int copyIntoArray(@Nullable Object[] dst, int offset) { return this.elements.copyIntoArray(dst, offset); } diff --git a/guava-31.1-jre/com/google/common/collect/Sets.java b/guava-31.1-jre/com/google/common/collect/Sets.java index a7b73b3e..3ce6361f 100644 --- a/guava-31.1-jre/com/google/common/collect/Sets.java +++ b/guava-31.1-jre/com/google/common/collect/Sets.java @@ -32,6 +32,7 @@ import java.util.function.Consumer; import java.util.stream.Collector; import java.util.stream.Stream; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -881,7 +882,7 @@ public final class Sets { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { return this.standardToArray(); } diff --git a/guava-31.1-jre/com/google/common/collect/SingletonImmutableSet.java b/guava-31.1-jre/com/google/common/collect/SingletonImmutableSet.java index 0848ffa8..f721ff9d 100644 --- a/guava-31.1-jre/com/google/common/collect/SingletonImmutableSet.java +++ b/guava-31.1-jre/com/google/common/collect/SingletonImmutableSet.java @@ -3,6 +3,7 @@ package com.google.common.collect; import com.google.common.annotations.GwtCompatible; import com.google.common.base.Preconditions; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(serializable = true, emulated = true) @@ -39,7 +40,7 @@ final class SingletonImmutableSet extends ImmutableSet { } @Override - int copyIntoArray(Object[] dst, int offset) { + int copyIntoArray(@Nullable Object[] dst, int offset) { dst[offset] = this.element; return offset + 1; } diff --git a/guava-31.1-jre/com/google/common/collect/Synchronized.java b/guava-31.1-jre/com/google/common/collect/Synchronized.java index 1853f312..b9c471a2 100644 --- a/guava-31.1-jre/com/google/common/collect/Synchronized.java +++ b/guava-31.1-jre/com/google/common/collect/Synchronized.java @@ -32,6 +32,7 @@ import java.util.function.Predicate; import java.util.function.UnaryOperator; import java.util.stream.Stream; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -477,7 +478,7 @@ final class Synchronized { } @Override - public Object[] toArray() { + public @Nullable Object[] toArray() { synchronized (this.mutex) { return this.delegate().toArray(); } @@ -953,7 +954,7 @@ final class Synchronized { } @Override - public V compute(K key, BiFunction remappingFunction) { + public V compute(K key, BiFunction remappingFunction) { synchronized (this.mutex) { return this.delegate().compute(key, remappingFunction); } diff --git a/guava-31.1-jre/com/google/common/collect/TopKSelector.java b/guava-31.1-jre/com/google/common/collect/TopKSelector.java index a3291251..866f2dc6 100644 --- a/guava-31.1-jre/com/google/common/collect/TopKSelector.java +++ b/guava-31.1-jre/com/google/common/collect/TopKSelector.java @@ -10,13 +10,14 @@ import java.util.Comparator; import java.util.Iterator; import java.util.List; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible final class TopKSelector { private final int k; private final Comparator comparator; - private final T[] buffer; + private final @Nullable T[][] buffer; private int bufferSize; @CheckForNull private T threshold; diff --git a/guava-31.1-jre/com/google/common/collect/TreeRangeMap.java b/guava-31.1-jre/com/google/common/collect/TreeRangeMap.java index 44389a17..f03a0c06 100644 --- a/guava-31.1-jre/com/google/common/collect/TreeRangeMap.java +++ b/guava-31.1-jre/com/google/common/collect/TreeRangeMap.java @@ -19,6 +19,7 @@ import java.util.Set; import java.util.Map.Entry; import java.util.function.BiFunction; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @Beta @@ -78,7 +79,11 @@ public final class TreeRangeMap implements RangeMap> range, @CheckForNull Object value, BiFunction remappingFunction) { + public void merge( + Range> range, + @CheckForNull Object value, + BiFunction remappingFunction + ) { Preconditions.checkNotNull(range); String var4 = String.valueOf(range); throw new IllegalArgumentException( @@ -222,7 +227,7 @@ public final class TreeRangeMap implements RangeMap range, @CheckForNull V value, BiFunction remappingFunction) { + public void merge(Range range, @CheckForNull V value, BiFunction remappingFunction) { Preconditions.checkNotNull(range); Preconditions.checkNotNull(remappingFunction); if (!range.isEmpty()) { @@ -470,7 +475,7 @@ public final class TreeRangeMap implements RangeMap range, @CheckForNull V value, BiFunction remappingFunction) { + public void merge(Range range, @CheckForNull V value, BiFunction remappingFunction) { Preconditions.checkArgument(this.subRange.encloses(range), "Cannot merge range %s into a subRangeMap(%s)", range, this.subRange); TreeRangeMap.this.merge(range, value, remappingFunction); } diff --git a/guava-31.1-jre/com/google/common/escape/CharEscaperBuilder.java b/guava-31.1-jre/com/google/common/escape/CharEscaperBuilder.java index f94f5777..e0d26cac 100644 --- a/guava-31.1-jre/com/google/common/escape/CharEscaperBuilder.java +++ b/guava-31.1-jre/com/google/common/escape/CharEscaperBuilder.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible @@ -39,7 +40,7 @@ public final class CharEscaperBuilder { return this; } - public char[][] toArray() { + public char[][][] @Nullable [] toArray() { char[][] result = new char[this.max + 1][]; for (Entry entry : this.map.entrySet()) { @@ -54,10 +55,10 @@ public final class CharEscaperBuilder { } private static class CharArrayDecorator extends CharEscaper { - private final char[][] replacements; + private final char[][][] @Nullable [] replacements; private final int replaceLength; - CharArrayDecorator(char[][] replacements) { + CharArrayDecorator(char[][][] @Nullable [] replacements) { this.replacements = replacements; this.replaceLength = replacements.length; } diff --git a/guava-31.1-jre/com/google/common/graph/EndpointPairIterator.java b/guava-31.1-jre/com/google/common/graph/EndpointPairIterator.java index 7725c01d..003fd211 100644 --- a/guava-31.1-jre/com/google/common/graph/EndpointPairIterator.java +++ b/guava-31.1-jre/com/google/common/graph/EndpointPairIterator.java @@ -8,6 +8,7 @@ import java.util.Iterator; import java.util.Objects; import java.util.Set; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault abstract class EndpointPairIterator extends AbstractIterator> { @@ -56,7 +57,7 @@ abstract class EndpointPairIterator extends AbstractIterator> private static final class Undirected extends EndpointPairIterator { @CheckForNull - private Set visitedNodes; + private Set<@Nullable N> visitedNodes; private Undirected(BaseGraph graph) { super(graph); diff --git a/guava-31.1-jre/com/google/common/hash/Striped64.java b/guava-31.1-jre/com/google/common/hash/Striped64.java index 1683fc05..3fb220a0 100644 --- a/guava-31.1-jre/com/google/common/hash/Striped64.java +++ b/guava-31.1-jre/com/google/common/hash/Striped64.java @@ -7,12 +7,13 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.Random; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; import sun.misc.Unsafe; @ElementTypesAreNonnullByDefault @GwtIncompatible abstract class Striped64 extends Number { - static final ThreadLocal threadHashCode = new ThreadLocal<>(); + static final ThreadLocal threadHashCode = new ThreadLocal<>(); static final Random rng = new Random(); static final int NCPU = Runtime.getRuntime().availableProcessors(); @CheckForNull diff --git a/guava-31.1-jre/com/google/common/reflect/AbstractInvocationHandler.java b/guava-31.1-jre/com/google/common/reflect/AbstractInvocationHandler.java index 62345f04..08ab3141 100644 --- a/guava-31.1-jre/com/google/common/reflect/AbstractInvocationHandler.java +++ b/guava-31.1-jre/com/google/common/reflect/AbstractInvocationHandler.java @@ -5,6 +5,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.Arrays; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault public abstract class AbstractInvocationHandler implements InvocationHandler { @@ -12,7 +13,7 @@ public abstract class AbstractInvocationHandler implements InvocationHandler { @CheckForNull @Override - public final Object invoke(Object proxy, Method method, @CheckForNull Object[] args) throws Throwable { + public final Object invoke(Object proxy, Method method, @CheckForNull @Nullable Object[] args) throws Throwable { if (args == null) { args = NO_ARGS; } @@ -34,7 +35,7 @@ public abstract class AbstractInvocationHandler implements InvocationHandler { } @CheckForNull - protected abstract Object handleInvocation(Object var1, Method var2, Object[] var3) throws Throwable; + protected abstract Object handleInvocation(Object var1, Method var2, @Nullable Object[] var3) throws Throwable; @Override public boolean equals(@CheckForNull Object obj) { diff --git a/guava-31.1-jre/com/google/common/reflect/Invokable.java b/guava-31.1-jre/com/google/common/reflect/Invokable.java index c53ad354..df8bc6ff 100644 --- a/guava-31.1-jre/com/google/common/reflect/Invokable.java +++ b/guava-31.1-jre/com/google/common/reflect/Invokable.java @@ -17,6 +17,7 @@ import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; import java.util.Arrays; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @Beta @@ -163,7 +164,7 @@ public abstract class Invokable implements AnnotatedElement, Member { @CheckForNull @CanIgnoreReturnValue - public final R invoke(@CheckForNull T receiver, Object... args) throws InvocationTargetException, IllegalAccessException { + public final R invoke(@CheckForNull T receiver, @Nullable Object... args) throws InvocationTargetException, IllegalAccessException { return (R)this.invokeInternal(receiver, Preconditions.checkNotNull(args)); } @@ -226,7 +227,7 @@ public abstract class Invokable implements AnnotatedElement, Member { } @CheckForNull - abstract Object invokeInternal(@CheckForNull Object var1, Object[] var2) throws InvocationTargetException, IllegalAccessException; + abstract Object invokeInternal(@CheckForNull Object var1, @Nullable Object[] var2) throws InvocationTargetException, IllegalAccessException; abstract Type[] getGenericParameterTypes(); @@ -249,7 +250,7 @@ public abstract class Invokable implements AnnotatedElement, Member { } @Override - final Object invokeInternal(@CheckForNull Object receiver, Object[] args) throws InvocationTargetException, IllegalAccessException { + final Object invokeInternal(@CheckForNull Object receiver, @Nullable Object[] args) throws InvocationTargetException, IllegalAccessException { try { return this.constructor.newInstance(args); } catch (InstantiationException var5) { @@ -341,7 +342,7 @@ public abstract class Invokable implements AnnotatedElement, Member { @CheckForNull @Override - final Object invokeInternal(@CheckForNull Object receiver, Object[] args) throws InvocationTargetException, IllegalAccessException { + final Object invokeInternal(@CheckForNull Object receiver, @Nullable Object[] args) throws InvocationTargetException, IllegalAccessException { return this.method.invoke(receiver, args); } diff --git a/guava-31.1-jre/com/google/common/reflect/TypeVisitor.java b/guava-31.1-jre/com/google/common/reflect/TypeVisitor.java index a6c8c28b..e652ad01 100644 --- a/guava-31.1-jre/com/google/common/reflect/TypeVisitor.java +++ b/guava-31.1-jre/com/google/common/reflect/TypeVisitor.java @@ -7,12 +7,13 @@ import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; import java.lang.reflect.WildcardType; import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault abstract class TypeVisitor { private final Set visited = Sets.newHashSet(); - public final void visit(Type... types) { + public final void visit(@Nullable Type... types) { for (Type type : types) { if (type != null && this.visited.add(type)) { boolean succeeded = false; diff --git a/guava-31.1-jre/com/google/common/reflect/Types.java b/guava-31.1-jre/com/google/common/reflect/Types.java index bac3f33f..50519f40 100644 --- a/guava-31.1-jre/com/google/common/reflect/Types.java +++ b/guava-31.1-jre/com/google/common/reflect/Types.java @@ -27,6 +27,7 @@ import java.util.Objects; import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicReference; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault final class Types { @@ -489,7 +490,7 @@ final class Types { @CheckForNull @Override - public Object invoke(Object proxy, Method method, @CheckForNull Object[] args) throws Throwable { + public Object invoke(Object proxy, Method method, @CheckForNull @Nullable Object[] args) throws Throwable { String methodName = method.getName(); Method typeVariableMethod = typeVariableMethods.get(methodName); if (typeVariableMethod == null) { diff --git a/guava-31.1-jre/com/google/common/util/concurrent/AbstractScheduledService.java b/guava-31.1-jre/com/google/common/util/concurrent/AbstractScheduledService.java index 389424a6..cb3b6d7f 100644 --- a/guava-31.1-jre/com/google/common/util/concurrent/AbstractScheduledService.java +++ b/guava-31.1-jre/com/google/common/util/concurrent/AbstractScheduledService.java @@ -20,6 +20,7 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtIncompatible @@ -217,7 +218,7 @@ public abstract class AbstractScheduledService implements Service { return this.cancellationDelegate; } - private ScheduledFuture submitToExecutor(AbstractScheduledService.CustomScheduler.Schedule schedule) { + private ScheduledFuture<@Nullable Void> submitToExecutor(AbstractScheduledService.CustomScheduler.Schedule schedule) { return this.executor.schedule(this, schedule.delay, schedule.unit); } } @@ -239,9 +240,9 @@ public abstract class AbstractScheduledService implements Service { private static final class SupplantableFuture implements AbstractScheduledService.Cancellable { private final ReentrantLock lock; @GuardedBy("lock") - private Future currentFuture; + private Future<@Nullable Void> currentFuture; - SupplantableFuture(ReentrantLock lock, Future currentFuture) { + SupplantableFuture(ReentrantLock lock, Future<@Nullable Void> currentFuture) { this.lock = lock; this.currentFuture = currentFuture; } diff --git a/guava-31.1-jre/com/google/common/util/concurrent/Atomics.java b/guava-31.1-jre/com/google/common/util/concurrent/Atomics.java index 06759df7..41b22662 100644 --- a/guava-31.1-jre/com/google/common/util/concurrent/Atomics.java +++ b/guava-31.1-jre/com/google/common/util/concurrent/Atomics.java @@ -3,6 +3,7 @@ package com.google.common.util.concurrent; import com.google.common.annotations.GwtIncompatible; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReferenceArray; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtIncompatible @@ -10,7 +11,7 @@ public final class Atomics { private Atomics() { } - public static AtomicReference newReference() { + public static AtomicReference<@Nullable V> newReference() { return new AtomicReference<>(); } @@ -18,7 +19,7 @@ public final class Atomics { return new AtomicReference<>(initialValue); } - public static AtomicReferenceArray newReferenceArray(int length) { + public static AtomicReferenceArray<@Nullable E> newReferenceArray(int length) { return new AtomicReferenceArray<>(length); } diff --git a/guava-31.1-jre/com/google/common/util/concurrent/ClosingFuture.java b/guava-31.1-jre/com/google/common/util/concurrent/ClosingFuture.java index 6525eb09..c6652838 100644 --- a/guava-31.1-jre/com/google/common/util/concurrent/ClosingFuture.java +++ b/guava-31.1-jre/com/google/common/util/concurrent/ClosingFuture.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @DoNotMock("Use ClosingFuture.from(Futures.immediate*Future)") @ElementTypesAreNonnullByDefault @@ -550,7 +551,7 @@ public final class ClosingFuture { return derived; } - private Futures.FutureCombiner futureCombiner() { + private Futures.FutureCombiner<@Nullable Object> futureCombiner() { return this.allMustSucceed ? Futures.whenAllSucceed(this.inputFutures()) : Futures.whenAllComplete(this.inputFutures()); } diff --git a/guava-31.1-jre/com/google/common/util/concurrent/CollectionFuture.java b/guava-31.1-jre/com/google/common/util/concurrent/CollectionFuture.java index 6038d36e..5162ec29 100644 --- a/guava-31.1-jre/com/google/common/util/concurrent/CollectionFuture.java +++ b/guava-31.1-jre/com/google/common/util/concurrent/CollectionFuture.java @@ -6,12 +6,13 @@ import com.google.common.collect.Lists; import java.util.Collections; import java.util.List; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) abstract class CollectionFuture extends AggregateFuture { @CheckForNull - private List> values; + private List> values; CollectionFuture(ImmutableCollection> futures, boolean allMustSucceed) { super(futures, allMustSucceed, true); @@ -48,7 +49,7 @@ abstract class CollectionFuture extends AggregateFuture { this.values = null; } - abstract C combine(List> var1); + abstract C combine(List> var1); static final class ListFuture extends CollectionFuture> { ListFuture(ImmutableCollection> futures, boolean allMustSucceed) { diff --git a/guava-31.1-jre/com/google/common/util/concurrent/ExecutionSequencer.java b/guava-31.1-jre/com/google/common/util/concurrent/ExecutionSequencer.java index f13fe198..c4e5188f 100644 --- a/guava-31.1-jre/com/google/common/util/concurrent/ExecutionSequencer.java +++ b/guava-31.1-jre/com/google/common/util/concurrent/ExecutionSequencer.java @@ -6,10 +6,11 @@ import java.util.concurrent.Callable; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicReference; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault public final class ExecutionSequencer { - private final AtomicReference> ref = new AtomicReference<>(Futures.immediateVoidFuture()); + private final AtomicReference> ref = new AtomicReference<>(Futures.immediateVoidFuture()); private ExecutionSequencer.ThreadConfinedTaskQueue latestTaskQueue = new ExecutionSequencer.ThreadConfinedTaskQueue(); private ExecutionSequencer() { diff --git a/guava-31.1-jre/com/google/common/util/concurrent/Futures.java b/guava-31.1-jre/com/google/common/util/concurrent/Futures.java index 3db27810..24eeac66 100644 --- a/guava-31.1-jre/com/google/common/util/concurrent/Futures.java +++ b/guava-31.1-jre/com/google/common/util/concurrent/Futures.java @@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; import javax.annotation.CheckForNull; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @GwtCompatible(emulated = true) @@ -210,12 +211,12 @@ public final class Futures extends GwtFuturesCatchingSpecialization { @SafeVarargs @Beta - public static ListenableFuture> successfulAsList(ListenableFuture... futures) { + public static ListenableFuture> successfulAsList(ListenableFuture... futures) { return new CollectionFuture.ListFuture<>(ImmutableList.copyOf(futures), false); } @Beta - public static ListenableFuture> successfulAsList(Iterable> futures) { + public static ListenableFuture> successfulAsList(Iterable> futures) { return new CollectionFuture.ListFuture<>(ImmutableList.copyOf(futures), false); } @@ -423,7 +424,7 @@ public final class Futures extends GwtFuturesCatchingSpecialization { private boolean wasCancelled = false; private boolean shouldInterrupt = true; private final AtomicInteger incompleteOutputCount; - private final ListenableFuture[] inputFutures; + private final @Nullable ListenableFuture[] inputFutures; private volatile int delegateIndex = 0; private InCompletionOrderState(ListenableFuture[] inputFutures) { diff --git a/guava-31.1-jre/com/google/common/util/concurrent/ImmediateFuture.java b/guava-31.1-jre/com/google/common/util/concurrent/ImmediateFuture.java index 72ea6a18..98046ab2 100644 --- a/guava-31.1-jre/com/google/common/util/concurrent/ImmediateFuture.java +++ b/guava-31.1-jre/com/google/common/util/concurrent/ImmediateFuture.java @@ -87,8 +87,7 @@ class ImmediateFuture implements ListenableFuture { } static final class ImmediateCancelledFuture extends AbstractFuture.TrustedFuture { - @Nullable - static final ImmediateFuture.ImmediateCancelledFuture INSTANCE = AbstractFuture.GENERATE_CANCELLATION_CAUSES + static final ImmediateFuture.@Nullable ImmediateCancelledFuture INSTANCE = AbstractFuture.GENERATE_CANCELLATION_CAUSES ? null : new ImmediateFuture.ImmediateCancelledFuture<>(); diff --git a/guava-31.1-jre/com/google/common/util/concurrent/Striped.java b/guava-31.1-jre/com/google/common/util/concurrent/Striped.java index 2841a558..669a8959 100644 --- a/guava-31.1-jre/com/google/common/util/concurrent/Striped.java +++ b/guava-31.1-jre/com/google/common/util/concurrent/Striped.java @@ -25,6 +25,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import org.checkerframework.checker.nullness.qual.Nullable; @ElementTypesAreNonnullByDefault @Beta @@ -214,7 +215,7 @@ public abstract class Striped { @VisibleForTesting static class SmallLazyStriped extends Striped.PowerOfTwoStriped { - final AtomicReferenceArray> locks; + final AtomicReferenceArray> locks; final Supplier supplier; final int size; final ReferenceQueue queue = new ReferenceQueue<>(); diff --git a/jaxb-runtime-4.0.2/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java b/jaxb-runtime-4.0.2/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java index bf63a993..f348c131 100644 --- a/jaxb-runtime-4.0.2/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java +++ b/jaxb-runtime-4.0.2/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java @@ -1226,7 +1226,7 @@ public final class XmlSchemaGenerator { // at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833) // at org.jetbrains.java.decompiler.modules.decompiler.stats.IfStatement.toJava(IfStatement.java:251) // at org.jetbrains.java.decompiler.modules.decompiler.stats.RootStatement.toJava(RootStatement.java:36) - // at org.jetbrains.java.decompiler.main.ClassWriter.writeMethod(ClassWriter.java:1282) + // at org.jetbrains.java.decompiler.main.ClassWriter.writeMethod(ClassWriter.java:1293) // // Bytecode: // 00: aload 0 diff --git a/kotlin-stdlib-1.8.21/kotlin/collections/ArraysKt___ArraysKt.kt b/kotlin-stdlib-1.8.21/kotlin/collections/ArraysKt___ArraysKt.kt index 91cdc6c7..f766b110 100644 --- a/kotlin-stdlib-1.8.21/kotlin/collections/ArraysKt___ArraysKt.kt +++ b/kotlin-stdlib-1.8.21/kotlin/collections/ArraysKt___ArraysKt.kt @@ -6022,7 +6022,7 @@ internal class ArraysKt___ArraysKt : ArraysKt___ArraysJvmKt { @Override public final int compare(T a, T b) { val var3: Function1 = this.$selector - return ComparisonsKt.compareValues(this.$selector.invoke((T)a) as java.lang.Comparable<*>, var3.invoke(b) as java.lang.Comparable<*>) + return ComparisonsKt.compareValues(this.$selector.invoke((T)a), var3.invoke(b) as java.lang.Comparable<*>) } }) } @@ -6039,7 +6039,7 @@ internal class ArraysKt___ArraysKt : ArraysKt___ArraysJvmKt { @Override public final int compare(T a, T b) { val var3: Function1 = this.$selector - return ComparisonsKt.compareValues(this.$selector.invoke((T)b) as java.lang.Comparable<*>, var3.invoke(a) as java.lang.Comparable<*>) + return ComparisonsKt.compareValues(this.$selector.invoke((T)b), var3.invoke(a) as java.lang.Comparable<*>) } }) } diff --git a/kotlin-stdlib-1.8.21/kotlin/collections/CollectionsKt___CollectionsKt.kt b/kotlin-stdlib-1.8.21/kotlin/collections/CollectionsKt___CollectionsKt.kt index 98227a7f..5e30fa5d 100644 --- a/kotlin-stdlib-1.8.21/kotlin/collections/CollectionsKt___CollectionsKt.kt +++ b/kotlin-stdlib-1.8.21/kotlin/collections/CollectionsKt___CollectionsKt.kt @@ -1032,7 +1032,7 @@ internal class CollectionsKt___CollectionsKt : CollectionsKt___CollectionsJvmKt @Override public final int compare(T a, T b) { val var3: Function1 = this.$selector - return ComparisonsKt.compareValues(this.$selector.invoke((T)a), var3.invoke(b) as java.lang.Comparable<*>) + return ComparisonsKt.compareValues(this.$selector.invoke((T)a) as java.lang.Comparable<*>, var3.invoke(b) as java.lang.Comparable<*>) } }) } @@ -1049,7 +1049,7 @@ internal class CollectionsKt___CollectionsKt : CollectionsKt___CollectionsJvmKt @Override public final int compare(T a, T b) { val var3: Function1 = this.$selector - return ComparisonsKt.compareValues(this.$selector.invoke((T)b), var3.invoke(a) as java.lang.Comparable<*>) + return ComparisonsKt.compareValues(this.$selector.invoke((T)b) as java.lang.Comparable<*>, var3.invoke(a) as java.lang.Comparable<*>) } }) } diff --git a/spring-core-6.0.8/org/springframework/aot/nativex/BasicJsonWriter.java b/spring-core-6.0.8/org/springframework/aot/nativex/BasicJsonWriter.java index 0c8b96fc..fb4473a6 100644 --- a/spring-core-6.0.8/org/springframework/aot/nativex/BasicJsonWriter.java +++ b/spring-core-6.0.8/org/springframework/aot/nativex/BasicJsonWriter.java @@ -112,7 +112,7 @@ class BasicJsonWriter { // at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833) // at org.jetbrains.java.decompiler.modules.decompiler.stats.SequenceStatement.toJava(SequenceStatement.java:107) // at org.jetbrains.java.decompiler.modules.decompiler.stats.RootStatement.toJava(RootStatement.java:36) - // at org.jetbrains.java.decompiler.main.ClassWriter.methodLambdaToJava(ClassWriter.java:992) + // at org.jetbrains.java.decompiler.main.ClassWriter.methodLambdaToJava(ClassWriter.java:998) // // Bytecode: // 00: aload 0 diff --git a/spring-jdbc-6.0.8/org/springframework/jdbc/core/JdbcTemplate.java b/spring-jdbc-6.0.8/org/springframework/jdbc/core/JdbcTemplate.java index 28d14d7d..d12f60c8 100644 --- a/spring-jdbc-6.0.8/org/springframework/jdbc/core/JdbcTemplate.java +++ b/spring-jdbc-6.0.8/org/springframework/jdbc/core/JdbcTemplate.java @@ -1211,7 +1211,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations { // at org.jetbrains.java.decompiler.modules.decompiler.exps.ConstExprent.toJava(ConstExprent.java:356) // at org.jetbrains.java.decompiler.modules.decompiler.stats.SwitchStatement.toJava(SwitchStatement.java:168) // at org.jetbrains.java.decompiler.modules.decompiler.stats.RootStatement.toJava(RootStatement.java:36) - // at org.jetbrains.java.decompiler.main.ClassWriter.writeMethod(ClassWriter.java:1282) + // at org.jetbrains.java.decompiler.main.ClassWriter.writeMethod(ClassWriter.java:1293) // // Bytecode: // 000: aload 2