From 7a0f11c048fec82944e539a9ef42ccc018cbe340 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Wed, 29 Jan 2025 07:14:17 -0800 Subject: [PATCH] Remove some redundancies. RELNOTES=n/a PiperOrigin-RevId: 720963735 --- .../testing/DerivedCollectionGenerators.java | 2 +- .../collect/testing/features/MapFeature.java | 4 ++-- .../collect/testing/features/SetFeature.java | 4 ++-- .../collect/testing/google/MultimapFeature.java | 4 ++-- .../collect/testing/google/MultisetFeature.java | 4 ++-- .../collect/testing/google/SetGenerators.java | 7 +------ .../google/common/collect/BenchmarkHelpers.java | 2 +- .../com/google/common/hash/HashFunctionEnum.java | 2 +- .../com/google/common/io/SourceSinkFactory.java | 14 +++++++------- .../util/concurrent/AbstractFutureBenchmarks.java | 2 +- .../src/com/google/common/cache/LocalCache.java | 2 +- .../common/collect/CompactLinkedHashSet.java | 4 +--- .../common/collect/ImmutableSetMultimap.java | 4 +--- .../src/com/google/common/collect/Streams.java | 6 +++--- .../com/google/common/collect/Synchronized.java | 2 +- .../com/google/common/graph/InvalidatableSet.java | 2 +- .../guava/src/com/google/common/hash/Funnels.java | 4 ++-- .../com/google/common/primitives/UnsignedLong.java | 3 +-- .../common/util/concurrent/AtomicDouble.java | 3 +-- .../testing/DerivedCollectionGenerators.java | 2 +- .../collect/testing/features/MapFeature.java | 4 ++-- .../collect/testing/features/SetFeature.java | 4 ++-- .../collect/testing/google/MultimapFeature.java | 4 ++-- .../collect/testing/google/MultisetFeature.java | 4 ++-- .../collect/testing/google/SetGenerators.java | 7 +------ .../common/testing/NullPointerTesterTest.java | 2 +- .../google/common/collect/StreamsBenchmark.java | 2 +- .../common/collect/AbstractHashFloodingTest.java | 2 +- .../google/common/collect/BenchmarkHelpers.java | 2 +- .../com/google/common/hash/HashFunctionEnum.java | 2 +- .../com/google/common/io/SourceSinkFactory.java | 14 +++++++------- .../util/concurrent/AbstractFutureBenchmarks.java | 2 +- guava/src/com/google/common/cache/LocalCache.java | 2 +- .../common/collect/CompactLinkedHashSet.java | 4 +--- .../common/collect/ImmutableSetMultimap.java | 4 +--- guava/src/com/google/common/collect/Streams.java | 6 +++--- .../com/google/common/collect/Synchronized.java | 2 +- .../com/google/common/graph/InvalidatableSet.java | 2 +- guava/src/com/google/common/hash/Funnels.java | 4 ++-- .../com/google/common/primitives/UnsignedLong.java | 3 +-- .../common/util/concurrent/AtomicDouble.java | 3 +-- 41 files changed, 67 insertions(+), 89 deletions(-) diff --git a/android/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java b/android/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java index ed68a490d401..85a6e8a7913e 100644 --- a/android/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java +++ b/android/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java @@ -166,7 +166,7 @@ public OneSizeTestContainerGenerator, Entry> getInnerGenerator() public static class MapSortedKeySetGenerator< K extends @Nullable Object, V extends @Nullable Object> - extends MapKeySetGenerator implements TestSortedSetGenerator, DerivedGenerator { + extends MapKeySetGenerator implements TestSortedSetGenerator { private final TestSortedMapGenerator delegate; public MapSortedKeySetGenerator( diff --git a/android/guava-testlib/src/com/google/common/collect/testing/features/MapFeature.java b/android/guava-testlib/src/com/google/common/collect/testing/features/MapFeature.java index eb6802ec67a4..14b78b5eb316 100644 --- a/android/guava-testlib/src/com/google/common/collect/testing/features/MapFeature.java +++ b/android/guava-testlib/src/com/google/common/collect/testing/features/MapFeature.java @@ -88,8 +88,8 @@ public Set> getImpliedFeatures() { @Inherited @TesterAnnotation public @interface Require { - public abstract MapFeature[] value() default {}; + MapFeature[] value() default {}; - public abstract MapFeature[] absent() default {}; + MapFeature[] absent() default {}; } } diff --git a/android/guava-testlib/src/com/google/common/collect/testing/features/SetFeature.java b/android/guava-testlib/src/com/google/common/collect/testing/features/SetFeature.java index 395faff7493b..0b01eb7919cb 100644 --- a/android/guava-testlib/src/com/google/common/collect/testing/features/SetFeature.java +++ b/android/guava-testlib/src/com/google/common/collect/testing/features/SetFeature.java @@ -49,8 +49,8 @@ public Set> getImpliedFeatures() { @Inherited @TesterAnnotation public @interface Require { - public abstract SetFeature[] value() default {}; + SetFeature[] value() default {}; - public abstract SetFeature[] absent() default {}; + SetFeature[] absent() default {}; } } diff --git a/android/guava-testlib/src/com/google/common/collect/testing/google/MultimapFeature.java b/android/guava-testlib/src/com/google/common/collect/testing/google/MultimapFeature.java index aa5f6542ca3b..86db577c061f 100644 --- a/android/guava-testlib/src/com/google/common/collect/testing/google/MultimapFeature.java +++ b/android/guava-testlib/src/com/google/common/collect/testing/google/MultimapFeature.java @@ -52,8 +52,8 @@ public Set> getImpliedFeatures() { @Inherited @TesterAnnotation public @interface Require { - public abstract MultimapFeature[] value() default {}; + MultimapFeature[] value() default {}; - public abstract MultimapFeature[] absent() default {}; + MultimapFeature[] absent() default {}; } } diff --git a/android/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java b/android/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java index c70383d0f855..407a4b20db89 100644 --- a/android/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java +++ b/android/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java @@ -50,8 +50,8 @@ public Set> getImpliedFeatures() { @Inherited @TesterAnnotation public @interface Require { - public abstract MultisetFeature[] value() default {}; + MultisetFeature[] value() default {}; - public abstract MultisetFeature[] absent() default {}; + MultisetFeature[] absent() default {}; } } diff --git a/android/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java b/android/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java index 326df916508c..29c8f9385dde 100644 --- a/android/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java +++ b/android/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java @@ -39,7 +39,6 @@ import com.google.common.collect.Ordering; import com.google.common.collect.Range; import com.google.common.collect.Sets; -import com.google.common.collect.testing.TestCollectionGenerator; import com.google.common.collect.testing.TestCollidingSetGenerator; import com.google.common.collect.testing.TestIntegerSortedSetGenerator; import com.google.common.collect.testing.TestSetGenerator; @@ -120,11 +119,7 @@ protected Set create(String[] elements) { } } - public static class ImmutableSetWithBadHashesGenerator extends TestCollidingSetGenerator - // Work around a GWT compiler bug. Not explicitly listing this will - // cause the createArray() method missing in the generated javascript. - // TODO: Remove this once the GWT bug is fixed. - implements TestCollectionGenerator { + public static class ImmutableSetWithBadHashesGenerator extends TestCollidingSetGenerator { @Override public Set create(Object... elements) { return ImmutableSet.copyOf(elements); diff --git a/android/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java b/android/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java index 45015d01e6ab..3489a989a3cc 100644 --- a/android/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java +++ b/android/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java @@ -419,7 +419,7 @@ public enum ListSizeDistribution { final int min; final int max; - private ListSizeDistribution(int min, int max) { + ListSizeDistribution(int min, int max) { this.min = min; this.max = max; } diff --git a/android/guava-tests/test/com/google/common/hash/HashFunctionEnum.java b/android/guava-tests/test/com/google/common/hash/HashFunctionEnum.java index fde53a30d6a1..2533ce270629 100644 --- a/android/guava-tests/test/com/google/common/hash/HashFunctionEnum.java +++ b/android/guava-tests/test/com/google/common/hash/HashFunctionEnum.java @@ -48,7 +48,7 @@ enum HashFunctionEnum { private final HashFunction hashFunction; - private HashFunctionEnum(HashFunction hashFunction) { + HashFunctionEnum(HashFunction hashFunction) { this.hashFunction = hashFunction; } diff --git a/android/guava-tests/test/com/google/common/io/SourceSinkFactory.java b/android/guava-tests/test/com/google/common/io/SourceSinkFactory.java index 9d086c0d4ae3..ca8c4ab61ffe 100644 --- a/android/guava-tests/test/com/google/common/io/SourceSinkFactory.java +++ b/android/guava-tests/test/com/google/common/io/SourceSinkFactory.java @@ -46,17 +46,17 @@ public interface SourceSinkFactory { T getExpected(T data); /** Cleans up anything created when creating the source or sink. */ - public abstract void tearDown() throws IOException; + void tearDown() throws IOException; /** Factory for byte or char sources. */ - public interface SourceFactory extends SourceSinkFactory { + interface SourceFactory extends SourceSinkFactory { /** Creates a new source containing some or all of the given data. */ S createSource(T data) throws IOException; } /** Factory for byte or char sinks. */ - public interface SinkFactory extends SourceSinkFactory { + interface SinkFactory extends SourceSinkFactory { /** Creates a new sink. */ S createSink() throws IOException; @@ -66,14 +66,14 @@ public interface SinkFactory extends SourceSinkFactory { } /** Factory for {@link ByteSource} instances. */ - public interface ByteSourceFactory extends SourceFactory {} + interface ByteSourceFactory extends SourceFactory {} /** Factory for {@link ByteSink} instances. */ - public interface ByteSinkFactory extends SinkFactory {} + interface ByteSinkFactory extends SinkFactory {} /** Factory for {@link CharSource} instances. */ - public interface CharSourceFactory extends SourceFactory {} + interface CharSourceFactory extends SourceFactory {} /** Factory for {@link CharSink} instances. */ - public interface CharSinkFactory extends SinkFactory {} + interface CharSinkFactory extends SinkFactory {} } diff --git a/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java b/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java index 0b5774b9ac09..1dd4986b6a3c 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java @@ -408,7 +408,7 @@ private boolean complete(@Nullable V v, @Nullable Throwable t, int finalState) { } } - static final CancellationException cancellationExceptionWithCause( + static CancellationException cancellationExceptionWithCause( @Nullable String message, @Nullable Throwable cause) { CancellationException exception = new CancellationException(message); exception.initCause(cause); diff --git a/android/guava/src/com/google/common/cache/LocalCache.java b/android/guava/src/com/google/common/cache/LocalCache.java index 40bcfb68591c..6e72b4d735ee 100644 --- a/android/guava/src/com/google/common/cache/LocalCache.java +++ b/android/guava/src/com/google/common/cache/LocalCache.java @@ -4609,7 +4609,7 @@ protected Cache delegate() { * the proxy must be able to behave as the cache itself. */ static final class LoadingSerializationProxy extends ManualSerializationProxy - implements LoadingCache, Serializable { + implements LoadingCache { private static final long serialVersionUID = 1; transient @Nullable LoadingCache autoDelegate; diff --git a/android/guava/src/com/google/common/collect/CompactLinkedHashSet.java b/android/guava/src/com/google/common/collect/CompactLinkedHashSet.java index d9f9618971d6..5a042d48176e 100644 --- a/android/guava/src/com/google/common/collect/CompactLinkedHashSet.java +++ b/android/guava/src/com/google/common/collect/CompactLinkedHashSet.java @@ -121,9 +121,7 @@ class CompactLinkedHashSet extends CompactHashSet /** Pointer to the last node in the linked list, or {@code ENDPOINT} if there are no entries. */ private transient int lastEntry; - CompactLinkedHashSet() { - super(); - } + CompactLinkedHashSet() {} CompactLinkedHashSet(int expectedSize) { super(expectedSize); diff --git a/android/guava/src/com/google/common/collect/ImmutableSetMultimap.java b/android/guava/src/com/google/common/collect/ImmutableSetMultimap.java index 7b28da633180..71aa5b606854 100644 --- a/android/guava/src/com/google/common/collect/ImmutableSetMultimap.java +++ b/android/guava/src/com/google/common/collect/ImmutableSetMultimap.java @@ -262,9 +262,7 @@ public static final class Builder extends ImmutableMultimap.Builder * Creates a new builder. The returned builder is equivalent to the builder generated by {@link * ImmutableSetMultimap#builder}. */ - public Builder() { - super(); - } + public Builder() {} Builder(int expectedKeys) { super(expectedKeys); diff --git a/android/guava/src/com/google/common/collect/Streams.java b/android/guava/src/com/google/common/collect/Streams.java index 3c242e94b9b1..8b3b25ec27cc 100644 --- a/android/guava/src/com/google/common/collect/Streams.java +++ b/android/guava/src/com/google/common/collect/Streams.java @@ -560,7 +560,7 @@ public boolean tryAdvance(Consumer action) { .onClose(stream::close); } class Splitr extends MapWithIndexSpliterator - implements IntConsumer, Spliterator { + implements IntConsumer { int holder; Splitr(Spliterator.OfInt splitr, long index) { @@ -640,7 +640,7 @@ public boolean tryAdvance(Consumer action) { .onClose(stream::close); } class Splitr extends MapWithIndexSpliterator - implements LongConsumer, Spliterator { + implements LongConsumer { long holder; Splitr(Spliterator.OfLong splitr, long index) { @@ -720,7 +720,7 @@ public boolean tryAdvance(Consumer action) { .onClose(stream::close); } class Splitr extends MapWithIndexSpliterator - implements DoubleConsumer, Spliterator { + implements DoubleConsumer { double holder; Splitr(Spliterator.OfDouble splitr, long index) { diff --git a/android/guava/src/com/google/common/collect/Synchronized.java b/android/guava/src/com/google/common/collect/Synchronized.java index b1cd1c317657..ea77ec8feae3 100644 --- a/android/guava/src/com/google/common/collect/Synchronized.java +++ b/android/guava/src/com/google/common/collect/Synchronized.java @@ -1194,7 +1194,7 @@ public SortedMap tailMap(K fromKey) { } static final class SynchronizedBiMap - extends SynchronizedMap implements BiMap, Serializable { + extends SynchronizedMap implements BiMap { private transient @Nullable Set valueSet; @RetainedWith private transient @Nullable BiMap inverse; diff --git a/android/guava/src/com/google/common/graph/InvalidatableSet.java b/android/guava/src/com/google/common/graph/InvalidatableSet.java index f261cc09cbde..80e4a943b9f5 100644 --- a/android/guava/src/com/google/common/graph/InvalidatableSet.java +++ b/android/guava/src/com/google/common/graph/InvalidatableSet.java @@ -15,7 +15,7 @@ final class InvalidatableSet extends ForwardingSet { private final Set delegate; private final Supplier errorMessage; - public static final InvalidatableSet of( + static InvalidatableSet of( Set delegate, Supplier validator, Supplier errorMessage) { return new InvalidatableSet<>( checkNotNull(delegate), checkNotNull(validator), checkNotNull(errorMessage)); diff --git a/android/guava/src/com/google/common/hash/Funnels.java b/android/guava/src/com/google/common/hash/Funnels.java index 5e643c334395..2557e9c2bb80 100644 --- a/android/guava/src/com/google/common/hash/Funnels.java +++ b/android/guava/src/com/google/common/hash/Funnels.java @@ -87,7 +87,7 @@ public static Funnel stringFunnel(Charset charset) { return new StringCharsetFunnel(charset); } - private static class StringCharsetFunnel implements Funnel, Serializable { + private static class StringCharsetFunnel implements Funnel { private final Charset charset; StringCharsetFunnel(Charset charset) { @@ -176,7 +176,7 @@ public String toString() { } private static class SequentialFunnel - implements Funnel>, Serializable { + implements Funnel> { private final Funnel elementFunnel; SequentialFunnel(Funnel elementFunnel) { diff --git a/android/guava/src/com/google/common/primitives/UnsignedLong.java b/android/guava/src/com/google/common/primitives/UnsignedLong.java index 7e1c82815525..f7580204dd33 100644 --- a/android/guava/src/com/google/common/primitives/UnsignedLong.java +++ b/android/guava/src/com/google/common/primitives/UnsignedLong.java @@ -19,7 +19,6 @@ import com.google.common.annotations.GwtCompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import java.io.Serializable; import java.math.BigInteger; import org.jspecify.annotations.Nullable; @@ -38,7 +37,7 @@ * @since 11.0 */ @GwtCompatible(serializable = true) -public final class UnsignedLong extends Number implements Comparable, Serializable { +public final class UnsignedLong extends Number implements Comparable { private static final long UNSIGNED_MASK = 0x7fffffffffffffffL; diff --git a/android/guava/src/com/google/common/util/concurrent/AtomicDouble.java b/android/guava/src/com/google/common/util/concurrent/AtomicDouble.java index c6d2a2723f96..8a21b220a5e7 100644 --- a/android/guava/src/com/google/common/util/concurrent/AtomicDouble.java +++ b/android/guava/src/com/google/common/util/concurrent/AtomicDouble.java @@ -21,7 +21,6 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import java.io.Serializable; import java.util.concurrent.atomic.AtomicLong; /** @@ -53,7 +52,7 @@ * @author Martin Buchholz * @since 11.0 */ -public class AtomicDouble extends Number implements Serializable { +public class AtomicDouble extends Number { private static final long serialVersionUID = 0L; // We would use AtomicLongFieldUpdater, but it has issues on some Android devices. diff --git a/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java b/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java index ed68a490d401..85a6e8a7913e 100644 --- a/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java +++ b/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java @@ -166,7 +166,7 @@ public OneSizeTestContainerGenerator, Entry> getInnerGenerator() public static class MapSortedKeySetGenerator< K extends @Nullable Object, V extends @Nullable Object> - extends MapKeySetGenerator implements TestSortedSetGenerator, DerivedGenerator { + extends MapKeySetGenerator implements TestSortedSetGenerator { private final TestSortedMapGenerator delegate; public MapSortedKeySetGenerator( diff --git a/guava-testlib/src/com/google/common/collect/testing/features/MapFeature.java b/guava-testlib/src/com/google/common/collect/testing/features/MapFeature.java index eb6802ec67a4..14b78b5eb316 100644 --- a/guava-testlib/src/com/google/common/collect/testing/features/MapFeature.java +++ b/guava-testlib/src/com/google/common/collect/testing/features/MapFeature.java @@ -88,8 +88,8 @@ public Set> getImpliedFeatures() { @Inherited @TesterAnnotation public @interface Require { - public abstract MapFeature[] value() default {}; + MapFeature[] value() default {}; - public abstract MapFeature[] absent() default {}; + MapFeature[] absent() default {}; } } diff --git a/guava-testlib/src/com/google/common/collect/testing/features/SetFeature.java b/guava-testlib/src/com/google/common/collect/testing/features/SetFeature.java index 395faff7493b..0b01eb7919cb 100644 --- a/guava-testlib/src/com/google/common/collect/testing/features/SetFeature.java +++ b/guava-testlib/src/com/google/common/collect/testing/features/SetFeature.java @@ -49,8 +49,8 @@ public Set> getImpliedFeatures() { @Inherited @TesterAnnotation public @interface Require { - public abstract SetFeature[] value() default {}; + SetFeature[] value() default {}; - public abstract SetFeature[] absent() default {}; + SetFeature[] absent() default {}; } } diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapFeature.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapFeature.java index aa5f6542ca3b..86db577c061f 100644 --- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapFeature.java +++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapFeature.java @@ -52,8 +52,8 @@ public Set> getImpliedFeatures() { @Inherited @TesterAnnotation public @interface Require { - public abstract MultimapFeature[] value() default {}; + MultimapFeature[] value() default {}; - public abstract MultimapFeature[] absent() default {}; + MultimapFeature[] absent() default {}; } } diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java index c70383d0f855..407a4b20db89 100644 --- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java +++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java @@ -50,8 +50,8 @@ public Set> getImpliedFeatures() { @Inherited @TesterAnnotation public @interface Require { - public abstract MultisetFeature[] value() default {}; + MultisetFeature[] value() default {}; - public abstract MultisetFeature[] absent() default {}; + MultisetFeature[] absent() default {}; } } diff --git a/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java b/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java index 326df916508c..29c8f9385dde 100644 --- a/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java +++ b/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java @@ -39,7 +39,6 @@ import com.google.common.collect.Ordering; import com.google.common.collect.Range; import com.google.common.collect.Sets; -import com.google.common.collect.testing.TestCollectionGenerator; import com.google.common.collect.testing.TestCollidingSetGenerator; import com.google.common.collect.testing.TestIntegerSortedSetGenerator; import com.google.common.collect.testing.TestSetGenerator; @@ -120,11 +119,7 @@ protected Set create(String[] elements) { } } - public static class ImmutableSetWithBadHashesGenerator extends TestCollidingSetGenerator - // Work around a GWT compiler bug. Not explicitly listing this will - // cause the createArray() method missing in the generated javascript. - // TODO: Remove this once the GWT bug is fixed. - implements TestCollectionGenerator { + public static class ImmutableSetWithBadHashesGenerator extends TestCollidingSetGenerator { @Override public Set create(Object... elements) { return ImmutableSet.copyOf(elements); diff --git a/guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java b/guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java index fb537b1dbc00..0998cbc5e8db 100644 --- a/guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java +++ b/guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java @@ -1242,7 +1242,7 @@ public void testGenericInterfaceDefaultValue() { private interface NullRejectingFromTo extends Function { @Override - public abstract T apply(F from); + T apply(F from); } private static class NullRejectingInterfaceDefaultValueChecker extends DefaultValueChecker { diff --git a/guava-tests/benchmark/com/google/common/collect/StreamsBenchmark.java b/guava-tests/benchmark/com/google/common/collect/StreamsBenchmark.java index a8736438d136..a79d8b542a9f 100644 --- a/guava-tests/benchmark/com/google/common/collect/StreamsBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/StreamsBenchmark.java @@ -46,7 +46,7 @@ enum CollectionType { final Supplier> supplier; - private CollectionType(Supplier> supplier) { + CollectionType(Supplier> supplier) { this.supplier = supplier; } } diff --git a/guava-tests/test/com/google/common/collect/AbstractHashFloodingTest.java b/guava-tests/test/com/google/common/collect/AbstractHashFloodingTest.java index d937d0c6fa1d..269609a2936b 100644 --- a/guava-tests/test/com/google/common/collect/AbstractHashFloodingTest.java +++ b/guava-tests/test/com/google/common/collect/AbstractHashFloodingTest.java @@ -112,7 +112,7 @@ void zero() { @FunctionalInterface interface Construction { @CanIgnoreReturnValue - abstract T create(List keys); + T create(List keys); static Construction> mapFromKeys( Supplier> mutableSupplier) { diff --git a/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java b/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java index 45015d01e6ab..3489a989a3cc 100644 --- a/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java +++ b/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java @@ -419,7 +419,7 @@ public enum ListSizeDistribution { final int min; final int max; - private ListSizeDistribution(int min, int max) { + ListSizeDistribution(int min, int max) { this.min = min; this.max = max; } diff --git a/guava-tests/test/com/google/common/hash/HashFunctionEnum.java b/guava-tests/test/com/google/common/hash/HashFunctionEnum.java index fde53a30d6a1..2533ce270629 100644 --- a/guava-tests/test/com/google/common/hash/HashFunctionEnum.java +++ b/guava-tests/test/com/google/common/hash/HashFunctionEnum.java @@ -48,7 +48,7 @@ enum HashFunctionEnum { private final HashFunction hashFunction; - private HashFunctionEnum(HashFunction hashFunction) { + HashFunctionEnum(HashFunction hashFunction) { this.hashFunction = hashFunction; } diff --git a/guava-tests/test/com/google/common/io/SourceSinkFactory.java b/guava-tests/test/com/google/common/io/SourceSinkFactory.java index 9d086c0d4ae3..ca8c4ab61ffe 100644 --- a/guava-tests/test/com/google/common/io/SourceSinkFactory.java +++ b/guava-tests/test/com/google/common/io/SourceSinkFactory.java @@ -46,17 +46,17 @@ public interface SourceSinkFactory { T getExpected(T data); /** Cleans up anything created when creating the source or sink. */ - public abstract void tearDown() throws IOException; + void tearDown() throws IOException; /** Factory for byte or char sources. */ - public interface SourceFactory extends SourceSinkFactory { + interface SourceFactory extends SourceSinkFactory { /** Creates a new source containing some or all of the given data. */ S createSource(T data) throws IOException; } /** Factory for byte or char sinks. */ - public interface SinkFactory extends SourceSinkFactory { + interface SinkFactory extends SourceSinkFactory { /** Creates a new sink. */ S createSink() throws IOException; @@ -66,14 +66,14 @@ public interface SinkFactory extends SourceSinkFactory { } /** Factory for {@link ByteSource} instances. */ - public interface ByteSourceFactory extends SourceFactory {} + interface ByteSourceFactory extends SourceFactory {} /** Factory for {@link ByteSink} instances. */ - public interface ByteSinkFactory extends SinkFactory {} + interface ByteSinkFactory extends SinkFactory {} /** Factory for {@link CharSource} instances. */ - public interface CharSourceFactory extends SourceFactory {} + interface CharSourceFactory extends SourceFactory {} /** Factory for {@link CharSink} instances. */ - public interface CharSinkFactory extends SinkFactory {} + interface CharSinkFactory extends SinkFactory {} } diff --git a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java b/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java index 0b5774b9ac09..1dd4986b6a3c 100644 --- a/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java +++ b/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java @@ -408,7 +408,7 @@ private boolean complete(@Nullable V v, @Nullable Throwable t, int finalState) { } } - static final CancellationException cancellationExceptionWithCause( + static CancellationException cancellationExceptionWithCause( @Nullable String message, @Nullable Throwable cause) { CancellationException exception = new CancellationException(message); exception.initCause(cause); diff --git a/guava/src/com/google/common/cache/LocalCache.java b/guava/src/com/google/common/cache/LocalCache.java index f08ddfe96cbd..472bd5a04184 100644 --- a/guava/src/com/google/common/cache/LocalCache.java +++ b/guava/src/com/google/common/cache/LocalCache.java @@ -4785,7 +4785,7 @@ protected Cache delegate() { * the proxy must be able to behave as the cache itself. */ static final class LoadingSerializationProxy extends ManualSerializationProxy - implements LoadingCache, Serializable { + implements LoadingCache { private static final long serialVersionUID = 1; transient @Nullable LoadingCache autoDelegate; diff --git a/guava/src/com/google/common/collect/CompactLinkedHashSet.java b/guava/src/com/google/common/collect/CompactLinkedHashSet.java index 62d3601a8515..acfe9d5d07f0 100644 --- a/guava/src/com/google/common/collect/CompactLinkedHashSet.java +++ b/guava/src/com/google/common/collect/CompactLinkedHashSet.java @@ -123,9 +123,7 @@ class CompactLinkedHashSet extends CompactHashSet /** Pointer to the last node in the linked list, or {@code ENDPOINT} if there are no entries. */ private transient int lastEntry; - CompactLinkedHashSet() { - super(); - } + CompactLinkedHashSet() {} CompactLinkedHashSet(int expectedSize) { super(expectedSize); diff --git a/guava/src/com/google/common/collect/ImmutableSetMultimap.java b/guava/src/com/google/common/collect/ImmutableSetMultimap.java index 2fb8fab747c9..b65f0579bab2 100644 --- a/guava/src/com/google/common/collect/ImmutableSetMultimap.java +++ b/guava/src/com/google/common/collect/ImmutableSetMultimap.java @@ -258,9 +258,7 @@ public static final class Builder extends ImmutableMultimap.Builder * Creates a new builder. The returned builder is equivalent to the builder generated by {@link * ImmutableSetMultimap#builder}. */ - public Builder() { - super(); - } + public Builder() {} Builder(int expectedKeys) { super(expectedKeys); diff --git a/guava/src/com/google/common/collect/Streams.java b/guava/src/com/google/common/collect/Streams.java index bb630caf569b..3ac88404f9b0 100644 --- a/guava/src/com/google/common/collect/Streams.java +++ b/guava/src/com/google/common/collect/Streams.java @@ -552,7 +552,7 @@ public boolean tryAdvance(Consumer action) { .onClose(stream::close); } class Splitr extends MapWithIndexSpliterator - implements IntConsumer, Spliterator { + implements IntConsumer { int holder; Splitr(Spliterator.OfInt splitr, long index) { @@ -631,7 +631,7 @@ public boolean tryAdvance(Consumer action) { .onClose(stream::close); } class Splitr extends MapWithIndexSpliterator - implements LongConsumer, Spliterator { + implements LongConsumer { long holder; Splitr(Spliterator.OfLong splitr, long index) { @@ -710,7 +710,7 @@ public boolean tryAdvance(Consumer action) { .onClose(stream::close); } class Splitr extends MapWithIndexSpliterator - implements DoubleConsumer, Spliterator { + implements DoubleConsumer { double holder; Splitr(Spliterator.OfDouble splitr, long index) { diff --git a/guava/src/com/google/common/collect/Synchronized.java b/guava/src/com/google/common/collect/Synchronized.java index 95856e7f1975..89d143d519d1 100644 --- a/guava/src/com/google/common/collect/Synchronized.java +++ b/guava/src/com/google/common/collect/Synchronized.java @@ -1343,7 +1343,7 @@ public SortedMap tailMap(K fromKey) { } static final class SynchronizedBiMap - extends SynchronizedMap implements BiMap, Serializable { + extends SynchronizedMap implements BiMap { private transient @Nullable Set valueSet; @RetainedWith private transient @Nullable BiMap inverse; diff --git a/guava/src/com/google/common/graph/InvalidatableSet.java b/guava/src/com/google/common/graph/InvalidatableSet.java index f261cc09cbde..80e4a943b9f5 100644 --- a/guava/src/com/google/common/graph/InvalidatableSet.java +++ b/guava/src/com/google/common/graph/InvalidatableSet.java @@ -15,7 +15,7 @@ final class InvalidatableSet extends ForwardingSet { private final Set delegate; private final Supplier errorMessage; - public static final InvalidatableSet of( + static InvalidatableSet of( Set delegate, Supplier validator, Supplier errorMessage) { return new InvalidatableSet<>( checkNotNull(delegate), checkNotNull(validator), checkNotNull(errorMessage)); diff --git a/guava/src/com/google/common/hash/Funnels.java b/guava/src/com/google/common/hash/Funnels.java index 5e643c334395..2557e9c2bb80 100644 --- a/guava/src/com/google/common/hash/Funnels.java +++ b/guava/src/com/google/common/hash/Funnels.java @@ -87,7 +87,7 @@ public static Funnel stringFunnel(Charset charset) { return new StringCharsetFunnel(charset); } - private static class StringCharsetFunnel implements Funnel, Serializable { + private static class StringCharsetFunnel implements Funnel { private final Charset charset; StringCharsetFunnel(Charset charset) { @@ -176,7 +176,7 @@ public String toString() { } private static class SequentialFunnel - implements Funnel>, Serializable { + implements Funnel> { private final Funnel elementFunnel; SequentialFunnel(Funnel elementFunnel) { diff --git a/guava/src/com/google/common/primitives/UnsignedLong.java b/guava/src/com/google/common/primitives/UnsignedLong.java index 7e1c82815525..f7580204dd33 100644 --- a/guava/src/com/google/common/primitives/UnsignedLong.java +++ b/guava/src/com/google/common/primitives/UnsignedLong.java @@ -19,7 +19,6 @@ import com.google.common.annotations.GwtCompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import java.io.Serializable; import java.math.BigInteger; import org.jspecify.annotations.Nullable; @@ -38,7 +37,7 @@ * @since 11.0 */ @GwtCompatible(serializable = true) -public final class UnsignedLong extends Number implements Comparable, Serializable { +public final class UnsignedLong extends Number implements Comparable { private static final long UNSIGNED_MASK = 0x7fffffffffffffffL; diff --git a/guava/src/com/google/common/util/concurrent/AtomicDouble.java b/guava/src/com/google/common/util/concurrent/AtomicDouble.java index 0251cedd5da7..80cb9007a5af 100644 --- a/guava/src/com/google/common/util/concurrent/AtomicDouble.java +++ b/guava/src/com/google/common/util/concurrent/AtomicDouble.java @@ -25,7 +25,6 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import java.io.Serializable; import java.util.concurrent.atomic.AtomicLongFieldUpdater; import java.util.function.DoubleBinaryOperator; import java.util.function.DoubleUnaryOperator; @@ -62,7 +61,7 @@ @GwtIncompatible @J2ktIncompatible @ReflectionSupport(value = ReflectionSupport.Level.FULL) -public class AtomicDouble extends Number implements Serializable { +public class AtomicDouble extends Number { private static final long serialVersionUID = 0L; private transient volatile long value;