diff --git a/android/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTester.java b/android/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTester.java index c2f0ffe809fa..7ebb133e3cb4 100644 --- a/android/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTester.java +++ b/android/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTester.java @@ -53,12 +53,16 @@ protected Collection resetContainer(Collection newContents) { return collection; } - /** @see AbstractContainerTester#resetContainer() */ + /** + * @see AbstractContainerTester#resetContainer() + */ protected void resetCollection() { resetContainer(); } - /** @return an array of the proper size with {@code null} inserted into the middle element. */ + /** + * @return an array of the proper size with {@code null} inserted into the middle element. + */ protected E[] createArrayWithNullElement() { E[] array = createSamplesArray(); array[getNullLocation()] = null; diff --git a/android/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java b/android/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java index 9b72beb16cf2..23e5584ba72b 100644 --- a/android/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java +++ b/android/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java @@ -56,7 +56,9 @@ protected Collection> actualContents() { return getMap().entrySet(); } - /** @see AbstractContainerTester#resetContainer() */ + /** + * @see AbstractContainerTester#resetContainer() + */ protected final void resetMap() { resetContainer(); } @@ -77,7 +79,9 @@ protected void expectMissingValues(V... elements) { } } - /** @return an array of the proper size with {@code null} as the key of the middle element. */ + /** + * @return an array of the proper size with {@code null} as the key of the middle element. + */ protected Entry[] createArrayWithNullKey() { Entry[] array = createSamplesArray(); int nullKeyLocation = getNullLocation(); @@ -102,7 +106,9 @@ private Entry getEntryNullReplaces() { return entries.next(); } - /** @return an array of the proper size with {@code null} as the value of the middle element. */ + /** + * @return an array of the proper size with {@code null} as the value of the middle element. + */ protected Entry[] createArrayWithNullValue() { Entry[] array = createSamplesArray(); int nullValueLocation = getNullLocation(); diff --git a/android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java b/android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java index db0843517a81..fd9b24126bed 100644 --- a/android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java +++ b/android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java @@ -203,7 +203,9 @@ public void testNulls(Class cls) { } void doTestNulls(Class cls, Visibility visibility) - throws ParameterNotInstantiableException, IllegalAccessException, InvocationTargetException, + throws ParameterNotInstantiableException, + IllegalAccessException, + InvocationTargetException, FactoryMethodReturnsNullException { if (!Modifier.isAbstract(cls.getModifiers())) { nullPointerTester.testConstructors(cls, visibility); @@ -295,8 +297,11 @@ public void testEquals(Class cls) { } void doTestEquals(Class cls) - throws ParameterNotInstantiableException, ParameterHasNoDistinctValueException, - IllegalAccessException, InvocationTargetException, FactoryMethodReturnsNullException { + throws ParameterNotInstantiableException, + ParameterHasNoDistinctValueException, + IllegalAccessException, + InvocationTargetException, + FactoryMethodReturnsNullException { if (cls.isEnum()) { return; } @@ -566,8 +571,11 @@ public FactoryMethodReturnValueTester testEqualsAndSerializable() throws Excepti } private void testEqualsUsing(final Invokable factory) - throws ParameterNotInstantiableException, ParameterHasNoDistinctValueException, - IllegalAccessException, InvocationTargetException, FactoryMethodReturnsNullException { + throws ParameterNotInstantiableException, + ParameterHasNoDistinctValueException, + IllegalAccessException, + InvocationTargetException, + FactoryMethodReturnsNullException { List params = factory.getParameters(); List argGenerators = Lists.newArrayListWithCapacity(params.size()); List<@Nullable Object> args = Lists.newArrayListWithCapacity(params.size()); @@ -617,8 +625,10 @@ String reportItem(Item item) { */ private List generateEqualFactoryArguments( Invokable factory, List params, List args) - throws ParameterNotInstantiableException, FactoryMethodReturnsNullException, - InvocationTargetException, IllegalAccessException { + throws ParameterNotInstantiableException, + FactoryMethodReturnsNullException, + InvocationTargetException, + IllegalAccessException { List equalArgs = Lists.newArrayList(args); for (int i = 0; i < args.size(); i++) { Parameter param = params.get(i); diff --git a/android/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java b/android/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java index d1c0d38a62be..f8a53e45e9b1 100644 --- a/android/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java @@ -32,6 +32,7 @@ public class SplitterBenchmark { // overall size of string @Param({"1", "10", "100", "1000"}) int length; + // Number of matching strings @Param({"xxxx", "xxXx", "xXxX", "XXXX"}) String text; diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java index a1db2b6c0242..9eb6cdd465e0 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java @@ -52,6 +52,7 @@ interface ExecutionListWrapper { void add(Runnable runnable, Executor executor); void execute(); + /** Returns the underlying implementation, useful for the Footprint benchmark. */ Object getImpl(); } diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java index 23f700cdb66a..d1ce1a154a5e 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java @@ -102,6 +102,7 @@ private enum ExceptionType { @Param Validator validator; @Param Result result; @Param ExceptionType exceptionType; + /** * The number of other exception types in the cache of known-good exceptions and the number of * other {@code ClassValue} entries for the exception type to be tested. This lets us evaluate diff --git a/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java b/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java index a1c0ab02910d..cc04a97201da 100644 --- a/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java +++ b/android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java @@ -62,10 +62,13 @@ public class MonitorBasedArrayBlockingQueue extends AbstractQueue /** The queued items */ final E[] items; + /** items index for next take, poll or remove */ int takeIndex; + /** items index for next put, offer, or add. */ int putIndex; + /** Number of items in the queue */ private int count; diff --git a/android/guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java b/android/guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java index b000664293c2..1ded6f1ee474 100644 --- a/android/guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java @@ -389,7 +389,7 @@ public void testComplexBuilder() { public void testBuilderAddHandlesNullsCorrectly() { { - ImmutableSet.Builder builder = this.builder(); + ImmutableSet.Builder builder = this.builder(); assertThrows(NullPointerException.class, () -> builder.add((String) null)); } @@ -421,7 +421,7 @@ public void testBuilderAddHandlesNullsCorrectly() { public void testBuilderAddAllHandlesNullsCorrectly() { { - ImmutableSet.Builder builder = this.builder(); + ImmutableSet.Builder builder = this.builder(); assertThrows(NullPointerException.class, () -> builder.addAll((Iterable) null)); } @@ -432,13 +432,13 @@ public void testBuilderAddAllHandlesNullsCorrectly() { { ImmutableSet.Builder builder = this.builder(); - List<@Nullable String> listWithNulls = asList("a", null, "b"); + List<@Nullable String> listWithNulls = asList("a", null, "b"); assertThrows(NullPointerException.class, () -> builder.addAll((List) listWithNulls)); } { ImmutableSet.Builder builder = this.builder(); - Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b"); + Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b"); assertThrows( NullPointerException.class, () -> builder.addAll((Iterable) iterableWithNulls)); } diff --git a/android/guava-tests/test/com/google/common/collect/FilteredMapTest.java b/android/guava-tests/test/com/google/common/collect/FilteredMapTest.java index 70e561443e70..439099b11fda 100644 --- a/android/guava-tests/test/com/google/common/collect/FilteredMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/FilteredMapTest.java @@ -16,7 +16,6 @@ package com.google.common.collect; - import com.google.common.annotations.GwtCompatible; import java.util.Map; import org.jspecify.annotations.NullMarked; diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableListTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableListTest.java index f5b6880a193b..1018f658b60f 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableListTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableListTest.java @@ -567,7 +567,7 @@ public void testBuilderAddHandlesNullsCorrectly() { public void testBuilderAddAllHandlesNullsCorrectly() { { - ImmutableList.Builder builder = ImmutableList.builder(); + ImmutableList.Builder builder = ImmutableList.builder(); assertThrows(NullPointerException.class, () -> builder.addAll((Iterable) null)); } @@ -578,21 +578,21 @@ public void testBuilderAddAllHandlesNullsCorrectly() { { ImmutableList.Builder builder = ImmutableList.builder(); - List<@Nullable String> listWithNulls = asList("a", null, "b"); + List<@Nullable String> listWithNulls = asList("a", null, "b"); assertThrows(NullPointerException.class, () -> builder.addAll((List) listWithNulls)); } { ImmutableList.Builder builder = ImmutableList.builder(); - Iterator<@Nullable String> iteratorWithNulls = - Arrays.<@Nullable String>asList("a", null, "b").iterator(); + Iterator<@Nullable String> iteratorWithNulls = + Arrays.<@Nullable String>asList("a", null, "b").iterator(); assertThrows( NullPointerException.class, () -> builder.addAll((Iterator) iteratorWithNulls)); } { ImmutableList.Builder builder = ImmutableList.builder(); - Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b"); + Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b"); assertThrows( NullPointerException.class, () -> builder.addAll((Iterable) iterableWithNulls)); } diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableMapTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableMapTest.java index d22e5682c998..1a3ceea2abd3 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableMapTest.java @@ -554,9 +554,9 @@ public void testBuilder_keepingLast_thenOrThrow() { // being true. Pattern pattern = Pattern.compile("Multiple entries with same key: four=(.*) and four=(.*)"); assertThat(expected).hasMessageThat().matches(pattern); - Matcher matcher = pattern.matcher(expected.getMessage()); - assertThat(matcher.matches()).isTrue(); - assertThat(matcher.group(1)).isNotEqualTo(matcher.group(2)); + Matcher matcher = pattern.matcher(expected.getMessage()); + assertThat(matcher.matches()).isTrue(); + assertThat(matcher.group(1)).isNotEqualTo(matcher.group(2)); } public void testOf() { diff --git a/android/guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java b/android/guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java index 2aa3ab1e1974..0fd2b6a0db10 100644 --- a/android/guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java +++ b/android/guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java @@ -404,20 +404,20 @@ public void testBuilderAddHandlesNullsCorrectly() { public void testBuilderAddAllHandlesNullsCorrectly() { { - ImmutableMultiset.Builder builder = ImmutableMultiset.builder(); + ImmutableMultiset.Builder builder = ImmutableMultiset.builder(); assertThrows(NullPointerException.class, () -> builder.addAll((Collection) null)); } { ImmutableMultiset.Builder builder = ImmutableMultiset.builder(); - List<@Nullable String> listWithNulls = asList("a", null, "b"); + List<@Nullable String> listWithNulls = asList("a", null, "b"); assertThrows(NullPointerException.class, () -> builder.addAll((List) listWithNulls)); } { ImmutableMultiset.Builder builder = ImmutableMultiset.builder(); - Multiset<@Nullable String> multisetWithNull = - LinkedHashMultiset.create(Arrays.<@Nullable String>asList("a", null, "b")); + Multiset<@Nullable String> multisetWithNull = + LinkedHashMultiset.create(Arrays.<@Nullable String>asList("a", null, "b")); assertThrows( NullPointerException.class, () -> builder.addAll((Multiset) multisetWithNull)); } diff --git a/android/guava-tests/test/com/google/common/collect/IterablesTest.java b/android/guava-tests/test/com/google/common/collect/IterablesTest.java index 162bd3730173..938932850c83 100644 --- a/android/guava-tests/test/com/google/common/collect/IterablesTest.java +++ b/android/guava-tests/test/com/google/common/collect/IterablesTest.java @@ -838,7 +838,9 @@ public void testGetLast_withDefault_multiple() { * need to prove that it isn't called. */ private static class DiesOnIteratorArrayList extends ArrayList { - /** @throws UnsupportedOperationException all the time */ + /** + * @throws UnsupportedOperationException all the time + */ @Override public Iterator iterator() { throw new UnsupportedOperationException(); diff --git a/android/guava-tests/test/com/google/common/collect/MapsTest.java b/android/guava-tests/test/com/google/common/collect/MapsTest.java index b70e5e7909cc..61ddae77aaf9 100644 --- a/android/guava-tests/test/com/google/common/collect/MapsTest.java +++ b/android/guava-tests/test/com/google/common/collect/MapsTest.java @@ -1412,12 +1412,12 @@ public void testUnmodifiableNavigableMap() { iterator.remove(); }); { - Entry entry = entries.iterator().next(); + Entry entry = entries.iterator().next(); assertThrows(UnsupportedOperationException.class, () -> entry.setValue("four")); } { Entry entry = unmod.lowerEntry(1); - assertNull(entry); + assertNull(entry); } { Entry entry = unmod.floorEntry(2); diff --git a/android/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java b/android/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java index 686473e57d17..80d6d07498d8 100644 --- a/android/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java +++ b/android/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java @@ -151,6 +151,7 @@ public void testFalsePositivesForNextEscapedIndex() { protected char @Nullable [] escape(int cp) { return ('a' <= cp && cp <= 'z') ? new char[] {Character.toUpperCase((char) cp)} : null; } + // Inefficient implementation that defines all letters as escapable. @Override protected int nextEscapeIndex(CharSequence csq, int index, int end) { diff --git a/android/guava-tests/test/com/google/common/graph/TestUtil.java b/android/guava-tests/test/com/google/common/graph/TestUtil.java index 8a7dfbef6665..e1aea12d76cc 100644 --- a/android/guava-tests/test/com/google/common/graph/TestUtil.java +++ b/android/guava-tests/test/com/google/common/graph/TestUtil.java @@ -45,7 +45,7 @@ static void assertNodeNotInGraphErrorMessage(Throwable throwable) { assertThat(throwable).hasMessageThat().startsWith(NODE_STRING); assertThat(throwable).hasMessageThat().contains(ERROR_ELEMENT_NOT_IN_GRAPH); } - + static void assertEdgeNotInGraphErrorMessage(Throwable throwable) { assertThat(throwable).hasMessageThat().startsWith(EDGE_STRING); assertThat(throwable).hasMessageThat().contains(ERROR_ELEMENT_NOT_IN_GRAPH); diff --git a/android/guava-tests/test/com/google/common/math/IntMathTest.java b/android/guava-tests/test/com/google/common/math/IntMathTest.java index cd78b28b97e2..38044cd4a6db 100644 --- a/android/guava-tests/test/com/google/common/math/IntMathTest.java +++ b/android/guava-tests/test/com/google/common/math/IntMathTest.java @@ -98,9 +98,9 @@ public void testFloorPowerOfTwoZero() { @GwtIncompatible // BigIntegerMath // TODO(cpovirk): GWT-enable BigIntegerMath public void testConstantMaxPowerOfSqrt2Unsigned() { assertEquals( - /*expected=*/ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Integer.SIZE - 1), FLOOR) + /* expected= */ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Integer.SIZE - 1), FLOOR) .intValue(), - /*actual=*/ IntMath.MAX_POWER_OF_SQRT2_UNSIGNED); + /* actual= */ IntMath.MAX_POWER_OF_SQRT2_UNSIGNED); } @GwtIncompatible // pow() @@ -148,8 +148,8 @@ public void testConstantsBiggestBinomials() { @GwtIncompatible // sqrt public void testPowersSqrtMaxInt() { assertEquals( - /*expected=*/ IntMath.sqrt(Integer.MAX_VALUE, FLOOR), - /*actual=*/ IntMath.FLOOR_SQRT_MAX_INT); + /* expected= */ IntMath.sqrt(Integer.MAX_VALUE, FLOOR), + /* actual= */ IntMath.FLOOR_SQRT_MAX_INT); } @AndroidIncompatible // presumably slow diff --git a/android/guava-tests/test/com/google/common/math/LongMathTest.java b/android/guava-tests/test/com/google/common/math/LongMathTest.java index 85270faf2fa3..e15ee30c5b18 100644 --- a/android/guava-tests/test/com/google/common/math/LongMathTest.java +++ b/android/guava-tests/test/com/google/common/math/LongMathTest.java @@ -99,9 +99,9 @@ public void testFloorPowerOfTwoZero() { @GwtIncompatible // TODO public void testConstantMaxPowerOfSqrt2Unsigned() { assertEquals( - /*expected=*/ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Long.SIZE - 1), FLOOR) + /* expected= */ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Long.SIZE - 1), FLOOR) .longValue(), - /*actual=*/ LongMath.MAX_POWER_OF_SQRT2_UNSIGNED); + /* actual= */ LongMath.MAX_POWER_OF_SQRT2_UNSIGNED); } @GwtIncompatible // BigIntegerMath // TODO(cpovirk): GWT-enable BigIntegerMath @@ -137,8 +137,8 @@ public void testConstantsHalfPowersOf10() { @GwtIncompatible // TODO public void testConstantsSqrtMaxLong() { assertEquals( - /*expected=*/ LongMath.sqrt(Long.MAX_VALUE, FLOOR), - /*actual=*/ LongMath.FLOOR_SQRT_MAX_LONG); + /* expected= */ LongMath.sqrt(Long.MAX_VALUE, FLOOR), + /* actual= */ LongMath.FLOOR_SQRT_MAX_LONG); } @GwtIncompatible // TODO diff --git a/android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java b/android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java index 8bbe2cac52da..87d6bf9e571d 100644 --- a/android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java +++ b/android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java @@ -106,7 +106,6 @@ public void testValueOfLong() { } } - public void testValueOfBigInteger() { BigInteger min = BigInteger.ZERO; BigInteger max = UnsignedLong.MAX_VALUE.bigIntegerValue(); diff --git a/android/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java b/android/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java index 683abc29c47e..38f508e1f8ac 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java @@ -194,7 +194,7 @@ public void testImmediateCancelledFutureStack() throws Exception { assertThrows(CancellationException.class, () -> CallerClass2.get(future)); List stackTrace = ImmutableList.copyOf(expected.getStackTrace()); assertFalse(Iterables.any(stackTrace, hasClassName(CallerClass1.class))); - assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class))); + assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class))); // See AbstractFutureCancellationCauseTest for how to set causes. assertThat(expected).hasCauseThat().isNull(); @@ -2253,7 +2253,7 @@ public void testAllAsList_logging_error() throws Exception { () -> getDone(allAsList(immediateFailedFuture(new SomeError())))); assertThat(expected).hasCauseThat().isInstanceOf(SomeError.class); List logged = aggregateFutureLogHandler.getStoredLogRecords(); - assertThat(logged).hasSize(1); // errors are always logged + assertThat(logged).hasSize(1); // errors are always logged assertThat(logged.get(0).getThrown()).isInstanceOf(SomeError.class); } @@ -2269,8 +2269,8 @@ public void testAllAsList_logging_multipleExceptions_alreadyDone() throws Except immediateFailedFuture(new MyException())))); assertThat(expected).hasCauseThat().isInstanceOf(MyException.class); List logged = aggregateFutureLogHandler.getStoredLogRecords(); - assertThat(logged).hasSize(1); // the second failure is logged - assertThat(logged.get(0).getThrown()).isInstanceOf(MyException.class); + assertThat(logged).hasSize(1); // the second failure is logged + assertThat(logged.get(0).getThrown()).isInstanceOf(MyException.class); } /** All as list will log extra exceptions that occur later. */ diff --git a/android/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java index f2934358cbc0..bcd6e95adcaa 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java @@ -16,7 +16,6 @@ package com.google.common.util.concurrent; - import com.google.common.annotations.GwtCompatible; import com.google.common.util.concurrent.AbstractFuture.TrustedFuture; import org.jspecify.annotations.NullUnmarked; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java b/android/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java index df673a8cf7f0..44ee313c7656 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java @@ -16,7 +16,6 @@ package com.google.common.util.concurrent; - import com.google.common.annotations.GwtCompatible; import com.google.common.util.concurrent.AbstractFuture.TrustedFuture; import org.jspecify.annotations.NullUnmarked; diff --git a/android/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java b/android/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java index 941acc6a8b2a..68edc7b7691e 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java @@ -46,6 +46,7 @@ @NullUnmarked public class WrappingExecutorServiceTest extends TestCase { private static final String RESULT_VALUE = "ran"; + // Uninteresting delegations public void testDelegations() throws InterruptedException { MockExecutor mock = new MockExecutor(); diff --git a/android/guava/src/com/google/common/base/Equivalence.java b/android/guava/src/com/google/common/base/Equivalence.java index 0389922e7cc2..c8ae89bad0f6 100644 --- a/android/guava/src/com/google/common/base/Equivalence.java +++ b/android/guava/src/com/google/common/base/Equivalence.java @@ -75,7 +75,6 @@ public final boolean equivalent(@Nullable T a, @Nullable T b) { } /** - * * @since 10.0 (previously, subclasses would override equivalent()) */ @ForOverride diff --git a/android/guava/src/com/google/common/base/Functions.java b/android/guava/src/com/google/common/base/Functions.java index 70fa63640834..92d1cb09696c 100644 --- a/android/guava/src/com/google/common/base/Functions.java +++ b/android/guava/src/com/google/common/base/Functions.java @@ -293,7 +293,9 @@ public String toString() { return new PredicateFunction<>(predicate); } - /** @see Functions#forPredicate */ + /** + * @see Functions#forPredicate + */ private static class PredicateFunction implements Function, Serializable { private final Predicate predicate; @@ -390,7 +392,9 @@ public String toString() { return new SupplierFunction<>(supplier); } - /** @see Functions#forSupplier */ + /** + * @see Functions#forSupplier + */ private static class SupplierFunction implements Function, Serializable { diff --git a/android/guava/src/com/google/common/base/Predicates.java b/android/guava/src/com/google/common/base/Predicates.java index 934c381b0f33..be84124c37d4 100644 --- a/android/guava/src/com/google/common/base/Predicates.java +++ b/android/guava/src/com/google/common/base/Predicates.java @@ -254,7 +254,9 @@ public static Predicate contains(Pattern pattern) { // Package private for GWT serialization. enum ObjectPredicate implements Predicate<@Nullable Object> { - /** @see Predicates#alwaysTrue() */ + /** + * @see Predicates#alwaysTrue() + */ ALWAYS_TRUE { @Override public boolean apply(@Nullable Object o) { @@ -266,7 +268,9 @@ public String toString() { return "Predicates.alwaysTrue()"; } }, - /** @see Predicates#alwaysFalse() */ + /** + * @see Predicates#alwaysFalse() + */ ALWAYS_FALSE { @Override public boolean apply(@Nullable Object o) { @@ -278,7 +282,9 @@ public String toString() { return "Predicates.alwaysFalse()"; } }, - /** @see Predicates#isNull() */ + /** + * @see Predicates#isNull() + */ IS_NULL { @Override public boolean apply(@Nullable Object o) { @@ -290,7 +296,9 @@ public String toString() { return "Predicates.isNull()"; } }, - /** @see Predicates#notNull() */ + /** + * @see Predicates#notNull() + */ NOT_NULL { @Override public boolean apply(@Nullable Object o) { @@ -309,7 +317,9 @@ public String toString() { } } - /** @see Predicates#not(Predicate) */ + /** + * @see Predicates#not(Predicate) + */ private static class NotPredicate implements Predicate, Serializable { final Predicate predicate; @@ -345,7 +355,9 @@ public String toString() { private static final long serialVersionUID = 0; } - /** @see Predicates#and(Iterable) */ + /** + * @see Predicates#and(Iterable) + */ private static class AndPredicate implements Predicate, Serializable { private final List> components; @@ -388,7 +400,9 @@ public String toString() { private static final long serialVersionUID = 0; } - /** @see Predicates#or(Iterable) */ + /** + * @see Predicates#or(Iterable) + */ private static class OrPredicate implements Predicate, Serializable { private final List> components; @@ -444,7 +458,9 @@ private static String toStringHelper(String methodName, Iterable components) return builder.append(')').toString(); } - /** @see Predicates#equalTo(Object) */ + /** + * @see Predicates#equalTo(Object) + */ private static class IsEqualToPredicate implements Predicate<@Nullable Object>, Serializable { private final Object target; @@ -562,7 +578,9 @@ public String toString() { private static final long serialVersionUID = 0; } - /** @see Predicates#in(Collection) */ + /** + * @see Predicates#in(Collection) + */ private static class InPredicate implements Predicate, Serializable { private final Collection target; @@ -602,7 +620,9 @@ public String toString() { private static final long serialVersionUID = 0; } - /** @see Predicates#compose(Predicate, Function) */ + /** + * @see Predicates#compose(Predicate, Function) + */ private static class CompositionPredicate implements Predicate, Serializable { final Predicate p; diff --git a/android/guava/src/com/google/common/cache/AbstractCache.java b/android/guava/src/com/google/common/cache/AbstractCache.java index e5e51a5af5e1..bb5596ff58d5 100644 --- a/android/guava/src/com/google/common/cache/AbstractCache.java +++ b/android/guava/src/com/google/common/cache/AbstractCache.java @@ -43,7 +43,9 @@ public abstract class AbstractCache implements Cache { /** Constructor for use by subclasses. */ protected AbstractCache() {} - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public V get(K key, Callable valueLoader) throws ExecutionException { throw new UnsupportedOperationException(); @@ -78,13 +80,17 @@ public ImmutableMap getAllPresent(Iterable keys) { return ImmutableMap.copyOf(result); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public void put(K key, V value) { throw new UnsupportedOperationException(); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @Override public void putAll(Map m) { for (Entry entry : m.entrySet()) { @@ -105,7 +111,9 @@ public void invalidate(Object key) { throw new UnsupportedOperationException(); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override // For discussion of , see getAllPresent. public void invalidateAll(Iterable keys) { @@ -209,13 +217,17 @@ public static final class SimpleStatsCounter implements StatsCounter { /** Constructs an instance with all counts initialized to zero. */ public SimpleStatsCounter() {} - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public void recordHits(int count) { hitCount.add(count); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public void recordMisses(int count) { missCount.add(count); diff --git a/android/guava/src/com/google/common/cache/ForwardingCache.java b/android/guava/src/com/google/common/cache/ForwardingCache.java index 87b8fde2a908..be7df89a3566 100644 --- a/android/guava/src/com/google/common/cache/ForwardingCache.java +++ b/android/guava/src/com/google/common/cache/ForwardingCache.java @@ -49,13 +49,17 @@ protected ForwardingCache() {} return delegate().getIfPresent(key); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public V get(K key, Callable valueLoader) throws ExecutionException { return delegate().get(key, valueLoader); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override /* * is mostly the same as to plain Java. But to nullness checkers, they @@ -65,13 +69,17 @@ public ImmutableMap getAllPresent(Iterable keys) { return delegate().getAllPresent(keys); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public void put(K key, V value) { delegate().put(key, value); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @Override public void putAll(Map m) { delegate().putAll(m); @@ -82,7 +90,9 @@ public void invalidate(Object key) { delegate().invalidate(key); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override // For discussion of , see getAllPresent. public void invalidateAll(Iterable keys) { diff --git a/android/guava/src/com/google/common/collect/ArrayTable.java b/android/guava/src/com/google/common/collect/ArrayTable.java index 1377d6fa3414..a72f31ef7514 100644 --- a/android/guava/src/com/google/common/collect/ArrayTable.java +++ b/android/guava/src/com/google/common/collect/ArrayTable.java @@ -160,8 +160,7 @@ private ArrayTable(Iterable rowKeys, Iterable columnKe columnKeyToIndex = Maps.indexMap(columnList); @SuppressWarnings("unchecked") - @Nullable - V[][] tmpArray = (@Nullable V[][]) new Object[rowList.size()][columnList.size()]; + @Nullable V[][] tmpArray = (@Nullable V[][]) new Object[rowList.size()][columnList.size()]; array = tmpArray; // Necessary because in GWT the arrays are initialized with "undefined" instead of null. eraseAll(); @@ -178,8 +177,7 @@ private ArrayTable(ArrayTable table) { rowKeyToIndex = table.rowKeyToIndex; columnKeyToIndex = table.columnKeyToIndex; @SuppressWarnings("unchecked") - @Nullable - V[][] copy = (@Nullable V[][]) new Object[rowList.size()][columnList.size()]; + @Nullable V[][] copy = (@Nullable V[][]) new Object[rowList.size()][columnList.size()]; array = copy; for (int i = 0; i < rowList.size(); i++) { arraycopy(table.array[i], 0, copy[i], 0, table.array[i].length); @@ -361,8 +359,8 @@ public ImmutableList columnKeyList() { @GwtIncompatible // reflection public @Nullable V[][] toArray(Class valueClass) { @SuppressWarnings("unchecked") // TODO: safe? - @Nullable - V[][] copy = (@Nullable V[][]) Array.newInstance(valueClass, rowList.size(), columnList.size()); + @Nullable V[][] copy = + (@Nullable V[][]) Array.newInstance(valueClass, rowList.size(), columnList.size()); for (int i = 0; i < rowList.size(); i++) { arraycopy(array[i], 0, copy[i], 0, array[i].length); } diff --git a/android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java b/android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java index ce1ad289f8b6..ea831cd57562 100644 --- a/android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java +++ b/android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java @@ -484,7 +484,9 @@ Iterator elementIterator() { throw new AssertionError("should never be called"); } - /** @deprecated Internal method, use {@link #entrySet()}. */ + /** + * @deprecated Internal method, use {@link #entrySet()}. + */ @Deprecated @Override public Set> createEntrySet() { @@ -589,7 +591,9 @@ private List> snapshot() { } } - /** @serialData the ConcurrentMap of elements and their counts. */ + /** + * @serialData the ConcurrentMap of elements and their counts. + */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeObject(countMap); diff --git a/android/guava/src/com/google/common/collect/ContiguousSet.java b/android/guava/src/com/google/common/collect/ContiguousSet.java index 574e7ff36b57..bb5aa11a4a0e 100644 --- a/android/guava/src/com/google/common/collect/ContiguousSet.java +++ b/android/guava/src/com/google/common/collect/ContiguousSet.java @@ -154,7 +154,9 @@ public ContiguousSet headSet(C toElement) { return headSetImpl(checkNotNull(toElement), false); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public ContiguousSet headSet(C toElement, boolean inclusive) { @@ -169,7 +171,9 @@ public ContiguousSet subSet(C fromElement, C toElement) { return subSetImpl(fromElement, true, toElement, false); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public ContiguousSet subSet( @@ -185,7 +189,9 @@ public ContiguousSet tailSet(C fromElement) { return tailSetImpl(checkNotNull(fromElement), true); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public ContiguousSet tailSet(C fromElement, boolean inclusive) { diff --git a/android/guava/src/com/google/common/collect/DenseImmutableTable.java b/android/guava/src/com/google/common/collect/DenseImmutableTable.java index 42fdeebeeae6..eef7e8bab983 100644 --- a/android/guava/src/com/google/common/collect/DenseImmutableTable.java +++ b/android/guava/src/com/google/common/collect/DenseImmutableTable.java @@ -57,8 +57,7 @@ final class DenseImmutableTable extends RegularImmutableTable ImmutableSet rowSpace, ImmutableSet columnSpace) { @SuppressWarnings("unchecked") - @Nullable - V[][] array = (@Nullable V[][]) new Object[rowSpace.size()][columnSpace.size()]; + @Nullable V[][] array = (@Nullable V[][]) new Object[rowSpace.size()][columnSpace.size()]; this.values = array; this.rowKeyToIndex = Maps.indexMap(rowSpace); this.columnKeyToIndex = Maps.indexMap(columnSpace); diff --git a/android/guava/src/com/google/common/collect/HashBiMap.java b/android/guava/src/com/google/common/collect/HashBiMap.java index 796ac49b5d72..21b7166c7989 100644 --- a/android/guava/src/com/google/common/collect/HashBiMap.java +++ b/android/guava/src/com/google/common/collect/HashBiMap.java @@ -88,25 +88,34 @@ public final class HashBiMap ImmutableBiMap of( return new RegularImmutableBiMap( new Object[] {k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6}, 6); } + /** * Returns an immutable map containing the given entries, in order. * @@ -170,6 +171,7 @@ public static ImmutableBiMap of( return new RegularImmutableBiMap( new Object[] {k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7}, 7); } + /** * Returns an immutable map containing the given entries, in order. * @@ -204,6 +206,7 @@ public static ImmutableBiMap of( return new RegularImmutableBiMap( new Object[] {k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8}, 8); } + /** * Returns an immutable map containing the given entries, in order. * @@ -241,6 +244,7 @@ public static ImmutableBiMap of( return new RegularImmutableBiMap( new Object[] {k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8, k9, v9}, 9); } + /** * Returns an immutable map containing the given entries, in order. * diff --git a/android/guava/src/com/google/common/collect/ImmutableMap.java b/android/guava/src/com/google/common/collect/ImmutableMap.java index 00d1758d5daf..a06ec906e765 100644 --- a/android/guava/src/com/google/common/collect/ImmutableMap.java +++ b/android/guava/src/com/google/common/collect/ImmutableMap.java @@ -203,6 +203,7 @@ public static ImmutableMap of( return RegularImmutableMap.create( 6, new Object[] {k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6}); } + /** * Returns an immutable map containing the given entries, in order. * @@ -221,6 +222,7 @@ public static ImmutableMap of( return RegularImmutableMap.create( 7, new Object[] {k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7}); } + /** * Returns an immutable map containing the given entries, in order. * @@ -255,6 +257,7 @@ public static ImmutableMap of( return RegularImmutableMap.create( 8, new Object[] {k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8}); } + /** * Returns an immutable map containing the given entries, in order. * @@ -292,6 +295,7 @@ public static ImmutableMap of( return RegularImmutableMap.create( 9, new Object[] {k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8, k9, v9}); } + /** * Returns an immutable map containing the given entries, in order. * @@ -436,6 +440,7 @@ public static class Builder { @Nullable Object[] alternatingKeysAndValues; int size; boolean entriesUsed; + /** * If non-null, a duplicate key we found in a previous buildKeepingLast() or buildOrThrow() * call. A later buildOrThrow() can simply report this duplicate immediately. diff --git a/android/guava/src/com/google/common/collect/ImmutableMultiset.java b/android/guava/src/com/google/common/collect/ImmutableMultiset.java index 66b7f67cd213..c261fe3e5220 100644 --- a/android/guava/src/com/google/common/collect/ImmutableMultiset.java +++ b/android/guava/src/com/google/common/collect/ImmutableMultiset.java @@ -344,7 +344,9 @@ public String toString() { return entrySet().toString(); } - /** @since 21.0 (present with return type {@code Set} since 2.0) */ + /** + * @since 21.0 (present with return type {@code Set} since 2.0) + */ @Override public abstract ImmutableSet elementSet(); @@ -478,6 +480,7 @@ public static class Builder extends ImmutableCollection.Builder { * modifications, or we'll modify the already-built ImmutableMultiset. */ boolean buildInvoked = false; + /** * In the event of a setCount(elem, 0) call, we may need to remove elements, which destroys the * insertion order property of ObjectCountHashMap. In that event, we need to convert to a diff --git a/android/guava/src/com/google/common/collect/ImmutableSet.java b/android/guava/src/com/google/common/collect/ImmutableSet.java index 73b434b6d321..c004120a3232 100644 --- a/android/guava/src/com/google/common/collect/ImmutableSet.java +++ b/android/guava/src/com/google/common/collect/ImmutableSet.java @@ -205,8 +205,7 @@ private static ImmutableSet construct(int n, @Nullable Object... elements // Resize the table when the array includes too many duplicates. return construct(uniques, elements); } else { - @Nullable - Object[] uniqueElements = + @Nullable Object[] uniqueElements = shouldTrim(uniques, elements.length) ? Arrays.copyOf(elements, uniques) : elements; return new RegularImmutableSet(uniqueElements, hashCode, table, mask, uniques); } @@ -609,8 +608,7 @@ public ImmutableSet build() { default: ImmutableSet result; if (hashTable != null && chooseTableSize(size) == hashTable.length) { - @Nullable - Object[] uniqueElements = + @Nullable Object[] uniqueElements = shouldTrim(size, contents.length) ? Arrays.copyOf(contents, size) : contents; result = new RegularImmutableSet( diff --git a/android/guava/src/com/google/common/collect/ImmutableSortedSet.java b/android/guava/src/com/google/common/collect/ImmutableSortedSet.java index e3bda319a9d6..7085eb0b25b3 100644 --- a/android/guava/src/com/google/common/collect/ImmutableSortedSet.java +++ b/android/guava/src/com/google/common/collect/ImmutableSortedSet.java @@ -586,7 +586,9 @@ public ImmutableSortedSet headSet(E toElement) { return headSet(toElement, false); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @Override public ImmutableSortedSet headSet(E toElement, boolean inclusive) { return headSetImpl(checkNotNull(toElement), inclusive); @@ -609,7 +611,9 @@ public ImmutableSortedSet subSet(E fromElement, E toElement) { return subSet(fromElement, true, toElement, false); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public ImmutableSortedSet subSet( @@ -635,7 +639,9 @@ public ImmutableSortedSet tailSet(E fromElement) { return tailSet(fromElement, true); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @Override public ImmutableSortedSet tailSet(E fromElement, boolean inclusive) { return tailSetImpl(checkNotNull(fromElement), inclusive); @@ -732,7 +738,9 @@ public E last() { @LazyInit transient @Nullable ImmutableSortedSet descendingSet; - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public ImmutableSortedSet descendingSet() { @@ -751,7 +759,9 @@ public ImmutableSortedSet descendingSet() { @GwtIncompatible // NavigableSet abstract ImmutableSortedSet createDescendingSet(); - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public abstract UnmodifiableIterator descendingIterator(); diff --git a/android/guava/src/com/google/common/collect/LinkedHashMultimap.java b/android/guava/src/com/google/common/collect/LinkedHashMultimap.java index 11ef8138b6ae..9f4b08914d8e 100644 --- a/android/guava/src/com/google/common/collect/LinkedHashMultimap.java +++ b/android/guava/src/com/google/common/collect/LinkedHashMultimap.java @@ -373,8 +373,7 @@ final class ValueSet extends Sets.ImprovedAbstractSet implements ValueSetLink int tableSize = Hashing.closedTableSize(expectedValues, VALUE_SET_LOAD_FACTOR); @SuppressWarnings({"rawtypes", "unchecked"}) - @Nullable - ValueEntry[] hashTable = new @Nullable ValueEntry[tableSize]; + @Nullable ValueEntry[] hashTable = new @Nullable ValueEntry[tableSize]; this.hashTable = hashTable; } diff --git a/android/guava/src/com/google/common/collect/Lists.java b/android/guava/src/com/google/common/collect/Lists.java index e237fd758563..7f252d519d6c 100644 --- a/android/guava/src/com/google/common/collect/Lists.java +++ b/android/guava/src/com/google/common/collect/Lists.java @@ -332,7 +332,9 @@ static int computeArrayListCapacity(int arraySize) { return new TwoPlusArrayList<>(first, second, rest); } - /** @see Lists#asList(Object, Object[]) */ + /** + * @see Lists#asList(Object, Object[]) + */ private static class OnePlusArrayList extends AbstractList implements Serializable, RandomAccess { @ParametricNullness final E first; @@ -359,7 +361,9 @@ public E get(int index) { @J2ktIncompatible private static final long serialVersionUID = 0; } - /** @see Lists#asList(Object, Object, Object[]) */ + /** + * @see Lists#asList(Object, Object, Object[]) + */ private static class TwoPlusArrayList extends AbstractList implements Serializable, RandomAccess { @ParametricNullness final E first; diff --git a/android/guava/src/com/google/common/collect/Multimaps.java b/android/guava/src/com/google/common/collect/Multimaps.java index 98c89e27f429..26c9fc92d7b6 100644 --- a/android/guava/src/com/google/common/collect/Multimaps.java +++ b/android/guava/src/com/google/common/collect/Multimaps.java @@ -1130,7 +1130,9 @@ Map> asMap(Multimap multimap) { return new MapMultimap<>(map); } - /** @see Multimaps#forMap */ + /** + * @see Multimaps#forMap + */ private static class MapMultimap extends AbstractMultimap implements SetMultimap, Serializable { final Map map; diff --git a/android/guava/src/com/google/common/collect/RegularImmutableList.java b/android/guava/src/com/google/common/collect/RegularImmutableList.java index 9839c420c8d0..2f167282a143 100644 --- a/android/guava/src/com/google/common/collect/RegularImmutableList.java +++ b/android/guava/src/com/google/common/collect/RegularImmutableList.java @@ -56,8 +56,7 @@ boolean isPartialView() { } @Override - @Nullable - Object[] internalArray() { + @Nullable Object[] internalArray() { return array; } diff --git a/android/guava/src/com/google/common/collect/RegularImmutableSet.java b/android/guava/src/com/google/common/collect/RegularImmutableSet.java index 765e5ce6805d..b62931a2e302 100644 --- a/android/guava/src/com/google/common/collect/RegularImmutableSet.java +++ b/android/guava/src/com/google/common/collect/RegularImmutableSet.java @@ -85,8 +85,7 @@ public UnmodifiableIterator iterator() { } @Override - @Nullable - Object[] internalArray() { + @Nullable Object[] internalArray() { return elements; } diff --git a/android/guava/src/com/google/common/collect/TreeMultimap.java b/android/guava/src/com/google/common/collect/TreeMultimap.java index 89b106a1a316..a7b729b90da8 100644 --- a/android/guava/src/com/google/common/collect/TreeMultimap.java +++ b/android/guava/src/com/google/common/collect/TreeMultimap.java @@ -164,7 +164,9 @@ public Comparator valueComparator() { return valueComparator; } - /** @since 14.0 (present with return type {@code SortedSet} since 2.0) */ + /** + * @since 14.0 (present with return type {@code SortedSet} since 2.0) + */ @Override @GwtIncompatible // NavigableSet public NavigableSet get(@ParametricNullness K key) { diff --git a/android/guava/src/com/google/common/eventbus/SubscriberExceptionContext.java b/android/guava/src/com/google/common/eventbus/SubscriberExceptionContext.java index c7a755b09407..f6beaad511d7 100644 --- a/android/guava/src/com/google/common/eventbus/SubscriberExceptionContext.java +++ b/android/guava/src/com/google/common/eventbus/SubscriberExceptionContext.java @@ -52,17 +52,23 @@ public EventBus getEventBus() { return eventBus; } - /** @return The event object that caused the subscriber to throw. */ + /** + * @return The event object that caused the subscriber to throw. + */ public Object getEvent() { return event; } - /** @return The object context that the subscriber was called on. */ + /** + * @return The object context that the subscriber was called on. + */ public Object getSubscriber() { return subscriber; } - /** @return The subscribed method that threw the exception. */ + /** + * @return The subscribed method that threw the exception. + */ public Method getSubscriberMethod() { return subscriberMethod; } diff --git a/android/guava/src/com/google/common/eventbus/SubscriberExceptionHandler.java b/android/guava/src/com/google/common/eventbus/SubscriberExceptionHandler.java index 47b6f014dbf4..c239ad74fc87 100644 --- a/android/guava/src/com/google/common/eventbus/SubscriberExceptionHandler.java +++ b/android/guava/src/com/google/common/eventbus/SubscriberExceptionHandler.java @@ -14,7 +14,6 @@ package com.google.common.eventbus; - /** * Handler for exceptions thrown by event subscribers. * diff --git a/android/guava/src/com/google/common/graph/DirectedGraphConnections.java b/android/guava/src/com/google/common/graph/DirectedGraphConnections.java index 43b69d137b0d..5864835cb476 100644 --- a/android/guava/src/com/google/common/graph/DirectedGraphConnections.java +++ b/android/guava/src/com/google/common/graph/DirectedGraphConnections.java @@ -169,10 +169,10 @@ static DirectedGraphConnections of(ElementOrder incidentEdgeOrde } return new DirectedGraphConnections<>( - /* adjacentNodeValues = */ new HashMap(initialCapacity, INNER_LOAD_FACTOR), + /* adjacentNodeValues= */ new HashMap(initialCapacity, INNER_LOAD_FACTOR), orderedNodeConnections, - /* predecessorCount = */ 0, - /* successorCount = */ 0); + /* predecessorCount= */ 0, + /* successorCount= */ 0); } static DirectedGraphConnections ofImmutable( diff --git a/android/guava/src/com/google/common/graph/GraphConstants.java b/android/guava/src/com/google/common/graph/GraphConstants.java index f0e9013444cb..8ede199e5a29 100644 --- a/android/guava/src/com/google/common/graph/GraphConstants.java +++ b/android/guava/src/com/google/common/graph/GraphConstants.java @@ -16,7 +16,6 @@ package com.google.common.graph; - /** A utility class to hold various constants used by the Guava Graph library. */ final class GraphConstants { diff --git a/android/guava/src/com/google/common/graph/ValueGraphBuilder.java b/android/guava/src/com/google/common/graph/ValueGraphBuilder.java index 65658b951355..0d32004b2707 100644 --- a/android/guava/src/com/google/common/graph/ValueGraphBuilder.java +++ b/android/guava/src/com/google/common/graph/ValueGraphBuilder.java @@ -181,6 +181,7 @@ public ValueGraphBuilder incidentEdgeOrder( newBuilder.incidentEdgeOrder = checkNotNull(incidentEdgeOrder); return newBuilder; } + /** * Returns an empty {@link MutableValueGraph} with the properties of this {@link * ValueGraphBuilder}. diff --git a/android/guava/src/com/google/common/hash/LongAddable.java b/android/guava/src/com/google/common/hash/LongAddable.java index 75e64335c1b0..a95eece2e1ff 100644 --- a/android/guava/src/com/google/common/hash/LongAddable.java +++ b/android/guava/src/com/google/common/hash/LongAddable.java @@ -14,7 +14,6 @@ package com.google.common.hash; - /** * Abstract interface for objects that can concurrently add longs. * diff --git a/android/guava/src/com/google/common/io/LineBuffer.java b/android/guava/src/com/google/common/io/LineBuffer.java index 83029d5183f3..ab376ee570a0 100644 --- a/android/guava/src/com/google/common/io/LineBuffer.java +++ b/android/guava/src/com/google/common/io/LineBuffer.java @@ -35,6 +35,7 @@ abstract class LineBuffer { /** Holds partial line contents. */ private StringBuilder line = new StringBuilder(); + /** Whether a line ending with a CR is pending processing. */ private boolean sawReturn; diff --git a/android/guava/src/com/google/common/io/ReaderInputStream.java b/android/guava/src/com/google/common/io/ReaderInputStream.java index 3a804b170de8..386bad6f3397 100644 --- a/android/guava/src/com/google/common/io/ReaderInputStream.java +++ b/android/guava/src/com/google/common/io/ReaderInputStream.java @@ -67,8 +67,10 @@ final class ReaderInputStream extends InputStream { /** Whether we've finished reading the reader. */ private boolean endOfInput; + /** Whether we're copying encoded bytes to the caller's buffer. */ private boolean draining; + /** Whether we've successfully flushed the encoder. */ private boolean doneFlushing; diff --git a/android/guava/src/com/google/common/math/BigIntegerMath.java b/android/guava/src/com/google/common/math/BigIntegerMath.java index 204ac38874d9..7220596ae3a9 100644 --- a/android/guava/src/com/google/common/math/BigIntegerMath.java +++ b/android/guava/src/com/google/common/math/BigIntegerMath.java @@ -185,7 +185,7 @@ public static int log10(BigInteger x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(floorCmp == 0); - // fall through + // fall through case FLOOR: case DOWN: return floorLog; diff --git a/android/guava/src/com/google/common/math/DoubleMath.java b/android/guava/src/com/google/common/math/DoubleMath.java index 5729f829826f..86ac100efc8c 100644 --- a/android/guava/src/com/google/common/math/DoubleMath.java +++ b/android/guava/src/com/google/common/math/DoubleMath.java @@ -251,7 +251,7 @@ public static int log2(double x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(isPowerOfTwo(x)); - // fall through + // fall through case FLOOR: increment = false; break; diff --git a/android/guava/src/com/google/common/math/IntMath.java b/android/guava/src/com/google/common/math/IntMath.java index 44c7d67accf6..ad2323a60988 100644 --- a/android/guava/src/com/google/common/math/IntMath.java +++ b/android/guava/src/com/google/common/math/IntMath.java @@ -117,7 +117,7 @@ public static int log2(int x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(isPowerOfTwo(x)); - // fall through + // fall through case DOWN: case FLOOR: return (Integer.SIZE - 1) - Integer.numberOfLeadingZeros(x); @@ -158,7 +158,7 @@ public static int log10(int x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(x == floorPow); - // fall through + // fall through case FLOOR: case DOWN: return logFloor; @@ -331,7 +331,7 @@ public static int divide(int p, int q, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(rem == 0); - // fall through + // fall through case DOWN: increment = false; break; diff --git a/android/guava/src/com/google/common/math/LongMath.java b/android/guava/src/com/google/common/math/LongMath.java index 31907d66adbd..b83fa1bede1d 100644 --- a/android/guava/src/com/google/common/math/LongMath.java +++ b/android/guava/src/com/google/common/math/LongMath.java @@ -119,7 +119,7 @@ public static int log2(long x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(isPowerOfTwo(x)); - // fall through + // fall through case DOWN: case FLOOR: return (Long.SIZE - 1) - Long.numberOfLeadingZeros(x); @@ -161,7 +161,7 @@ public static int log10(long x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(x == floorPow); - // fall through + // fall through case FLOOR: case DOWN: return logFloor; @@ -394,7 +394,7 @@ public static long divide(long p, long q, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(rem == 0); - // fall through + // fall through case DOWN: increment = false; break; @@ -958,6 +958,7 @@ static long multiplyFraction(long x, long numerator, long denominator) { 61, 61 }; + // These values were generated by using checkedMultiply to see when the simple multiply/divide // algorithm would lead to an overflow. diff --git a/android/guava/src/com/google/common/net/HttpHeaders.java b/android/guava/src/com/google/common/net/HttpHeaders.java index df6ac99c39c8..4d2c0d0f5df4 100644 --- a/android/guava/src/com/google/common/net/HttpHeaders.java +++ b/android/guava/src/com/google/common/net/HttpHeaders.java @@ -38,16 +38,22 @@ private HttpHeaders() {} /** The HTTP {@code Cache-Control} header field name. */ public static final String CACHE_CONTROL = "Cache-Control"; + /** The HTTP {@code Content-Length} header field name. */ public static final String CONTENT_LENGTH = "Content-Length"; + /** The HTTP {@code Content-Type} header field name. */ public static final String CONTENT_TYPE = "Content-Type"; + /** The HTTP {@code Date} header field name. */ public static final String DATE = "Date"; + /** The HTTP {@code Pragma} header field name. */ public static final String PRAGMA = "Pragma"; + /** The HTTP {@code Via} header field name. */ public static final String VIA = "Via"; + /** The HTTP {@code Warning} header field name. */ public static final String WARNING = "Warning"; @@ -55,22 +61,31 @@ private HttpHeaders() {} /** The HTTP {@code Accept} header field name. */ public static final String ACCEPT = "Accept"; + /** The HTTP {@code Accept-Charset} header field name. */ public static final String ACCEPT_CHARSET = "Accept-Charset"; + /** The HTTP {@code Accept-Encoding} header field name. */ public static final String ACCEPT_ENCODING = "Accept-Encoding"; + /** The HTTP {@code Accept-Language} header field name. */ public static final String ACCEPT_LANGUAGE = "Accept-Language"; + /** The HTTP {@code Access-Control-Request-Headers} header field name. */ public static final String ACCESS_CONTROL_REQUEST_HEADERS = "Access-Control-Request-Headers"; + /** The HTTP {@code Access-Control-Request-Method} header field name. */ public static final String ACCESS_CONTROL_REQUEST_METHOD = "Access-Control-Request-Method"; + /** The HTTP {@code Authorization} header field name. */ public static final String AUTHORIZATION = "Authorization"; + /** The HTTP {@code Connection} header field name. */ public static final String CONNECTION = "Connection"; + /** The HTTP {@code Cookie} header field name. */ public static final String COOKIE = "Cookie"; + /** * The HTTP {@code * Cross-Origin-Resource-Policy} header field name. @@ -89,6 +104,7 @@ private HttpHeaders() {} /** The HTTP {@code Expect} header field name. */ public static final String EXPECT = "Expect"; + /** The HTTP {@code From} header field name. */ public static final String FROM = "From"; @@ -106,6 +122,7 @@ private HttpHeaders() {} * @since 17.0 */ public static final String FOLLOW_ONLY_WHEN_PRERENDER_SHOWN = "Follow-Only-When-Prerender-Shown"; + /** The HTTP {@code Host} header field name. */ public static final String HOST = "Host"; @@ -119,20 +136,28 @@ private HttpHeaders() {} /** The HTTP {@code If-Match} header field name. */ public static final String IF_MATCH = "If-Match"; + /** The HTTP {@code If-Modified-Since} header field name. */ public static final String IF_MODIFIED_SINCE = "If-Modified-Since"; + /** The HTTP {@code If-None-Match} header field name. */ public static final String IF_NONE_MATCH = "If-None-Match"; + /** The HTTP {@code If-Range} header field name. */ public static final String IF_RANGE = "If-Range"; + /** The HTTP {@code If-Unmodified-Since} header field name. */ public static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since"; + /** The HTTP {@code Last-Event-ID} header field name. */ public static final String LAST_EVENT_ID = "Last-Event-ID"; + /** The HTTP {@code Max-Forwards} header field name. */ public static final String MAX_FORWARDS = "Max-Forwards"; + /** The HTTP {@code Origin} header field name. */ public static final String ORIGIN = "Origin"; + /** * The HTTP {@code Origin-Isolation} header * field name. @@ -140,12 +165,16 @@ private HttpHeaders() {} * @since 30.1 */ public static final String ORIGIN_ISOLATION = "Origin-Isolation"; + /** The HTTP {@code Proxy-Authorization} header field name. */ public static final String PROXY_AUTHORIZATION = "Proxy-Authorization"; + /** The HTTP {@code Range} header field name. */ public static final String RANGE = "Range"; + /** The HTTP {@code Referer} header field name. */ public static final String REFERER = "Referer"; + /** * The HTTP {@code Referrer-Policy} header * field name. @@ -180,10 +209,13 @@ private ReferrerPolicyValues() {} * @since 20.0 */ public static final String SERVICE_WORKER = "Service-Worker"; + /** The HTTP {@code TE} header field name. */ public static final String TE = "TE"; + /** The HTTP {@code Upgrade} header field name. */ public static final String UPGRADE = "Upgrade"; + /** * The HTTP {@code * Upgrade-Insecure-Requests} header field name. @@ -199,12 +231,16 @@ private ReferrerPolicyValues() {} /** The HTTP {@code Accept-Ranges} header field name. */ public static final String ACCEPT_RANGES = "Accept-Ranges"; + /** The HTTP {@code Access-Control-Allow-Headers} header field name. */ public static final String ACCESS_CONTROL_ALLOW_HEADERS = "Access-Control-Allow-Headers"; + /** The HTTP {@code Access-Control-Allow-Methods} header field name. */ public static final String ACCESS_CONTROL_ALLOW_METHODS = "Access-Control-Allow-Methods"; + /** The HTTP {@code Access-Control-Allow-Origin} header field name. */ public static final String ACCESS_CONTROL_ALLOW_ORIGIN = "Access-Control-Allow-Origin"; + /** * The HTTP {@code * Access-Control-Allow-Private-Network} header field name. @@ -213,28 +249,40 @@ private ReferrerPolicyValues() {} */ public static final String ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK = "Access-Control-Allow-Private-Network"; + /** The HTTP {@code Access-Control-Allow-Credentials} header field name. */ public static final String ACCESS_CONTROL_ALLOW_CREDENTIALS = "Access-Control-Allow-Credentials"; + /** The HTTP {@code Access-Control-Expose-Headers} header field name. */ public static final String ACCESS_CONTROL_EXPOSE_HEADERS = "Access-Control-Expose-Headers"; + /** The HTTP {@code Access-Control-Max-Age} header field name. */ public static final String ACCESS_CONTROL_MAX_AGE = "Access-Control-Max-Age"; + /** The HTTP {@code Age} header field name. */ public static final String AGE = "Age"; + /** The HTTP {@code Allow} header field name. */ public static final String ALLOW = "Allow"; + /** The HTTP {@code Content-Disposition} header field name. */ public static final String CONTENT_DISPOSITION = "Content-Disposition"; + /** The HTTP {@code Content-Encoding} header field name. */ public static final String CONTENT_ENCODING = "Content-Encoding"; + /** The HTTP {@code Content-Language} header field name. */ public static final String CONTENT_LANGUAGE = "Content-Language"; + /** The HTTP {@code Content-Location} header field name. */ public static final String CONTENT_LOCATION = "Content-Location"; + /** The HTTP {@code Content-MD5} header field name. */ public static final String CONTENT_MD5 = "Content-MD5"; + /** The HTTP {@code Content-Range} header field name. */ public static final String CONTENT_RANGE = "Content-Range"; + /** * The HTTP {@code * Content-Security-Policy} header field name. @@ -242,6 +290,7 @@ private ReferrerPolicyValues() {} * @since 15.0 */ public static final String CONTENT_SECURITY_POLICY = "Content-Security-Policy"; + /** * The HTTP * {@code Content-Security-Policy-Report-Only} header field name. @@ -250,6 +299,7 @@ private ReferrerPolicyValues() {} */ public static final String CONTENT_SECURITY_POLICY_REPORT_ONLY = "Content-Security-Policy-Report-Only"; + /** * The HTTP nonstandard {@code X-Content-Security-Policy} header field name. It was introduced in * CSP v.1 and used by the Firefox until @@ -259,6 +309,7 @@ private ReferrerPolicyValues() {} * @since 20.0 */ public static final String X_CONTENT_SECURITY_POLICY = "X-Content-Security-Policy"; + /** * The HTTP nonstandard {@code X-Content-Security-Policy-Report-Only} header field name. It was * introduced in CSP v.1 and used by the @@ -269,6 +320,7 @@ private ReferrerPolicyValues() {} */ public static final String X_CONTENT_SECURITY_POLICY_REPORT_ONLY = "X-Content-Security-Policy-Report-Only"; + /** * The HTTP nonstandard {@code X-WebKit-CSP} header field name. It was introduced in CSP v.1 and used by the Chrome until @@ -277,6 +329,7 @@ private ReferrerPolicyValues() {} * @since 20.0 */ public static final String X_WEBKIT_CSP = "X-WebKit-CSP"; + /** * The HTTP nonstandard {@code X-WebKit-CSP-Report-Only} header field name. It was introduced in * CSP v.1 and used by the Chrome until @@ -285,6 +338,7 @@ private ReferrerPolicyValues() {} * @since 20.0 */ public static final String X_WEBKIT_CSP_REPORT_ONLY = "X-WebKit-CSP-Report-Only"; + /** * The HTTP {@code * Cross-Origin-Embedder-Policy} header field name. @@ -292,6 +346,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String CROSS_ORIGIN_EMBEDDER_POLICY = "Cross-Origin-Embedder-Policy"; + /** * The HTTP {@code * Cross-Origin-Embedder-Policy-Report-Only} header field name. @@ -300,28 +355,36 @@ private ReferrerPolicyValues() {} */ public static final String CROSS_ORIGIN_EMBEDDER_POLICY_REPORT_ONLY = "Cross-Origin-Embedder-Policy-Report-Only"; + /** * The HTTP Cross-Origin-Opener-Policy header field name. * * @since 28.2 */ public static final String CROSS_ORIGIN_OPENER_POLICY = "Cross-Origin-Opener-Policy"; + /** The HTTP {@code ETag} header field name. */ public static final String ETAG = "ETag"; + /** The HTTP {@code Expires} header field name. */ public static final String EXPIRES = "Expires"; + /** The HTTP {@code Last-Modified} header field name. */ public static final String LAST_MODIFIED = "Last-Modified"; + /** The HTTP {@code Link} header field name. */ public static final String LINK = "Link"; + /** The HTTP {@code Location} header field name. */ public static final String LOCATION = "Location"; + /** * The HTTP {@code Keep-Alive} header field name. * * @since 31.0 */ public static final String KEEP_ALIVE = "Keep-Alive"; + /** * The HTTP {@code * No-Vary-Seearch} header field name. @@ -329,6 +392,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String NO_VARY_SEARCH = "No-Vary-Search"; + /** * The HTTP {@code Origin-Trial} * header field name. @@ -336,22 +400,29 @@ private ReferrerPolicyValues() {} * @since 27.1 */ public static final String ORIGIN_TRIAL = "Origin-Trial"; + /** The HTTP {@code P3P} header field name. Limited browser support. */ public static final String P3P = "P3P"; + /** The HTTP {@code Proxy-Authenticate} header field name. */ public static final String PROXY_AUTHENTICATE = "Proxy-Authenticate"; + /** The HTTP {@code Refresh} header field name. Non-standard header supported by most browsers. */ public static final String REFRESH = "Refresh"; + /** * The HTTP {@code Report-To} header field name. * * @since 27.1 */ public static final String REPORT_TO = "Report-To"; + /** The HTTP {@code Retry-After} header field name. */ public static final String RETRY_AFTER = "Retry-After"; + /** The HTTP {@code Server} header field name. */ public static final String SERVER = "Server"; + /** * The HTTP {@code Server-Timing} header field * name. @@ -359,6 +430,7 @@ private ReferrerPolicyValues() {} * @since 23.6 */ public static final String SERVER_TIMING = "Server-Timing"; + /** * The HTTP {@code * Service-Worker-Allowed} header field name. @@ -366,8 +438,10 @@ private ReferrerPolicyValues() {} * @since 20.0 */ public static final String SERVICE_WORKER_ALLOWED = "Service-Worker-Allowed"; + /** The HTTP {@code Set-Cookie} header field name. */ public static final String SET_COOKIE = "Set-Cookie"; + /** The HTTP {@code Set-Cookie2} header field name. */ public static final String SET_COOKIE2 = "Set-Cookie2"; @@ -396,6 +470,7 @@ private ReferrerPolicyValues() {} * @since 15.0 */ public static final String STRICT_TRANSPORT_SECURITY = "Strict-Transport-Security"; + /** * The HTTP {@code * Timing-Allow-Origin} header field name. @@ -403,12 +478,16 @@ private ReferrerPolicyValues() {} * @since 15.0 */ public static final String TIMING_ALLOW_ORIGIN = "Timing-Allow-Origin"; + /** The HTTP {@code Trailer} header field name. */ public static final String TRAILER = "Trailer"; + /** The HTTP {@code Transfer-Encoding} header field name. */ public static final String TRANSFER_ENCODING = "Transfer-Encoding"; + /** The HTTP {@code Vary} header field name. */ public static final String VARY = "Vary"; + /** The HTTP {@code WWW-Authenticate} header field name. */ public static final String WWW_AUTHENTICATE = "WWW-Authenticate"; @@ -416,8 +495,10 @@ private ReferrerPolicyValues() {} /** The HTTP {@code DNT} header field name. */ public static final String DNT = "DNT"; + /** The HTTP {@code X-Content-Type-Options} header field name. */ public static final String X_CONTENT_TYPE_OPTIONS = "X-Content-Type-Options"; + /** * The HTTP {@code @@ -427,6 +508,7 @@ private ReferrerPolicyValues() {} * @since 31.0 */ public static final String X_DEVICE_IP = "X-Device-IP"; + /** * The HTTP {@code @@ -437,6 +519,7 @@ private ReferrerPolicyValues() {} * @since 31.0 */ public static final String X_DEVICE_REFERER = "X-Device-Referer"; + /** * The HTTP {@code @@ -447,6 +530,7 @@ private ReferrerPolicyValues() {} * @since 31.0 */ public static final String X_DEVICE_ACCEPT_LANGUAGE = "X-Device-Accept-Language"; + /** * The HTTP {@code @@ -457,10 +541,13 @@ private ReferrerPolicyValues() {} * @since 31.0 */ public static final String X_DEVICE_REQUESTED_WITH = "X-Device-Requested-With"; + /** The HTTP {@code X-Do-Not-Track} header field name. */ public static final String X_DO_NOT_TRACK = "X-Do-Not-Track"; + /** The HTTP {@code X-Forwarded-For} header field name (superseded by {@code Forwarded}). */ public static final String X_FORWARDED_FOR = "X-Forwarded-For"; + /** The HTTP {@code X-Forwarded-Proto} header field name. */ public static final String X_FORWARDED_PROTO = "X-Forwarded-Proto"; @@ -484,8 +571,10 @@ private ReferrerPolicyValues() {} /** The HTTP {@code X-Frame-Options} header field name. */ public static final String X_FRAME_OPTIONS = "X-Frame-Options"; + /** The HTTP {@code X-Powered-By} header field name. */ public static final String X_POWERED_BY = "X-Powered-By"; + /** * The HTTP {@code * Public-Key-Pins} header field name. @@ -493,6 +582,7 @@ private ReferrerPolicyValues() {} * @since 15.0 */ public static final String PUBLIC_KEY_PINS = "Public-Key-Pins"; + /** * The HTTP {@code * Public-Key-Pins-Report-Only} header field name. @@ -500,14 +590,17 @@ private ReferrerPolicyValues() {} * @since 15.0 */ public static final String PUBLIC_KEY_PINS_REPORT_ONLY = "Public-Key-Pins-Report-Only"; + /** * The HTTP {@code X-Request-ID} header field name. * * @since 30.1 */ public static final String X_REQUEST_ID = "X-Request-ID"; + /** The HTTP {@code X-Requested-With} header field name. */ public static final String X_REQUESTED_WITH = "X-Requested-With"; + /** The HTTP {@code X-User-IP} header field name. */ public static final String X_USER_IP = "X-User-IP"; @@ -526,6 +619,7 @@ private ReferrerPolicyValues() {} /** The HTTP {@code X-XSS-Protection} header field name. */ public static final String X_XSS_PROTECTION = "X-XSS-Protection"; + /** * The HTTP {@code @@ -533,6 +627,7 @@ private ReferrerPolicyValues() {} * By default, DNS prefetching is "on" for HTTP pages and "off" for HTTPS pages. */ public static final String X_DNS_PREFETCH_CONTROL = "X-DNS-Prefetch-Control"; + /** * The HTTP * {@code Ping-From} header field name. @@ -540,6 +635,7 @@ private ReferrerPolicyValues() {} * @since 19.0 */ public static final String PING_FROM = "Ping-From"; + /** * The HTTP * {@code Ping-To} header field name. @@ -556,6 +652,7 @@ private ReferrerPolicyValues() {} * @since 28.0 */ public static final String PURPOSE = "Purpose"; + /** * The HTTP {@code @@ -564,6 +661,7 @@ private ReferrerPolicyValues() {} * @since 28.0 */ public static final String X_PURPOSE = "X-Purpose"; + /** * The HTTP {@code @@ -667,6 +765,7 @@ private ReferrerPolicyValues() {} * @since 31.0 */ public static final String ACCEPT_CH = "Accept-CH"; + /** * The HTTP {@code @@ -683,6 +782,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA = "Sec-CH-UA"; + /** * The HTTP {@code * Sec-CH-UA-Arch} header field name. @@ -690,6 +790,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA_ARCH = "Sec-CH-UA-Arch"; + /** * The HTTP {@code * Sec-CH-UA-Model} header field name. @@ -697,6 +798,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA_MODEL = "Sec-CH-UA-Model"; + /** * The HTTP {@code * Sec-CH-UA-Platform} header field name. @@ -704,6 +806,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA_PLATFORM = "Sec-CH-UA-Platform"; + /** * The HTTP {@code * Sec-CH-UA-Platform-Version} header field name. @@ -711,6 +814,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA_PLATFORM_VERSION = "Sec-CH-UA-Platform-Version"; + /** * The HTTP {@code * Sec-CH-UA-Full-Version} header field name. @@ -719,6 +823,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ @Deprecated public static final String SEC_CH_UA_FULL_VERSION = "Sec-CH-UA-Full-Version"; + /** * The HTTP {@code * Sec-CH-UA-Full-Version} header field name. @@ -726,6 +831,7 @@ private ReferrerPolicyValues() {} * @since 31.1 */ public static final String SEC_CH_UA_FULL_VERSION_LIST = "Sec-CH-UA-Full-Version-List"; + /** * The HTTP {@code * Sec-CH-UA-Mobile} header field name. @@ -733,6 +839,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA_MOBILE = "Sec-CH-UA-Mobile"; + /** * The HTTP {@code * Sec-CH-UA-WoW64} header field name. @@ -740,6 +847,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String SEC_CH_UA_WOW64 = "Sec-CH-UA-WoW64"; + /** * The HTTP {@code * Sec-CH-UA-Bitness} header field name. @@ -773,6 +881,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String SEC_CH_VIEWPORT_WIDTH = "Sec-CH-Viewport-Width"; + /** * The HTTP {@code @@ -781,6 +890,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String SEC_CH_VIEWPORT_HEIGHT = "Sec-CH-Viewport-Height"; + /** * The HTTP {@code * Sec-CH-DPR} header field name. @@ -788,6 +898,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String SEC_CH_DPR = "Sec-CH-DPR"; + /** * The HTTP {@code Sec-Fetch-Dest} * header field name. @@ -795,6 +906,7 @@ private ReferrerPolicyValues() {} * @since 27.1 */ public static final String SEC_FETCH_DEST = "Sec-Fetch-Dest"; + /** * The HTTP {@code Sec-Fetch-Mode} * header field name. @@ -802,6 +914,7 @@ private ReferrerPolicyValues() {} * @since 27.1 */ public static final String SEC_FETCH_MODE = "Sec-Fetch-Mode"; + /** * The HTTP {@code Sec-Fetch-Site} * header field name. @@ -809,6 +922,7 @@ private ReferrerPolicyValues() {} * @since 27.1 */ public static final String SEC_FETCH_SITE = "Sec-Fetch-Site"; + /** * The HTTP {@code Sec-Fetch-User} * header field name. @@ -816,6 +930,7 @@ private ReferrerPolicyValues() {} * @since 27.1 */ public static final String SEC_FETCH_USER = "Sec-Fetch-User"; + /** * The HTTP {@code Sec-Metadata} * header field name. @@ -895,6 +1010,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String SEC_BROWSING_TOPICS = "Sec-Browsing-Topics"; + /** * The HTTP {@code * Observe-Browsing-Topics} header field name. diff --git a/android/guava/src/com/google/common/net/InetAddresses.java b/android/guava/src/com/google/common/net/InetAddresses.java index 4cb146ca0c25..bbfb1e5367d8 100644 --- a/android/guava/src/com/google/common/net/InetAddresses.java +++ b/android/guava/src/com/google/common/net/InetAddresses.java @@ -1094,6 +1094,7 @@ public static Inet4Address fromInteger(int address) { public static Inet4Address fromIPv4BigInteger(BigInteger address) { return (Inet4Address) fromBigInteger(address, false); } + /** * Returns the {@code Inet6Address} corresponding to a given {@code BigInteger}. * diff --git a/android/guava/src/com/google/common/reflect/Parameter.java b/android/guava/src/com/google/common/reflect/Parameter.java index d0492bf54d9f..8f4bca276225 100644 --- a/android/guava/src/com/google/common/reflect/Parameter.java +++ b/android/guava/src/com/google/common/reflect/Parameter.java @@ -96,7 +96,9 @@ public A[] getAnnotationsByType(Class annotationType) return getDeclaredAnnotationsByType(annotationType); } - /** @since 18.0 */ + /** + * @since 18.0 + */ @Override public Annotation[] getDeclaredAnnotations() { return annotations.toArray(new Annotation[0]); @@ -116,8 +118,8 @@ public Annotation[] getDeclaredAnnotations() { */ @Override public A[] getDeclaredAnnotationsByType(Class annotationType) { - @Nullable - A[] result = FluentIterable.from(annotations).filter(annotationType).toArray(annotationType); + @Nullable A[] result = + FluentIterable.from(annotations).filter(annotationType).toArray(annotationType); @SuppressWarnings("nullness") // safe because the input list contains no nulls A[] cast = (A[]) result; return cast; diff --git a/android/guava/src/com/google/common/util/concurrent/AbstractExecutionThreadService.java b/android/guava/src/com/google/common/util/concurrent/AbstractExecutionThreadService.java index d520a064b77f..d1dae236c13e 100644 --- a/android/guava/src/com/google/common/util/concurrent/AbstractExecutionThreadService.java +++ b/android/guava/src/com/google/common/util/concurrent/AbstractExecutionThreadService.java @@ -160,19 +160,25 @@ public final State state() { return delegate.state(); } - /** @since 13.0 */ + /** + * @since 13.0 + */ @Override public final void addListener(Listener listener, Executor executor) { delegate.addListener(listener, executor); } - /** @since 14.0 */ + /** + * @since 14.0 + */ @Override public final Throwable failureCause() { return delegate.failureCause(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service startAsync() { @@ -180,7 +186,9 @@ public final Service startAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service stopAsync() { @@ -188,25 +196,33 @@ public final Service stopAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning() { delegate.awaitRunning(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitRunning(timeout, unit); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated() { delegate.awaitTerminated(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitTerminated(timeout, unit); diff --git a/android/guava/src/com/google/common/util/concurrent/AbstractFuture.java b/android/guava/src/com/google/common/util/concurrent/AbstractFuture.java index 4bb4609e4fd7..1982fc794599 100644 --- a/android/guava/src/com/google/common/util/concurrent/AbstractFuture.java +++ b/android/guava/src/com/google/common/util/concurrent/AbstractFuture.java @@ -780,7 +780,7 @@ public void addListener(Runnable listener, Executor executor) { protected boolean set(@ParametricNullness V value) { Object valueToSet = value == null ? NULL : value; if (ATOMIC_HELPER.casValue(this, null, valueToSet)) { - complete(this, /*callInterruptTask=*/ false); + complete(this, /* callInterruptTask= */ false); return true; } return false; @@ -805,7 +805,7 @@ protected boolean set(@ParametricNullness V value) { protected boolean setException(Throwable throwable) { Object valueToSet = new Failure(checkNotNull(throwable)); if (ATOMIC_HELPER.casValue(this, null, valueToSet)) { - complete(this, /*callInterruptTask=*/ false); + complete(this, /* callInterruptTask= */ false); return true; } return false; diff --git a/android/guava/src/com/google/common/util/concurrent/AbstractIdleService.java b/android/guava/src/com/google/common/util/concurrent/AbstractIdleService.java index 882a5430fd04..a1b9e53abf82 100644 --- a/android/guava/src/com/google/common/util/concurrent/AbstractIdleService.java +++ b/android/guava/src/com/google/common/util/concurrent/AbstractIdleService.java @@ -124,19 +124,25 @@ public final State state() { return delegate.state(); } - /** @since 13.0 */ + /** + * @since 13.0 + */ @Override public final void addListener(Listener listener, Executor executor) { delegate.addListener(listener, executor); } - /** @since 14.0 */ + /** + * @since 14.0 + */ @Override public final Throwable failureCause() { return delegate.failureCause(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service startAsync() { @@ -144,7 +150,9 @@ public final Service startAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service stopAsync() { @@ -152,25 +160,33 @@ public final Service stopAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning() { delegate.awaitRunning(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitRunning(timeout, unit); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated() { delegate.awaitTerminated(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitTerminated(timeout, unit); diff --git a/android/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java b/android/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java index f0083fa4a199..d461740be33f 100644 --- a/android/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java +++ b/android/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java @@ -424,19 +424,25 @@ public final State state() { return delegate.state(); } - /** @since 13.0 */ + /** + * @since 13.0 + */ @Override public final void addListener(Listener listener, Executor executor) { delegate.addListener(listener, executor); } - /** @since 14.0 */ + /** + * @since 14.0 + */ @Override public final Throwable failureCause() { return delegate.failureCause(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service startAsync() { @@ -444,7 +450,9 @@ public final Service startAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service stopAsync() { @@ -452,25 +460,33 @@ public final Service stopAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning() { delegate.awaitRunning(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitRunning(timeout, unit); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated() { delegate.awaitTerminated(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitTerminated(timeout, unit); diff --git a/android/guava/src/com/google/common/util/concurrent/AbstractService.java b/android/guava/src/com/google/common/util/concurrent/AbstractService.java index 74ead92afd1c..7e7ef08ac477 100644 --- a/android/guava/src/com/google/common/util/concurrent/AbstractService.java +++ b/android/guava/src/com/google/common/util/concurrent/AbstractService.java @@ -479,13 +479,17 @@ public final State state() { return snapshot.externalState(); } - /** @since 14.0 */ + /** + * @since 14.0 + */ @Override public final Throwable failureCause() { return snapshot.failureCause(); } - /** @since 13.0 */ + /** + * @since 13.0 + */ @Override public final void addListener(Listener listener, Executor executor) { listeners.addListener(listener, executor); @@ -602,7 +606,9 @@ private static final class StateSnapshot { this.failure = failure; } - /** @see Service#state() */ + /** + * @see Service#state() + */ State externalState() { if (shutdownWhenStartupFinishes && state == STARTING) { return STOPPING; @@ -611,7 +617,9 @@ State externalState() { } } - /** @see Service#failureCause() */ + /** + * @see Service#failureCause() + */ Throwable failureCause() { checkState( state == FAILED, diff --git a/android/guava/src/com/google/common/util/concurrent/ClosingFuture.java b/android/guava/src/com/google/common/util/concurrent/ClosingFuture.java index 05ca0e93b237..59408e2206d3 100644 --- a/android/guava/src/com/google/common/util/concurrent/ClosingFuture.java +++ b/android/guava/src/com/google/common/util/concurrent/ClosingFuture.java @@ -1372,7 +1372,6 @@ public String toString() { : Futures.whenAllComplete(inputFutures()); } - private ImmutableList> inputFutures() { return FluentIterable.from(inputs) .>transform(future -> future.future) diff --git a/android/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java b/android/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java index 8cd223e3b669..12de35eaff01 100644 --- a/android/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java +++ b/android/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java @@ -563,10 +563,14 @@ public String getMessage() { */ private interface CycleDetectingLock { - /** @return the {@link LockGraphNode} associated with this lock. */ + /** + * @return the {@link LockGraphNode} associated with this lock. + */ LockGraphNode getLockGraphNode(); - /** @return {@code true} if the current thread has acquired this lock. */ + /** + * @return {@code true} if the current thread has acquired this lock. + */ boolean isAcquiredByCurrentThread(); } diff --git a/android/guava/src/com/google/common/util/concurrent/InterruptibleTask.java b/android/guava/src/com/google/common/util/concurrent/InterruptibleTask.java index a85abb2bc25e..9191436088ab 100644 --- a/android/guava/src/com/google/common/util/concurrent/InterruptibleTask.java +++ b/android/guava/src/com/google/common/util/concurrent/InterruptibleTask.java @@ -45,6 +45,7 @@ private static final class DoNothingRunnable implements Runnable { @Override public void run() {} } + // The thread executing the task publishes itself to the superclass' reference and the thread // interrupting sets DONE when it has finished interrupting. private static final Runnable DONE = new DoNothingRunnable(); diff --git a/android/guava/src/com/google/common/util/concurrent/ListeningScheduledExecutorService.java b/android/guava/src/com/google/common/util/concurrent/ListeningScheduledExecutorService.java index 605fa47ac4e9..e5abc6544399 100644 --- a/android/guava/src/com/google/common/util/concurrent/ListeningScheduledExecutorService.java +++ b/android/guava/src/com/google/common/util/concurrent/ListeningScheduledExecutorService.java @@ -35,21 +35,29 @@ public interface ListeningScheduledExecutorService extends ScheduledExecutorService, ListeningExecutorService { - /** @since 15.0 (previously returned ScheduledFuture) */ + /** + * @since 15.0 (previously returned ScheduledFuture) + */ @Override ListenableScheduledFuture schedule(Runnable command, long delay, TimeUnit unit); - /** @since 15.0 (previously returned ScheduledFuture) */ + /** + * @since 15.0 (previously returned ScheduledFuture) + */ @Override ListenableScheduledFuture schedule( Callable callable, long delay, TimeUnit unit); - /** @since 15.0 (previously returned ScheduledFuture) */ + /** + * @since 15.0 (previously returned ScheduledFuture) + */ @Override ListenableScheduledFuture scheduleAtFixedRate( Runnable command, long initialDelay, long period, TimeUnit unit); - /** @since 15.0 (previously returned ScheduledFuture) */ + /** + * @since 15.0 (previously returned ScheduledFuture) + */ @Override ListenableScheduledFuture scheduleWithFixedDelay( Runnable command, long initialDelay, long delay, TimeUnit unit); diff --git a/android/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java b/android/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java index 6d1bdbdd7b4f..24fcf5d489dd 100644 --- a/android/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java +++ b/android/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java @@ -205,6 +205,7 @@ abstract class SmoothRateLimiter extends RateLimiter { */ static final class SmoothWarmingUp extends SmoothRateLimiter { private final long warmupPeriodMicros; + /** * The slope of the line from the stable interval (when permits == 0), to the cold interval * (when permits == maxPermits) diff --git a/android/guava/src/com/google/common/util/concurrent/Striped.java b/android/guava/src/com/google/common/util/concurrent/Striped.java index 0ab7d43388db..3391e209b3eb 100644 --- a/android/guava/src/com/google/common/util/concurrent/Striped.java +++ b/android/guava/src/com/google/common/util/concurrent/Striped.java @@ -278,6 +278,7 @@ public static Striped readWriteLock(int stripes) { public static Striped lazyWeakReadWriteLock(int stripes) { return lazyWeakCustom(stripes, WeakSafeReadWriteLock::new); } + /** * ReadWriteLock implementation whose read and write locks retain a reference back to this lock. * Otherwise, a reference to just the read lock or just the write lock would not suffice to ensure diff --git a/android/guava/src/com/google/common/util/concurrent/TimeLimiter.java b/android/guava/src/com/google/common/util/concurrent/TimeLimiter.java index 1d3e26513210..788907a69073 100644 --- a/android/guava/src/com/google/common/util/concurrent/TimeLimiter.java +++ b/android/guava/src/com/google/common/util/concurrent/TimeLimiter.java @@ -14,7 +14,6 @@ package com.google.common.util.concurrent; - import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; diff --git a/futures/failureaccess/src/com/google/common/util/concurrent/internal/InternalFutureFailureAccess.java b/futures/failureaccess/src/com/google/common/util/concurrent/internal/InternalFutureFailureAccess.java index 96ed5184b93e..5b3e2924c2d5 100644 --- a/futures/failureaccess/src/com/google/common/util/concurrent/internal/InternalFutureFailureAccess.java +++ b/futures/failureaccess/src/com/google/common/util/concurrent/internal/InternalFutureFailureAccess.java @@ -50,5 +50,6 @@ protected InternalFutureFailureAccess() {} * InternalFutures#tryInternalFastPathGetFailure(InternalFutureFailureAccess)}. */ protected abstract - Throwable tryInternalFastPathGetFailure(); + Throwable + tryInternalFastPathGetFailure(); } diff --git a/futures/failureaccess/src/com/google/common/util/concurrent/internal/InternalFutures.java b/futures/failureaccess/src/com/google/common/util/concurrent/internal/InternalFutures.java index bfc3ac689416..99e3fb41a079 100644 --- a/futures/failureaccess/src/com/google/common/util/concurrent/internal/InternalFutures.java +++ b/futures/failureaccess/src/com/google/common/util/concurrent/internal/InternalFutures.java @@ -39,7 +39,8 @@ public final class InternalFutures { * */ public static - Throwable tryInternalFastPathGetFailure(InternalFutureFailureAccess future) { + Throwable + tryInternalFastPathGetFailure(InternalFutureFailureAccess future) { return future.tryInternalFastPathGetFailure(); } diff --git a/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Platform.java b/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Platform.java index 3efd8960d9e1..ad23c79cfd8b 100644 --- a/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Platform.java +++ b/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Platform.java @@ -20,7 +20,9 @@ import jsinterop.annotations.JsPackage; import org.jspecify.annotations.Nullable; -/** @author Jesse Wilson */ +/** + * @author Jesse Wilson + */ final class Platform { static CharMatcher precomputeCharMatcher(CharMatcher matcher) { // CharMatcher.precomputed() produces CharMatchers that are maybe a little diff --git a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/JdkBackedImmutableBiMap.java b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/JdkBackedImmutableBiMap.java index fe42a142b06e..abc1544bc798 100644 --- a/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/JdkBackedImmutableBiMap.java +++ b/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/JdkBackedImmutableBiMap.java @@ -15,7 +15,6 @@ */ package com.google.common.collect; - /** * GWT emulation of {@link JdkBackedImmutableBiMap}. Never used, but must exist so that the client * is willing to deserialize maps that were this type on the server. diff --git a/guava-gwt/src-super/com/google/common/escape/super/com/google/common/escape/Platform.java b/guava-gwt/src-super/com/google/common/escape/super/com/google/common/escape/Platform.java index 905e7a3be417..fd5ca5e522b7 100644 --- a/guava-gwt/src-super/com/google/common/escape/super/com/google/common/escape/Platform.java +++ b/guava-gwt/src-super/com/google/common/escape/super/com/google/common/escape/Platform.java @@ -16,7 +16,9 @@ package com.google.common.escape; -/** @author Jesse Wilson */ +/** + * @author Jesse Wilson + */ final class Platform { private static final char[] CHAR_BUFFER = new char[1024]; diff --git a/guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/AbstractFuture.java b/guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/AbstractFuture.java index d5ea2dd8a18e..a919f815e29a 100644 --- a/guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/AbstractFuture.java +++ b/guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/AbstractFuture.java @@ -278,8 +278,7 @@ public String toString() { * * @return null if an explanation cannot be provided because the future is done. */ - @Nullable - String pendingToString() { + @Nullable String pendingToString() { if (state == State.DELEGATED) { return "setFuture=[" + delegate + "]"; } diff --git a/guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/Platform.java b/guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/Platform.java index a4be0de7c6be..bf5c7a47e99f 100644 --- a/guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/Platform.java +++ b/guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/Platform.java @@ -16,7 +16,6 @@ package com.google.common.util.concurrent; - /** Methods factored out so that they can be emulated differently in GWT. */ final class Platform { static boolean isInstanceOfThrowableClass(Throwable t, Class expectedClass) { diff --git a/guava-gwt/src/com/google/common/ForceGuavaCompilationEntryPoint.java b/guava-gwt/src/com/google/common/ForceGuavaCompilationEntryPoint.java index f7260a231676..1a0b215b2530 100644 --- a/guava-gwt/src/com/google/common/ForceGuavaCompilationEntryPoint.java +++ b/guava-gwt/src/com/google/common/ForceGuavaCompilationEntryPoint.java @@ -24,6 +24,6 @@ * @author Chris Povirk */ public class ForceGuavaCompilationEntryPoint implements EntryPoint { - @Override public void onModuleLoad() { - } + @Override + public void onModuleLoad() {} } diff --git a/guava-gwt/test-super/com/google/common/math/super/com/google/common/math/TestPlatform.java b/guava-gwt/test-super/com/google/common/math/super/com/google/common/math/TestPlatform.java index 7d355cfac3e5..dda9a2344de2 100644 --- a/guava-gwt/test-super/com/google/common/math/super/com/google/common/math/TestPlatform.java +++ b/guava-gwt/test-super/com/google/common/math/super/com/google/common/math/TestPlatform.java @@ -18,7 +18,9 @@ import com.google.common.annotations.GwtCompatible; -/** @author Chris Povirk */ +/** + * @author Chris Povirk + */ @GwtCompatible(emulated = true) class TestPlatform { static boolean intsCanGoOutOfRange() { diff --git a/guava-gwt/test/com/google/common/GuavaTestsEntryPoint.java b/guava-gwt/test/com/google/common/GuavaTestsEntryPoint.java index 56ccdac4c2ce..a10550a0c3a1 100644 --- a/guava-gwt/test/com/google/common/GuavaTestsEntryPoint.java +++ b/guava-gwt/test/com/google/common/GuavaTestsEntryPoint.java @@ -24,6 +24,6 @@ * @author Chris Povirk */ public class GuavaTestsEntryPoint implements EntryPoint { - @Override public void onModuleLoad() { - } + @Override + public void onModuleLoad() {} } diff --git a/guava-gwt/test/com/google/common/GwtTestSuite.java b/guava-gwt/test/com/google/common/GwtTestSuite.java index 1a0e18ad45ad..d5d7d49c01ca 100644 --- a/guava-gwt/test/com/google/common/GwtTestSuite.java +++ b/guava-gwt/test/com/google/common/GwtTestSuite.java @@ -20,12 +20,10 @@ import com.google.common.reflect.ClassPath.ClassInfo; import com.google.gwt.junit.client.GWTTestCase; import com.google.gwt.junit.tools.GWTTestSuite; - +import java.io.IOException; import junit.framework.Test; import junit.framework.TestCase; -import java.io.IOException; - /** * Runs all _gwt tests. Grouping them into a suite is much faster than running each as a one-test * "suite," as the per-suite setup is expensive. @@ -33,8 +31,8 @@ public class GwtTestSuite extends TestCase { public static Test suite() throws IOException { GWTTestSuite suite = new GWTTestSuite(); - for (ClassInfo info - : ClassPath.from(GwtTestSuite.class.getClassLoader()).getTopLevelClasses()) { + for (ClassInfo info : + ClassPath.from(GwtTestSuite.class.getClassLoader()).getTopLevelClasses()) { if (info.getName().endsWith("_gwt")) { Class clazz = info.load(); // TODO(cpovirk): why does asSubclass() throw? Is it something about ClassLoaders? diff --git a/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTester.java b/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTester.java index c2f0ffe809fa..7ebb133e3cb4 100644 --- a/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTester.java +++ b/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTester.java @@ -53,12 +53,16 @@ protected Collection resetContainer(Collection newContents) { return collection; } - /** @see AbstractContainerTester#resetContainer() */ + /** + * @see AbstractContainerTester#resetContainer() + */ protected void resetCollection() { resetContainer(); } - /** @return an array of the proper size with {@code null} inserted into the middle element. */ + /** + * @return an array of the proper size with {@code null} inserted into the middle element. + */ protected E[] createArrayWithNullElement() { E[] array = createSamplesArray(); array[getNullLocation()] = null; diff --git a/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java b/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java index 9b72beb16cf2..23e5584ba72b 100644 --- a/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java +++ b/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java @@ -56,7 +56,9 @@ protected Collection> actualContents() { return getMap().entrySet(); } - /** @see AbstractContainerTester#resetContainer() */ + /** + * @see AbstractContainerTester#resetContainer() + */ protected final void resetMap() { resetContainer(); } @@ -77,7 +79,9 @@ protected void expectMissingValues(V... elements) { } } - /** @return an array of the proper size with {@code null} as the key of the middle element. */ + /** + * @return an array of the proper size with {@code null} as the key of the middle element. + */ protected Entry[] createArrayWithNullKey() { Entry[] array = createSamplesArray(); int nullKeyLocation = getNullLocation(); @@ -102,7 +106,9 @@ private Entry getEntryNullReplaces() { return entries.next(); } - /** @return an array of the proper size with {@code null} as the value of the middle element. */ + /** + * @return an array of the proper size with {@code null} as the value of the middle element. + */ protected Entry[] createArrayWithNullValue() { Entry[] array = createSamplesArray(); int nullValueLocation = getNullLocation(); diff --git a/guava-testlib/src/com/google/common/testing/ClassSanityTester.java b/guava-testlib/src/com/google/common/testing/ClassSanityTester.java index f0dbae13ecf5..df60ed45e499 100644 --- a/guava-testlib/src/com/google/common/testing/ClassSanityTester.java +++ b/guava-testlib/src/com/google/common/testing/ClassSanityTester.java @@ -203,7 +203,9 @@ public void testNulls(Class cls) { } void doTestNulls(Class cls, Visibility visibility) - throws ParameterNotInstantiableException, IllegalAccessException, InvocationTargetException, + throws ParameterNotInstantiableException, + IllegalAccessException, + InvocationTargetException, FactoryMethodReturnsNullException { if (!Modifier.isAbstract(cls.getModifiers())) { nullPointerTester.testConstructors(cls, visibility); @@ -295,8 +297,11 @@ public void testEquals(Class cls) { } void doTestEquals(Class cls) - throws ParameterNotInstantiableException, ParameterHasNoDistinctValueException, - IllegalAccessException, InvocationTargetException, FactoryMethodReturnsNullException { + throws ParameterNotInstantiableException, + ParameterHasNoDistinctValueException, + IllegalAccessException, + InvocationTargetException, + FactoryMethodReturnsNullException { if (cls.isEnum()) { return; } @@ -566,8 +571,11 @@ public FactoryMethodReturnValueTester testEqualsAndSerializable() throws Excepti } private void testEqualsUsing(final Invokable factory) - throws ParameterNotInstantiableException, ParameterHasNoDistinctValueException, - IllegalAccessException, InvocationTargetException, FactoryMethodReturnsNullException { + throws ParameterNotInstantiableException, + ParameterHasNoDistinctValueException, + IllegalAccessException, + InvocationTargetException, + FactoryMethodReturnsNullException { List params = factory.getParameters(); List argGenerators = Lists.newArrayListWithCapacity(params.size()); List<@Nullable Object> args = Lists.newArrayListWithCapacity(params.size()); @@ -617,8 +625,10 @@ String reportItem(Item item) { */ private List generateEqualFactoryArguments( Invokable factory, List params, List args) - throws ParameterNotInstantiableException, FactoryMethodReturnsNullException, - InvocationTargetException, IllegalAccessException { + throws ParameterNotInstantiableException, + FactoryMethodReturnsNullException, + InvocationTargetException, + IllegalAccessException { List equalArgs = Lists.newArrayList(args); for (int i = 0; i < args.size(); i++) { Parameter param = params.get(i); diff --git a/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java b/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java index d1c0d38a62be..f8a53e45e9b1 100644 --- a/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java +++ b/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java @@ -32,6 +32,7 @@ public class SplitterBenchmark { // overall size of string @Param({"1", "10", "100", "1000"}) int length; + // Number of matching strings @Param({"xxxx", "xxXx", "xXxX", "XXXX"}) String text; diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java b/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java index a1db2b6c0242..9eb6cdd465e0 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java @@ -52,6 +52,7 @@ interface ExecutionListWrapper { void add(Runnable runnable, Executor executor); void execute(); + /** Returns the underlying implementation, useful for the Footprint benchmark. */ Object getImpl(); } diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java b/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java index 26714674a82a..218a9dbbb0a9 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java @@ -104,6 +104,7 @@ private enum ExceptionType { @Param Validator validator; @Param Result result; @Param ExceptionType exceptionType; + /** * The number of other exception types in the cache of known-good exceptions and the number of * other {@code ClassValue} entries for the exception type to be tested. This lets us evaluate diff --git a/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java b/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java index a1c0ab02910d..cc04a97201da 100644 --- a/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java +++ b/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java @@ -62,10 +62,13 @@ public class MonitorBasedArrayBlockingQueue extends AbstractQueue /** The queued items */ final E[] items; + /** items index for next take, poll or remove */ int takeIndex; + /** items index for next put, offer, or add. */ int putIndex; + /** Number of items in the queue */ private int count; diff --git a/guava-tests/test/com/google/common/base/TestExceptions.java b/guava-tests/test/com/google/common/base/TestExceptions.java index 17444e0afeca..3eadceb43b43 100644 --- a/guava-tests/test/com/google/common/base/TestExceptions.java +++ b/guava-tests/test/com/google/common/base/TestExceptions.java @@ -16,7 +16,6 @@ package com.google.common.base; - import com.google.common.annotations.GwtCompatible; import org.jspecify.annotations.NullUnmarked; diff --git a/guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java b/guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java index b000664293c2..1ded6f1ee474 100644 --- a/guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java +++ b/guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java @@ -389,7 +389,7 @@ public void testComplexBuilder() { public void testBuilderAddHandlesNullsCorrectly() { { - ImmutableSet.Builder builder = this.builder(); + ImmutableSet.Builder builder = this.builder(); assertThrows(NullPointerException.class, () -> builder.add((String) null)); } @@ -421,7 +421,7 @@ public void testBuilderAddHandlesNullsCorrectly() { public void testBuilderAddAllHandlesNullsCorrectly() { { - ImmutableSet.Builder builder = this.builder(); + ImmutableSet.Builder builder = this.builder(); assertThrows(NullPointerException.class, () -> builder.addAll((Iterable) null)); } @@ -432,13 +432,13 @@ public void testBuilderAddAllHandlesNullsCorrectly() { { ImmutableSet.Builder builder = this.builder(); - List<@Nullable String> listWithNulls = asList("a", null, "b"); + List<@Nullable String> listWithNulls = asList("a", null, "b"); assertThrows(NullPointerException.class, () -> builder.addAll((List) listWithNulls)); } { ImmutableSet.Builder builder = this.builder(); - Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b"); + Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b"); assertThrows( NullPointerException.class, () -> builder.addAll((Iterable) iterableWithNulls)); } diff --git a/guava-tests/test/com/google/common/collect/CompactHashMapTest.java b/guava-tests/test/com/google/common/collect/CompactHashMapTest.java index bef30ca150b5..570815c53fc5 100644 --- a/guava-tests/test/com/google/common/collect/CompactHashMapTest.java +++ b/guava-tests/test/com/google/common/collect/CompactHashMapTest.java @@ -142,5 +142,4 @@ public void testAllocArraysExpectedSize() { assertThat(map.values).hasLength(expectedSize); } } - } diff --git a/guava-tests/test/com/google/common/collect/CompactHashSetTest.java b/guava-tests/test/com/google/common/collect/CompactHashSetTest.java index 39fa5bbdef94..bef00fbc12de 100644 --- a/guava-tests/test/com/google/common/collect/CompactHashSetTest.java +++ b/guava-tests/test/com/google/common/collect/CompactHashSetTest.java @@ -126,5 +126,4 @@ public void testAllocArraysExpectedSize() { assertThat(set.elements).hasLength(expectedSize); } } - } diff --git a/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java b/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java index bd9e8b592dc0..e9648953e345 100644 --- a/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java +++ b/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java @@ -204,5 +204,4 @@ public void testAllocArraysExpectedSize() { assertThat(map.links).hasLength(expectedSize); } } - } diff --git a/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java b/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java index 5e3e8ed6f71c..e0d9a00586e0 100644 --- a/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java +++ b/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java @@ -108,5 +108,4 @@ public void testAllocArraysExpectedSize() { assertThat(set.elements).hasLength(expectedSize); } } - } diff --git a/guava-tests/test/com/google/common/collect/FilteredMapTest.java b/guava-tests/test/com/google/common/collect/FilteredMapTest.java index 70e561443e70..439099b11fda 100644 --- a/guava-tests/test/com/google/common/collect/FilteredMapTest.java +++ b/guava-tests/test/com/google/common/collect/FilteredMapTest.java @@ -16,7 +16,6 @@ package com.google.common.collect; - import com.google.common.annotations.GwtCompatible; import java.util.Map; import org.jspecify.annotations.NullMarked; diff --git a/guava-tests/test/com/google/common/collect/ImmutableListTest.java b/guava-tests/test/com/google/common/collect/ImmutableListTest.java index a3f1cccd887e..3083c77b8978 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableListTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableListTest.java @@ -565,7 +565,7 @@ public void testBuilderAddHandlesNullsCorrectly() { public void testBuilderAddAllHandlesNullsCorrectly() { { - ImmutableList.Builder builder = ImmutableList.builder(); + ImmutableList.Builder builder = ImmutableList.builder(); assertThrows(NullPointerException.class, () -> builder.addAll((Iterable) null)); } @@ -576,21 +576,21 @@ public void testBuilderAddAllHandlesNullsCorrectly() { { ImmutableList.Builder builder = ImmutableList.builder(); - List<@Nullable String> listWithNulls = asList("a", null, "b"); + List<@Nullable String> listWithNulls = asList("a", null, "b"); assertThrows(NullPointerException.class, () -> builder.addAll((List) listWithNulls)); } { ImmutableList.Builder builder = ImmutableList.builder(); - Iterator<@Nullable String> iteratorWithNulls = - Arrays.<@Nullable String>asList("a", null, "b").iterator(); + Iterator<@Nullable String> iteratorWithNulls = + Arrays.<@Nullable String>asList("a", null, "b").iterator(); assertThrows( NullPointerException.class, () -> builder.addAll((Iterator) iteratorWithNulls)); } { ImmutableList.Builder builder = ImmutableList.builder(); - Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b"); + Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b"); assertThrows( NullPointerException.class, () -> builder.addAll((Iterable) iterableWithNulls)); } diff --git a/guava-tests/test/com/google/common/collect/ImmutableMapTest.java b/guava-tests/test/com/google/common/collect/ImmutableMapTest.java index bafea9dc0bf6..182bb9ba7b5d 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableMapTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableMapTest.java @@ -583,9 +583,9 @@ public void testBuilder_keepingLast_thenOrThrow() { // being true. Pattern pattern = Pattern.compile("Multiple entries with same key: four=(.*) and four=(.*)"); assertThat(expected).hasMessageThat().matches(pattern); - Matcher matcher = pattern.matcher(expected.getMessage()); - assertThat(matcher.matches()).isTrue(); - assertThat(matcher.group(1)).isNotEqualTo(matcher.group(2)); + Matcher matcher = pattern.matcher(expected.getMessage()); + assertThat(matcher.matches()).isTrue(); + assertThat(matcher.group(1)).isNotEqualTo(matcher.group(2)); } public void testOf() { diff --git a/guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java b/guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java index c8cbdae28d38..b949a21234f9 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java @@ -511,20 +511,20 @@ public void testBuilderAddHandlesNullsCorrectly() { public void testBuilderAddAllHandlesNullsCorrectly() { { - ImmutableMultiset.Builder builder = ImmutableMultiset.builder(); + ImmutableMultiset.Builder builder = ImmutableMultiset.builder(); assertThrows(NullPointerException.class, () -> builder.addAll((Collection) null)); } { ImmutableMultiset.Builder builder = ImmutableMultiset.builder(); - List<@Nullable String> listWithNulls = asList("a", null, "b"); + List<@Nullable String> listWithNulls = asList("a", null, "b"); assertThrows(NullPointerException.class, () -> builder.addAll((List) listWithNulls)); } { ImmutableMultiset.Builder builder = ImmutableMultiset.builder(); - Multiset<@Nullable String> multisetWithNull = - LinkedHashMultiset.create(Arrays.<@Nullable String>asList("a", null, "b")); + Multiset<@Nullable String> multisetWithNull = + LinkedHashMultiset.create(Arrays.<@Nullable String>asList("a", null, "b")); assertThrows( NullPointerException.class, () -> builder.addAll((Multiset) multisetWithNull)); } diff --git a/guava-tests/test/com/google/common/collect/IterablesTest.java b/guava-tests/test/com/google/common/collect/IterablesTest.java index cd4879c8f602..c777f27cc676 100644 --- a/guava-tests/test/com/google/common/collect/IterablesTest.java +++ b/guava-tests/test/com/google/common/collect/IterablesTest.java @@ -867,7 +867,9 @@ public void testGetLast_withDefault_multiple() { * need to prove that it isn't called. */ private static class DiesOnIteratorArrayList extends ArrayList { - /** @throws UnsupportedOperationException all the time */ + /** + * @throws UnsupportedOperationException all the time + */ @Override public Iterator iterator() { throw new UnsupportedOperationException(); diff --git a/guava-tests/test/com/google/common/collect/MapsTest.java b/guava-tests/test/com/google/common/collect/MapsTest.java index 977d26cb63e5..edc65c816167 100644 --- a/guava-tests/test/com/google/common/collect/MapsTest.java +++ b/guava-tests/test/com/google/common/collect/MapsTest.java @@ -1422,12 +1422,12 @@ public void testUnmodifiableNavigableMap() { iterator.remove(); }); { - Entry entry = entries.iterator().next(); + Entry entry = entries.iterator().next(); assertThrows(UnsupportedOperationException.class, () -> entry.setValue("four")); } { Entry entry = unmod.lowerEntry(1); - assertNull(entry); + assertNull(entry); } { Entry entry = unmod.floorEntry(2); diff --git a/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java b/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java index 686473e57d17..80d6d07498d8 100644 --- a/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java +++ b/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java @@ -151,6 +151,7 @@ public void testFalsePositivesForNextEscapedIndex() { protected char @Nullable [] escape(int cp) { return ('a' <= cp && cp <= 'z') ? new char[] {Character.toUpperCase((char) cp)} : null; } + // Inefficient implementation that defines all letters as escapable. @Override protected int nextEscapeIndex(CharSequence csq, int index, int end) { diff --git a/guava-tests/test/com/google/common/graph/TestUtil.java b/guava-tests/test/com/google/common/graph/TestUtil.java index 8a7dfbef6665..e1aea12d76cc 100644 --- a/guava-tests/test/com/google/common/graph/TestUtil.java +++ b/guava-tests/test/com/google/common/graph/TestUtil.java @@ -45,7 +45,7 @@ static void assertNodeNotInGraphErrorMessage(Throwable throwable) { assertThat(throwable).hasMessageThat().startsWith(NODE_STRING); assertThat(throwable).hasMessageThat().contains(ERROR_ELEMENT_NOT_IN_GRAPH); } - + static void assertEdgeNotInGraphErrorMessage(Throwable throwable) { assertThat(throwable).hasMessageThat().startsWith(EDGE_STRING); assertThat(throwable).hasMessageThat().contains(ERROR_ELEMENT_NOT_IN_GRAPH); diff --git a/guava-tests/test/com/google/common/math/IntMathTest.java b/guava-tests/test/com/google/common/math/IntMathTest.java index cd78b28b97e2..38044cd4a6db 100644 --- a/guava-tests/test/com/google/common/math/IntMathTest.java +++ b/guava-tests/test/com/google/common/math/IntMathTest.java @@ -98,9 +98,9 @@ public void testFloorPowerOfTwoZero() { @GwtIncompatible // BigIntegerMath // TODO(cpovirk): GWT-enable BigIntegerMath public void testConstantMaxPowerOfSqrt2Unsigned() { assertEquals( - /*expected=*/ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Integer.SIZE - 1), FLOOR) + /* expected= */ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Integer.SIZE - 1), FLOOR) .intValue(), - /*actual=*/ IntMath.MAX_POWER_OF_SQRT2_UNSIGNED); + /* actual= */ IntMath.MAX_POWER_OF_SQRT2_UNSIGNED); } @GwtIncompatible // pow() @@ -148,8 +148,8 @@ public void testConstantsBiggestBinomials() { @GwtIncompatible // sqrt public void testPowersSqrtMaxInt() { assertEquals( - /*expected=*/ IntMath.sqrt(Integer.MAX_VALUE, FLOOR), - /*actual=*/ IntMath.FLOOR_SQRT_MAX_INT); + /* expected= */ IntMath.sqrt(Integer.MAX_VALUE, FLOOR), + /* actual= */ IntMath.FLOOR_SQRT_MAX_INT); } @AndroidIncompatible // presumably slow diff --git a/guava-tests/test/com/google/common/math/LongMathTest.java b/guava-tests/test/com/google/common/math/LongMathTest.java index 85270faf2fa3..e15ee30c5b18 100644 --- a/guava-tests/test/com/google/common/math/LongMathTest.java +++ b/guava-tests/test/com/google/common/math/LongMathTest.java @@ -99,9 +99,9 @@ public void testFloorPowerOfTwoZero() { @GwtIncompatible // TODO public void testConstantMaxPowerOfSqrt2Unsigned() { assertEquals( - /*expected=*/ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Long.SIZE - 1), FLOOR) + /* expected= */ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Long.SIZE - 1), FLOOR) .longValue(), - /*actual=*/ LongMath.MAX_POWER_OF_SQRT2_UNSIGNED); + /* actual= */ LongMath.MAX_POWER_OF_SQRT2_UNSIGNED); } @GwtIncompatible // BigIntegerMath // TODO(cpovirk): GWT-enable BigIntegerMath @@ -137,8 +137,8 @@ public void testConstantsHalfPowersOf10() { @GwtIncompatible // TODO public void testConstantsSqrtMaxLong() { assertEquals( - /*expected=*/ LongMath.sqrt(Long.MAX_VALUE, FLOOR), - /*actual=*/ LongMath.FLOOR_SQRT_MAX_LONG); + /* expected= */ LongMath.sqrt(Long.MAX_VALUE, FLOOR), + /* actual= */ LongMath.FLOOR_SQRT_MAX_LONG); } @GwtIncompatible // TODO diff --git a/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java b/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java index 8bbe2cac52da..87d6bf9e571d 100644 --- a/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java +++ b/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java @@ -106,7 +106,6 @@ public void testValueOfLong() { } } - public void testValueOfBigInteger() { BigInteger min = BigInteger.ZERO; BigInteger max = UnsignedLong.MAX_VALUE.bigIntegerValue(); diff --git a/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java b/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java index 683abc29c47e..38f508e1f8ac 100644 --- a/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java @@ -194,7 +194,7 @@ public void testImmediateCancelledFutureStack() throws Exception { assertThrows(CancellationException.class, () -> CallerClass2.get(future)); List stackTrace = ImmutableList.copyOf(expected.getStackTrace()); assertFalse(Iterables.any(stackTrace, hasClassName(CallerClass1.class))); - assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class))); + assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class))); // See AbstractFutureCancellationCauseTest for how to set causes. assertThat(expected).hasCauseThat().isNull(); @@ -2253,7 +2253,7 @@ public void testAllAsList_logging_error() throws Exception { () -> getDone(allAsList(immediateFailedFuture(new SomeError())))); assertThat(expected).hasCauseThat().isInstanceOf(SomeError.class); List logged = aggregateFutureLogHandler.getStoredLogRecords(); - assertThat(logged).hasSize(1); // errors are always logged + assertThat(logged).hasSize(1); // errors are always logged assertThat(logged.get(0).getThrown()).isInstanceOf(SomeError.class); } @@ -2269,8 +2269,8 @@ public void testAllAsList_logging_multipleExceptions_alreadyDone() throws Except immediateFailedFuture(new MyException())))); assertThat(expected).hasCauseThat().isInstanceOf(MyException.class); List logged = aggregateFutureLogHandler.getStoredLogRecords(); - assertThat(logged).hasSize(1); // the second failure is logged - assertThat(logged.get(0).getThrown()).isInstanceOf(MyException.class); + assertThat(logged).hasSize(1); // the second failure is logged + assertThat(logged.get(0).getThrown()).isInstanceOf(MyException.class); } /** All as list will log extra exceptions that occur later. */ diff --git a/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java index f2934358cbc0..bcd6e95adcaa 100644 --- a/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java @@ -16,7 +16,6 @@ package com.google.common.util.concurrent; - import com.google.common.annotations.GwtCompatible; import com.google.common.util.concurrent.AbstractFuture.TrustedFuture; import org.jspecify.annotations.NullUnmarked; diff --git a/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java b/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java index df673a8cf7f0..44ee313c7656 100644 --- a/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java @@ -16,7 +16,6 @@ package com.google.common.util.concurrent; - import com.google.common.annotations.GwtCompatible; import com.google.common.util.concurrent.AbstractFuture.TrustedFuture; import org.jspecify.annotations.NullUnmarked; diff --git a/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java b/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java index 941acc6a8b2a..68edc7b7691e 100644 --- a/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java @@ -46,6 +46,7 @@ @NullUnmarked public class WrappingExecutorServiceTest extends TestCase { private static final String RESULT_VALUE = "ran"; + // Uninteresting delegations public void testDelegations() throws InterruptedException { MockExecutor mock = new MockExecutor(); diff --git a/guava/src/com/google/common/base/Functions.java b/guava/src/com/google/common/base/Functions.java index 70fa63640834..92d1cb09696c 100644 --- a/guava/src/com/google/common/base/Functions.java +++ b/guava/src/com/google/common/base/Functions.java @@ -293,7 +293,9 @@ public String toString() { return new PredicateFunction<>(predicate); } - /** @see Functions#forPredicate */ + /** + * @see Functions#forPredicate + */ private static class PredicateFunction implements Function, Serializable { private final Predicate predicate; @@ -390,7 +392,9 @@ public String toString() { return new SupplierFunction<>(supplier); } - /** @see Functions#forSupplier */ + /** + * @see Functions#forSupplier + */ private static class SupplierFunction implements Function, Serializable { diff --git a/guava/src/com/google/common/base/Predicates.java b/guava/src/com/google/common/base/Predicates.java index 934c381b0f33..be84124c37d4 100644 --- a/guava/src/com/google/common/base/Predicates.java +++ b/guava/src/com/google/common/base/Predicates.java @@ -254,7 +254,9 @@ public static Predicate contains(Pattern pattern) { // Package private for GWT serialization. enum ObjectPredicate implements Predicate<@Nullable Object> { - /** @see Predicates#alwaysTrue() */ + /** + * @see Predicates#alwaysTrue() + */ ALWAYS_TRUE { @Override public boolean apply(@Nullable Object o) { @@ -266,7 +268,9 @@ public String toString() { return "Predicates.alwaysTrue()"; } }, - /** @see Predicates#alwaysFalse() */ + /** + * @see Predicates#alwaysFalse() + */ ALWAYS_FALSE { @Override public boolean apply(@Nullable Object o) { @@ -278,7 +282,9 @@ public String toString() { return "Predicates.alwaysFalse()"; } }, - /** @see Predicates#isNull() */ + /** + * @see Predicates#isNull() + */ IS_NULL { @Override public boolean apply(@Nullable Object o) { @@ -290,7 +296,9 @@ public String toString() { return "Predicates.isNull()"; } }, - /** @see Predicates#notNull() */ + /** + * @see Predicates#notNull() + */ NOT_NULL { @Override public boolean apply(@Nullable Object o) { @@ -309,7 +317,9 @@ public String toString() { } } - /** @see Predicates#not(Predicate) */ + /** + * @see Predicates#not(Predicate) + */ private static class NotPredicate implements Predicate, Serializable { final Predicate predicate; @@ -345,7 +355,9 @@ public String toString() { private static final long serialVersionUID = 0; } - /** @see Predicates#and(Iterable) */ + /** + * @see Predicates#and(Iterable) + */ private static class AndPredicate implements Predicate, Serializable { private final List> components; @@ -388,7 +400,9 @@ public String toString() { private static final long serialVersionUID = 0; } - /** @see Predicates#or(Iterable) */ + /** + * @see Predicates#or(Iterable) + */ private static class OrPredicate implements Predicate, Serializable { private final List> components; @@ -444,7 +458,9 @@ private static String toStringHelper(String methodName, Iterable components) return builder.append(')').toString(); } - /** @see Predicates#equalTo(Object) */ + /** + * @see Predicates#equalTo(Object) + */ private static class IsEqualToPredicate implements Predicate<@Nullable Object>, Serializable { private final Object target; @@ -562,7 +578,9 @@ public String toString() { private static final long serialVersionUID = 0; } - /** @see Predicates#in(Collection) */ + /** + * @see Predicates#in(Collection) + */ private static class InPredicate implements Predicate, Serializable { private final Collection target; @@ -602,7 +620,9 @@ public String toString() { private static final long serialVersionUID = 0; } - /** @see Predicates#compose(Predicate, Function) */ + /** + * @see Predicates#compose(Predicate, Function) + */ private static class CompositionPredicate implements Predicate, Serializable { final Predicate p; diff --git a/guava/src/com/google/common/cache/AbstractCache.java b/guava/src/com/google/common/cache/AbstractCache.java index e5e51a5af5e1..bb5596ff58d5 100644 --- a/guava/src/com/google/common/cache/AbstractCache.java +++ b/guava/src/com/google/common/cache/AbstractCache.java @@ -43,7 +43,9 @@ public abstract class AbstractCache implements Cache { /** Constructor for use by subclasses. */ protected AbstractCache() {} - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public V get(K key, Callable valueLoader) throws ExecutionException { throw new UnsupportedOperationException(); @@ -78,13 +80,17 @@ public ImmutableMap getAllPresent(Iterable keys) { return ImmutableMap.copyOf(result); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public void put(K key, V value) { throw new UnsupportedOperationException(); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @Override public void putAll(Map m) { for (Entry entry : m.entrySet()) { @@ -105,7 +111,9 @@ public void invalidate(Object key) { throw new UnsupportedOperationException(); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override // For discussion of , see getAllPresent. public void invalidateAll(Iterable keys) { @@ -209,13 +217,17 @@ public static final class SimpleStatsCounter implements StatsCounter { /** Constructs an instance with all counts initialized to zero. */ public SimpleStatsCounter() {} - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public void recordHits(int count) { hitCount.add(count); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public void recordMisses(int count) { missCount.add(count); diff --git a/guava/src/com/google/common/cache/ForwardingCache.java b/guava/src/com/google/common/cache/ForwardingCache.java index 87b8fde2a908..be7df89a3566 100644 --- a/guava/src/com/google/common/cache/ForwardingCache.java +++ b/guava/src/com/google/common/cache/ForwardingCache.java @@ -49,13 +49,17 @@ protected ForwardingCache() {} return delegate().getIfPresent(key); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public V get(K key, Callable valueLoader) throws ExecutionException { return delegate().get(key, valueLoader); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override /* * is mostly the same as to plain Java. But to nullness checkers, they @@ -65,13 +69,17 @@ public ImmutableMap getAllPresent(Iterable keys) { return delegate().getAllPresent(keys); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override public void put(K key, V value) { delegate().put(key, value); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @Override public void putAll(Map m) { delegate().putAll(m); @@ -82,7 +90,9 @@ public void invalidate(Object key) { delegate().invalidate(key); } - /** @since 11.0 */ + /** + * @since 11.0 + */ @Override // For discussion of , see getAllPresent. public void invalidateAll(Iterable keys) { diff --git a/guava/src/com/google/common/collect/ArrayTable.java b/guava/src/com/google/common/collect/ArrayTable.java index 1fe2771b8c96..8fd5664df6ff 100644 --- a/guava/src/com/google/common/collect/ArrayTable.java +++ b/guava/src/com/google/common/collect/ArrayTable.java @@ -161,8 +161,7 @@ private ArrayTable(Iterable rowKeys, Iterable columnKe columnKeyToIndex = Maps.indexMap(columnList); @SuppressWarnings("unchecked") - @Nullable - V[][] tmpArray = (@Nullable V[][]) new Object[rowList.size()][columnList.size()]; + @Nullable V[][] tmpArray = (@Nullable V[][]) new Object[rowList.size()][columnList.size()]; array = tmpArray; // Necessary because in GWT the arrays are initialized with "undefined" instead of null. eraseAll(); @@ -179,8 +178,7 @@ private ArrayTable(ArrayTable table) { rowKeyToIndex = table.rowKeyToIndex; columnKeyToIndex = table.columnKeyToIndex; @SuppressWarnings("unchecked") - @Nullable - V[][] copy = (@Nullable V[][]) new Object[rowList.size()][columnList.size()]; + @Nullable V[][] copy = (@Nullable V[][]) new Object[rowList.size()][columnList.size()]; array = copy; for (int i = 0; i < rowList.size(); i++) { arraycopy(table.array[i], 0, copy[i], 0, table.array[i].length); @@ -367,8 +365,8 @@ public ImmutableList columnKeyList() { @GwtIncompatible // reflection public @Nullable V[][] toArray(Class valueClass) { @SuppressWarnings("unchecked") // TODO: safe? - @Nullable - V[][] copy = (@Nullable V[][]) Array.newInstance(valueClass, rowList.size(), columnList.size()); + @Nullable V[][] copy = + (@Nullable V[][]) Array.newInstance(valueClass, rowList.size(), columnList.size()); for (int i = 0; i < rowList.size(); i++) { arraycopy(array[i], 0, copy[i], 0, array[i].length); } diff --git a/guava/src/com/google/common/collect/ConcurrentHashMultiset.java b/guava/src/com/google/common/collect/ConcurrentHashMultiset.java index ce1ad289f8b6..ea831cd57562 100644 --- a/guava/src/com/google/common/collect/ConcurrentHashMultiset.java +++ b/guava/src/com/google/common/collect/ConcurrentHashMultiset.java @@ -484,7 +484,9 @@ Iterator elementIterator() { throw new AssertionError("should never be called"); } - /** @deprecated Internal method, use {@link #entrySet()}. */ + /** + * @deprecated Internal method, use {@link #entrySet()}. + */ @Deprecated @Override public Set> createEntrySet() { @@ -589,7 +591,9 @@ private List> snapshot() { } } - /** @serialData the ConcurrentMap of elements and their counts. */ + /** + * @serialData the ConcurrentMap of elements and their counts. + */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeObject(countMap); diff --git a/guava/src/com/google/common/collect/ContiguousSet.java b/guava/src/com/google/common/collect/ContiguousSet.java index 574e7ff36b57..bb5aa11a4a0e 100644 --- a/guava/src/com/google/common/collect/ContiguousSet.java +++ b/guava/src/com/google/common/collect/ContiguousSet.java @@ -154,7 +154,9 @@ public ContiguousSet headSet(C toElement) { return headSetImpl(checkNotNull(toElement), false); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public ContiguousSet headSet(C toElement, boolean inclusive) { @@ -169,7 +171,9 @@ public ContiguousSet subSet(C fromElement, C toElement) { return subSetImpl(fromElement, true, toElement, false); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public ContiguousSet subSet( @@ -185,7 +189,9 @@ public ContiguousSet tailSet(C fromElement) { return tailSetImpl(checkNotNull(fromElement), true); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public ContiguousSet tailSet(C fromElement, boolean inclusive) { diff --git a/guava/src/com/google/common/collect/DenseImmutableTable.java b/guava/src/com/google/common/collect/DenseImmutableTable.java index 42fdeebeeae6..eef7e8bab983 100644 --- a/guava/src/com/google/common/collect/DenseImmutableTable.java +++ b/guava/src/com/google/common/collect/DenseImmutableTable.java @@ -57,8 +57,7 @@ final class DenseImmutableTable extends RegularImmutableTable ImmutableSet rowSpace, ImmutableSet columnSpace) { @SuppressWarnings("unchecked") - @Nullable - V[][] array = (@Nullable V[][]) new Object[rowSpace.size()][columnSpace.size()]; + @Nullable V[][] array = (@Nullable V[][]) new Object[rowSpace.size()][columnSpace.size()]; this.values = array; this.rowKeyToIndex = Maps.indexMap(rowSpace); this.columnKeyToIndex = Maps.indexMap(columnSpace); diff --git a/guava/src/com/google/common/collect/ImmutableBiMap.java b/guava/src/com/google/common/collect/ImmutableBiMap.java index c5df8d646f20..9d79cbdc6c82 100644 --- a/guava/src/com/google/common/collect/ImmutableBiMap.java +++ b/guava/src/com/google/common/collect/ImmutableBiMap.java @@ -226,6 +226,7 @@ public static ImmutableBiMap of( entryOf(k8, v8), entryOf(k9, v9)); } + /** * Returns an immutable map containing the given entries, in order. * diff --git a/guava/src/com/google/common/collect/ImmutableMultiset.java b/guava/src/com/google/common/collect/ImmutableMultiset.java index 29169b9aff82..d01ecddf4fbc 100644 --- a/guava/src/com/google/common/collect/ImmutableMultiset.java +++ b/guava/src/com/google/common/collect/ImmutableMultiset.java @@ -349,7 +349,9 @@ public String toString() { return entrySet().toString(); } - /** @since 21.0 (present with return type {@code Set} since 2.0) */ + /** + * @since 21.0 (present with return type {@code Set} since 2.0) + */ @Override public abstract ImmutableSet elementSet(); diff --git a/guava/src/com/google/common/collect/ImmutableSortedSet.java b/guava/src/com/google/common/collect/ImmutableSortedSet.java index 649faeb60bbe..ba8c5ee86171 100644 --- a/guava/src/com/google/common/collect/ImmutableSortedSet.java +++ b/guava/src/com/google/common/collect/ImmutableSortedSet.java @@ -643,7 +643,9 @@ public ImmutableSortedSet headSet(E toElement) { return headSet(toElement, false); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @Override public ImmutableSortedSet headSet(E toElement, boolean inclusive) { return headSetImpl(checkNotNull(toElement), inclusive); @@ -666,7 +668,9 @@ public ImmutableSortedSet subSet(E fromElement, E toElement) { return subSet(fromElement, true, toElement, false); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public ImmutableSortedSet subSet( @@ -692,7 +696,9 @@ public ImmutableSortedSet tailSet(E fromElement) { return tailSet(fromElement, true); } - /** @since 12.0 */ + /** + * @since 12.0 + */ @Override public ImmutableSortedSet tailSet(E fromElement, boolean inclusive) { return tailSetImpl(checkNotNull(fromElement), inclusive); @@ -789,7 +795,9 @@ public E last() { @LazyInit transient @Nullable ImmutableSortedSet descendingSet; - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public ImmutableSortedSet descendingSet() { @@ -831,7 +839,9 @@ public Comparator getComparator() { }; } - /** @since 12.0 */ + /** + * @since 12.0 + */ @GwtIncompatible // NavigableSet @Override public abstract UnmodifiableIterator descendingIterator(); diff --git a/guava/src/com/google/common/collect/LinkedHashMultimap.java b/guava/src/com/google/common/collect/LinkedHashMultimap.java index 1e1bc5c82dcc..55accb8fbd6c 100644 --- a/guava/src/com/google/common/collect/LinkedHashMultimap.java +++ b/guava/src/com/google/common/collect/LinkedHashMultimap.java @@ -377,8 +377,7 @@ final class ValueSet extends Sets.ImprovedAbstractSet implements ValueSetLink int tableSize = Hashing.closedTableSize(expectedValues, VALUE_SET_LOAD_FACTOR); @SuppressWarnings({"rawtypes", "unchecked"}) - @Nullable - ValueEntry[] hashTable = new @Nullable ValueEntry[tableSize]; + @Nullable ValueEntry[] hashTable = new @Nullable ValueEntry[tableSize]; this.hashTable = hashTable; } diff --git a/guava/src/com/google/common/collect/Lists.java b/guava/src/com/google/common/collect/Lists.java index 443d45d06b72..df28218f3a3c 100644 --- a/guava/src/com/google/common/collect/Lists.java +++ b/guava/src/com/google/common/collect/Lists.java @@ -333,7 +333,9 @@ static int computeArrayListCapacity(int arraySize) { return new TwoPlusArrayList<>(first, second, rest); } - /** @see Lists#asList(Object, Object[]) */ + /** + * @see Lists#asList(Object, Object[]) + */ private static class OnePlusArrayList extends AbstractList implements Serializable, RandomAccess { @ParametricNullness final E first; @@ -360,7 +362,9 @@ public E get(int index) { @J2ktIncompatible private static final long serialVersionUID = 0; } - /** @see Lists#asList(Object, Object, Object[]) */ + /** + * @see Lists#asList(Object, Object, Object[]) + */ private static class TwoPlusArrayList extends AbstractList implements Serializable, RandomAccess { @ParametricNullness final E first; diff --git a/guava/src/com/google/common/collect/Multimaps.java b/guava/src/com/google/common/collect/Multimaps.java index 02b10bec7163..b3118e1766ad 100644 --- a/guava/src/com/google/common/collect/Multimaps.java +++ b/guava/src/com/google/common/collect/Multimaps.java @@ -1134,7 +1134,9 @@ Map> asMap(Multimap multimap) { return new MapMultimap<>(map); } - /** @see Multimaps#forMap */ + /** + * @see Multimaps#forMap + */ private static class MapMultimap extends AbstractMultimap implements SetMultimap, Serializable { final Map map; diff --git a/guava/src/com/google/common/collect/RegularImmutableMultiset.java b/guava/src/com/google/common/collect/RegularImmutableMultiset.java index 98e3efd31806..83cf909d60e2 100644 --- a/guava/src/com/google/common/collect/RegularImmutableMultiset.java +++ b/guava/src/com/google/common/collect/RegularImmutableMultiset.java @@ -50,8 +50,7 @@ static ImmutableMultiset create(Collection> int tableSize = Hashing.closedTableSize(distinct, MAX_LOAD_FACTOR); int mask = tableSize - 1; @SuppressWarnings({"unchecked", "rawtypes"}) - @Nullable - ImmutableEntry[] hashTable = new @Nullable ImmutableEntry[tableSize]; + @Nullable ImmutableEntry[] hashTable = new @Nullable ImmutableEntry[tableSize]; int index = 0; int hashCode = 0; diff --git a/guava/src/com/google/common/collect/TreeMultimap.java b/guava/src/com/google/common/collect/TreeMultimap.java index 89b106a1a316..a7b729b90da8 100644 --- a/guava/src/com/google/common/collect/TreeMultimap.java +++ b/guava/src/com/google/common/collect/TreeMultimap.java @@ -164,7 +164,9 @@ public Comparator valueComparator() { return valueComparator; } - /** @since 14.0 (present with return type {@code SortedSet} since 2.0) */ + /** + * @since 14.0 (present with return type {@code SortedSet} since 2.0) + */ @Override @GwtIncompatible // NavigableSet public NavigableSet get(@ParametricNullness K key) { diff --git a/guava/src/com/google/common/eventbus/SubscriberExceptionContext.java b/guava/src/com/google/common/eventbus/SubscriberExceptionContext.java index c7a755b09407..f6beaad511d7 100644 --- a/guava/src/com/google/common/eventbus/SubscriberExceptionContext.java +++ b/guava/src/com/google/common/eventbus/SubscriberExceptionContext.java @@ -52,17 +52,23 @@ public EventBus getEventBus() { return eventBus; } - /** @return The event object that caused the subscriber to throw. */ + /** + * @return The event object that caused the subscriber to throw. + */ public Object getEvent() { return event; } - /** @return The object context that the subscriber was called on. */ + /** + * @return The object context that the subscriber was called on. + */ public Object getSubscriber() { return subscriber; } - /** @return The subscribed method that threw the exception. */ + /** + * @return The subscribed method that threw the exception. + */ public Method getSubscriberMethod() { return subscriberMethod; } diff --git a/guava/src/com/google/common/eventbus/SubscriberExceptionHandler.java b/guava/src/com/google/common/eventbus/SubscriberExceptionHandler.java index 47b6f014dbf4..c239ad74fc87 100644 --- a/guava/src/com/google/common/eventbus/SubscriberExceptionHandler.java +++ b/guava/src/com/google/common/eventbus/SubscriberExceptionHandler.java @@ -14,7 +14,6 @@ package com.google.common.eventbus; - /** * Handler for exceptions thrown by event subscribers. * diff --git a/guava/src/com/google/common/graph/DirectedGraphConnections.java b/guava/src/com/google/common/graph/DirectedGraphConnections.java index 43b69d137b0d..5864835cb476 100644 --- a/guava/src/com/google/common/graph/DirectedGraphConnections.java +++ b/guava/src/com/google/common/graph/DirectedGraphConnections.java @@ -169,10 +169,10 @@ static DirectedGraphConnections of(ElementOrder incidentEdgeOrde } return new DirectedGraphConnections<>( - /* adjacentNodeValues = */ new HashMap(initialCapacity, INNER_LOAD_FACTOR), + /* adjacentNodeValues= */ new HashMap(initialCapacity, INNER_LOAD_FACTOR), orderedNodeConnections, - /* predecessorCount = */ 0, - /* successorCount = */ 0); + /* predecessorCount= */ 0, + /* successorCount= */ 0); } static DirectedGraphConnections ofImmutable( diff --git a/guava/src/com/google/common/graph/GraphConstants.java b/guava/src/com/google/common/graph/GraphConstants.java index f0e9013444cb..8ede199e5a29 100644 --- a/guava/src/com/google/common/graph/GraphConstants.java +++ b/guava/src/com/google/common/graph/GraphConstants.java @@ -16,7 +16,6 @@ package com.google.common.graph; - /** A utility class to hold various constants used by the Guava Graph library. */ final class GraphConstants { diff --git a/guava/src/com/google/common/graph/ValueGraphBuilder.java b/guava/src/com/google/common/graph/ValueGraphBuilder.java index 65658b951355..0d32004b2707 100644 --- a/guava/src/com/google/common/graph/ValueGraphBuilder.java +++ b/guava/src/com/google/common/graph/ValueGraphBuilder.java @@ -181,6 +181,7 @@ public ValueGraphBuilder incidentEdgeOrder( newBuilder.incidentEdgeOrder = checkNotNull(incidentEdgeOrder); return newBuilder; } + /** * Returns an empty {@link MutableValueGraph} with the properties of this {@link * ValueGraphBuilder}. diff --git a/guava/src/com/google/common/io/LineBuffer.java b/guava/src/com/google/common/io/LineBuffer.java index 83029d5183f3..ab376ee570a0 100644 --- a/guava/src/com/google/common/io/LineBuffer.java +++ b/guava/src/com/google/common/io/LineBuffer.java @@ -35,6 +35,7 @@ abstract class LineBuffer { /** Holds partial line contents. */ private StringBuilder line = new StringBuilder(); + /** Whether a line ending with a CR is pending processing. */ private boolean sawReturn; diff --git a/guava/src/com/google/common/io/ReaderInputStream.java b/guava/src/com/google/common/io/ReaderInputStream.java index 3a804b170de8..386bad6f3397 100644 --- a/guava/src/com/google/common/io/ReaderInputStream.java +++ b/guava/src/com/google/common/io/ReaderInputStream.java @@ -67,8 +67,10 @@ final class ReaderInputStream extends InputStream { /** Whether we've finished reading the reader. */ private boolean endOfInput; + /** Whether we're copying encoded bytes to the caller's buffer. */ private boolean draining; + /** Whether we've successfully flushed the encoder. */ private boolean doneFlushing; diff --git a/guava/src/com/google/common/math/BigIntegerMath.java b/guava/src/com/google/common/math/BigIntegerMath.java index 204ac38874d9..7220596ae3a9 100644 --- a/guava/src/com/google/common/math/BigIntegerMath.java +++ b/guava/src/com/google/common/math/BigIntegerMath.java @@ -185,7 +185,7 @@ public static int log10(BigInteger x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(floorCmp == 0); - // fall through + // fall through case FLOOR: case DOWN: return floorLog; diff --git a/guava/src/com/google/common/math/DoubleMath.java b/guava/src/com/google/common/math/DoubleMath.java index 5729f829826f..86ac100efc8c 100644 --- a/guava/src/com/google/common/math/DoubleMath.java +++ b/guava/src/com/google/common/math/DoubleMath.java @@ -251,7 +251,7 @@ public static int log2(double x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(isPowerOfTwo(x)); - // fall through + // fall through case FLOOR: increment = false; break; diff --git a/guava/src/com/google/common/math/IntMath.java b/guava/src/com/google/common/math/IntMath.java index 44c7d67accf6..ad2323a60988 100644 --- a/guava/src/com/google/common/math/IntMath.java +++ b/guava/src/com/google/common/math/IntMath.java @@ -117,7 +117,7 @@ public static int log2(int x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(isPowerOfTwo(x)); - // fall through + // fall through case DOWN: case FLOOR: return (Integer.SIZE - 1) - Integer.numberOfLeadingZeros(x); @@ -158,7 +158,7 @@ public static int log10(int x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(x == floorPow); - // fall through + // fall through case FLOOR: case DOWN: return logFloor; @@ -331,7 +331,7 @@ public static int divide(int p, int q, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(rem == 0); - // fall through + // fall through case DOWN: increment = false; break; diff --git a/guava/src/com/google/common/math/LongMath.java b/guava/src/com/google/common/math/LongMath.java index 31907d66adbd..b83fa1bede1d 100644 --- a/guava/src/com/google/common/math/LongMath.java +++ b/guava/src/com/google/common/math/LongMath.java @@ -119,7 +119,7 @@ public static int log2(long x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(isPowerOfTwo(x)); - // fall through + // fall through case DOWN: case FLOOR: return (Long.SIZE - 1) - Long.numberOfLeadingZeros(x); @@ -161,7 +161,7 @@ public static int log10(long x, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(x == floorPow); - // fall through + // fall through case FLOOR: case DOWN: return logFloor; @@ -394,7 +394,7 @@ public static long divide(long p, long q, RoundingMode mode) { switch (mode) { case UNNECESSARY: checkRoundingUnnecessary(rem == 0); - // fall through + // fall through case DOWN: increment = false; break; @@ -958,6 +958,7 @@ static long multiplyFraction(long x, long numerator, long denominator) { 61, 61 }; + // These values were generated by using checkedMultiply to see when the simple multiply/divide // algorithm would lead to an overflow. diff --git a/guava/src/com/google/common/net/HttpHeaders.java b/guava/src/com/google/common/net/HttpHeaders.java index df6ac99c39c8..4d2c0d0f5df4 100644 --- a/guava/src/com/google/common/net/HttpHeaders.java +++ b/guava/src/com/google/common/net/HttpHeaders.java @@ -38,16 +38,22 @@ private HttpHeaders() {} /** The HTTP {@code Cache-Control} header field name. */ public static final String CACHE_CONTROL = "Cache-Control"; + /** The HTTP {@code Content-Length} header field name. */ public static final String CONTENT_LENGTH = "Content-Length"; + /** The HTTP {@code Content-Type} header field name. */ public static final String CONTENT_TYPE = "Content-Type"; + /** The HTTP {@code Date} header field name. */ public static final String DATE = "Date"; + /** The HTTP {@code Pragma} header field name. */ public static final String PRAGMA = "Pragma"; + /** The HTTP {@code Via} header field name. */ public static final String VIA = "Via"; + /** The HTTP {@code Warning} header field name. */ public static final String WARNING = "Warning"; @@ -55,22 +61,31 @@ private HttpHeaders() {} /** The HTTP {@code Accept} header field name. */ public static final String ACCEPT = "Accept"; + /** The HTTP {@code Accept-Charset} header field name. */ public static final String ACCEPT_CHARSET = "Accept-Charset"; + /** The HTTP {@code Accept-Encoding} header field name. */ public static final String ACCEPT_ENCODING = "Accept-Encoding"; + /** The HTTP {@code Accept-Language} header field name. */ public static final String ACCEPT_LANGUAGE = "Accept-Language"; + /** The HTTP {@code Access-Control-Request-Headers} header field name. */ public static final String ACCESS_CONTROL_REQUEST_HEADERS = "Access-Control-Request-Headers"; + /** The HTTP {@code Access-Control-Request-Method} header field name. */ public static final String ACCESS_CONTROL_REQUEST_METHOD = "Access-Control-Request-Method"; + /** The HTTP {@code Authorization} header field name. */ public static final String AUTHORIZATION = "Authorization"; + /** The HTTP {@code Connection} header field name. */ public static final String CONNECTION = "Connection"; + /** The HTTP {@code Cookie} header field name. */ public static final String COOKIE = "Cookie"; + /** * The HTTP {@code * Cross-Origin-Resource-Policy} header field name. @@ -89,6 +104,7 @@ private HttpHeaders() {} /** The HTTP {@code Expect} header field name. */ public static final String EXPECT = "Expect"; + /** The HTTP {@code From} header field name. */ public static final String FROM = "From"; @@ -106,6 +122,7 @@ private HttpHeaders() {} * @since 17.0 */ public static final String FOLLOW_ONLY_WHEN_PRERENDER_SHOWN = "Follow-Only-When-Prerender-Shown"; + /** The HTTP {@code Host} header field name. */ public static final String HOST = "Host"; @@ -119,20 +136,28 @@ private HttpHeaders() {} /** The HTTP {@code If-Match} header field name. */ public static final String IF_MATCH = "If-Match"; + /** The HTTP {@code If-Modified-Since} header field name. */ public static final String IF_MODIFIED_SINCE = "If-Modified-Since"; + /** The HTTP {@code If-None-Match} header field name. */ public static final String IF_NONE_MATCH = "If-None-Match"; + /** The HTTP {@code If-Range} header field name. */ public static final String IF_RANGE = "If-Range"; + /** The HTTP {@code If-Unmodified-Since} header field name. */ public static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since"; + /** The HTTP {@code Last-Event-ID} header field name. */ public static final String LAST_EVENT_ID = "Last-Event-ID"; + /** The HTTP {@code Max-Forwards} header field name. */ public static final String MAX_FORWARDS = "Max-Forwards"; + /** The HTTP {@code Origin} header field name. */ public static final String ORIGIN = "Origin"; + /** * The HTTP {@code Origin-Isolation} header * field name. @@ -140,12 +165,16 @@ private HttpHeaders() {} * @since 30.1 */ public static final String ORIGIN_ISOLATION = "Origin-Isolation"; + /** The HTTP {@code Proxy-Authorization} header field name. */ public static final String PROXY_AUTHORIZATION = "Proxy-Authorization"; + /** The HTTP {@code Range} header field name. */ public static final String RANGE = "Range"; + /** The HTTP {@code Referer} header field name. */ public static final String REFERER = "Referer"; + /** * The HTTP {@code Referrer-Policy} header * field name. @@ -180,10 +209,13 @@ private ReferrerPolicyValues() {} * @since 20.0 */ public static final String SERVICE_WORKER = "Service-Worker"; + /** The HTTP {@code TE} header field name. */ public static final String TE = "TE"; + /** The HTTP {@code Upgrade} header field name. */ public static final String UPGRADE = "Upgrade"; + /** * The HTTP {@code * Upgrade-Insecure-Requests} header field name. @@ -199,12 +231,16 @@ private ReferrerPolicyValues() {} /** The HTTP {@code Accept-Ranges} header field name. */ public static final String ACCEPT_RANGES = "Accept-Ranges"; + /** The HTTP {@code Access-Control-Allow-Headers} header field name. */ public static final String ACCESS_CONTROL_ALLOW_HEADERS = "Access-Control-Allow-Headers"; + /** The HTTP {@code Access-Control-Allow-Methods} header field name. */ public static final String ACCESS_CONTROL_ALLOW_METHODS = "Access-Control-Allow-Methods"; + /** The HTTP {@code Access-Control-Allow-Origin} header field name. */ public static final String ACCESS_CONTROL_ALLOW_ORIGIN = "Access-Control-Allow-Origin"; + /** * The HTTP {@code * Access-Control-Allow-Private-Network} header field name. @@ -213,28 +249,40 @@ private ReferrerPolicyValues() {} */ public static final String ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK = "Access-Control-Allow-Private-Network"; + /** The HTTP {@code Access-Control-Allow-Credentials} header field name. */ public static final String ACCESS_CONTROL_ALLOW_CREDENTIALS = "Access-Control-Allow-Credentials"; + /** The HTTP {@code Access-Control-Expose-Headers} header field name. */ public static final String ACCESS_CONTROL_EXPOSE_HEADERS = "Access-Control-Expose-Headers"; + /** The HTTP {@code Access-Control-Max-Age} header field name. */ public static final String ACCESS_CONTROL_MAX_AGE = "Access-Control-Max-Age"; + /** The HTTP {@code Age} header field name. */ public static final String AGE = "Age"; + /** The HTTP {@code Allow} header field name. */ public static final String ALLOW = "Allow"; + /** The HTTP {@code Content-Disposition} header field name. */ public static final String CONTENT_DISPOSITION = "Content-Disposition"; + /** The HTTP {@code Content-Encoding} header field name. */ public static final String CONTENT_ENCODING = "Content-Encoding"; + /** The HTTP {@code Content-Language} header field name. */ public static final String CONTENT_LANGUAGE = "Content-Language"; + /** The HTTP {@code Content-Location} header field name. */ public static final String CONTENT_LOCATION = "Content-Location"; + /** The HTTP {@code Content-MD5} header field name. */ public static final String CONTENT_MD5 = "Content-MD5"; + /** The HTTP {@code Content-Range} header field name. */ public static final String CONTENT_RANGE = "Content-Range"; + /** * The HTTP {@code * Content-Security-Policy} header field name. @@ -242,6 +290,7 @@ private ReferrerPolicyValues() {} * @since 15.0 */ public static final String CONTENT_SECURITY_POLICY = "Content-Security-Policy"; + /** * The HTTP * {@code Content-Security-Policy-Report-Only} header field name. @@ -250,6 +299,7 @@ private ReferrerPolicyValues() {} */ public static final String CONTENT_SECURITY_POLICY_REPORT_ONLY = "Content-Security-Policy-Report-Only"; + /** * The HTTP nonstandard {@code X-Content-Security-Policy} header field name. It was introduced in * CSP v.1 and used by the Firefox until @@ -259,6 +309,7 @@ private ReferrerPolicyValues() {} * @since 20.0 */ public static final String X_CONTENT_SECURITY_POLICY = "X-Content-Security-Policy"; + /** * The HTTP nonstandard {@code X-Content-Security-Policy-Report-Only} header field name. It was * introduced in CSP v.1 and used by the @@ -269,6 +320,7 @@ private ReferrerPolicyValues() {} */ public static final String X_CONTENT_SECURITY_POLICY_REPORT_ONLY = "X-Content-Security-Policy-Report-Only"; + /** * The HTTP nonstandard {@code X-WebKit-CSP} header field name. It was introduced in CSP v.1 and used by the Chrome until @@ -277,6 +329,7 @@ private ReferrerPolicyValues() {} * @since 20.0 */ public static final String X_WEBKIT_CSP = "X-WebKit-CSP"; + /** * The HTTP nonstandard {@code X-WebKit-CSP-Report-Only} header field name. It was introduced in * CSP v.1 and used by the Chrome until @@ -285,6 +338,7 @@ private ReferrerPolicyValues() {} * @since 20.0 */ public static final String X_WEBKIT_CSP_REPORT_ONLY = "X-WebKit-CSP-Report-Only"; + /** * The HTTP {@code * Cross-Origin-Embedder-Policy} header field name. @@ -292,6 +346,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String CROSS_ORIGIN_EMBEDDER_POLICY = "Cross-Origin-Embedder-Policy"; + /** * The HTTP {@code * Cross-Origin-Embedder-Policy-Report-Only} header field name. @@ -300,28 +355,36 @@ private ReferrerPolicyValues() {} */ public static final String CROSS_ORIGIN_EMBEDDER_POLICY_REPORT_ONLY = "Cross-Origin-Embedder-Policy-Report-Only"; + /** * The HTTP Cross-Origin-Opener-Policy header field name. * * @since 28.2 */ public static final String CROSS_ORIGIN_OPENER_POLICY = "Cross-Origin-Opener-Policy"; + /** The HTTP {@code ETag} header field name. */ public static final String ETAG = "ETag"; + /** The HTTP {@code Expires} header field name. */ public static final String EXPIRES = "Expires"; + /** The HTTP {@code Last-Modified} header field name. */ public static final String LAST_MODIFIED = "Last-Modified"; + /** The HTTP {@code Link} header field name. */ public static final String LINK = "Link"; + /** The HTTP {@code Location} header field name. */ public static final String LOCATION = "Location"; + /** * The HTTP {@code Keep-Alive} header field name. * * @since 31.0 */ public static final String KEEP_ALIVE = "Keep-Alive"; + /** * The HTTP {@code * No-Vary-Seearch} header field name. @@ -329,6 +392,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String NO_VARY_SEARCH = "No-Vary-Search"; + /** * The HTTP {@code Origin-Trial} * header field name. @@ -336,22 +400,29 @@ private ReferrerPolicyValues() {} * @since 27.1 */ public static final String ORIGIN_TRIAL = "Origin-Trial"; + /** The HTTP {@code P3P} header field name. Limited browser support. */ public static final String P3P = "P3P"; + /** The HTTP {@code Proxy-Authenticate} header field name. */ public static final String PROXY_AUTHENTICATE = "Proxy-Authenticate"; + /** The HTTP {@code Refresh} header field name. Non-standard header supported by most browsers. */ public static final String REFRESH = "Refresh"; + /** * The HTTP {@code Report-To} header field name. * * @since 27.1 */ public static final String REPORT_TO = "Report-To"; + /** The HTTP {@code Retry-After} header field name. */ public static final String RETRY_AFTER = "Retry-After"; + /** The HTTP {@code Server} header field name. */ public static final String SERVER = "Server"; + /** * The HTTP {@code Server-Timing} header field * name. @@ -359,6 +430,7 @@ private ReferrerPolicyValues() {} * @since 23.6 */ public static final String SERVER_TIMING = "Server-Timing"; + /** * The HTTP {@code * Service-Worker-Allowed} header field name. @@ -366,8 +438,10 @@ private ReferrerPolicyValues() {} * @since 20.0 */ public static final String SERVICE_WORKER_ALLOWED = "Service-Worker-Allowed"; + /** The HTTP {@code Set-Cookie} header field name. */ public static final String SET_COOKIE = "Set-Cookie"; + /** The HTTP {@code Set-Cookie2} header field name. */ public static final String SET_COOKIE2 = "Set-Cookie2"; @@ -396,6 +470,7 @@ private ReferrerPolicyValues() {} * @since 15.0 */ public static final String STRICT_TRANSPORT_SECURITY = "Strict-Transport-Security"; + /** * The HTTP {@code * Timing-Allow-Origin} header field name. @@ -403,12 +478,16 @@ private ReferrerPolicyValues() {} * @since 15.0 */ public static final String TIMING_ALLOW_ORIGIN = "Timing-Allow-Origin"; + /** The HTTP {@code Trailer} header field name. */ public static final String TRAILER = "Trailer"; + /** The HTTP {@code Transfer-Encoding} header field name. */ public static final String TRANSFER_ENCODING = "Transfer-Encoding"; + /** The HTTP {@code Vary} header field name. */ public static final String VARY = "Vary"; + /** The HTTP {@code WWW-Authenticate} header field name. */ public static final String WWW_AUTHENTICATE = "WWW-Authenticate"; @@ -416,8 +495,10 @@ private ReferrerPolicyValues() {} /** The HTTP {@code DNT} header field name. */ public static final String DNT = "DNT"; + /** The HTTP {@code X-Content-Type-Options} header field name. */ public static final String X_CONTENT_TYPE_OPTIONS = "X-Content-Type-Options"; + /** * The HTTP {@code @@ -427,6 +508,7 @@ private ReferrerPolicyValues() {} * @since 31.0 */ public static final String X_DEVICE_IP = "X-Device-IP"; + /** * The HTTP {@code @@ -437,6 +519,7 @@ private ReferrerPolicyValues() {} * @since 31.0 */ public static final String X_DEVICE_REFERER = "X-Device-Referer"; + /** * The HTTP {@code @@ -447,6 +530,7 @@ private ReferrerPolicyValues() {} * @since 31.0 */ public static final String X_DEVICE_ACCEPT_LANGUAGE = "X-Device-Accept-Language"; + /** * The HTTP {@code @@ -457,10 +541,13 @@ private ReferrerPolicyValues() {} * @since 31.0 */ public static final String X_DEVICE_REQUESTED_WITH = "X-Device-Requested-With"; + /** The HTTP {@code X-Do-Not-Track} header field name. */ public static final String X_DO_NOT_TRACK = "X-Do-Not-Track"; + /** The HTTP {@code X-Forwarded-For} header field name (superseded by {@code Forwarded}). */ public static final String X_FORWARDED_FOR = "X-Forwarded-For"; + /** The HTTP {@code X-Forwarded-Proto} header field name. */ public static final String X_FORWARDED_PROTO = "X-Forwarded-Proto"; @@ -484,8 +571,10 @@ private ReferrerPolicyValues() {} /** The HTTP {@code X-Frame-Options} header field name. */ public static final String X_FRAME_OPTIONS = "X-Frame-Options"; + /** The HTTP {@code X-Powered-By} header field name. */ public static final String X_POWERED_BY = "X-Powered-By"; + /** * The HTTP {@code * Public-Key-Pins} header field name. @@ -493,6 +582,7 @@ private ReferrerPolicyValues() {} * @since 15.0 */ public static final String PUBLIC_KEY_PINS = "Public-Key-Pins"; + /** * The HTTP {@code * Public-Key-Pins-Report-Only} header field name. @@ -500,14 +590,17 @@ private ReferrerPolicyValues() {} * @since 15.0 */ public static final String PUBLIC_KEY_PINS_REPORT_ONLY = "Public-Key-Pins-Report-Only"; + /** * The HTTP {@code X-Request-ID} header field name. * * @since 30.1 */ public static final String X_REQUEST_ID = "X-Request-ID"; + /** The HTTP {@code X-Requested-With} header field name. */ public static final String X_REQUESTED_WITH = "X-Requested-With"; + /** The HTTP {@code X-User-IP} header field name. */ public static final String X_USER_IP = "X-User-IP"; @@ -526,6 +619,7 @@ private ReferrerPolicyValues() {} /** The HTTP {@code X-XSS-Protection} header field name. */ public static final String X_XSS_PROTECTION = "X-XSS-Protection"; + /** * The HTTP {@code @@ -533,6 +627,7 @@ private ReferrerPolicyValues() {} * By default, DNS prefetching is "on" for HTTP pages and "off" for HTTPS pages. */ public static final String X_DNS_PREFETCH_CONTROL = "X-DNS-Prefetch-Control"; + /** * The HTTP * {@code Ping-From} header field name. @@ -540,6 +635,7 @@ private ReferrerPolicyValues() {} * @since 19.0 */ public static final String PING_FROM = "Ping-From"; + /** * The HTTP * {@code Ping-To} header field name. @@ -556,6 +652,7 @@ private ReferrerPolicyValues() {} * @since 28.0 */ public static final String PURPOSE = "Purpose"; + /** * The HTTP {@code @@ -564,6 +661,7 @@ private ReferrerPolicyValues() {} * @since 28.0 */ public static final String X_PURPOSE = "X-Purpose"; + /** * The HTTP {@code @@ -667,6 +765,7 @@ private ReferrerPolicyValues() {} * @since 31.0 */ public static final String ACCEPT_CH = "Accept-CH"; + /** * The HTTP {@code @@ -683,6 +782,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA = "Sec-CH-UA"; + /** * The HTTP {@code * Sec-CH-UA-Arch} header field name. @@ -690,6 +790,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA_ARCH = "Sec-CH-UA-Arch"; + /** * The HTTP {@code * Sec-CH-UA-Model} header field name. @@ -697,6 +798,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA_MODEL = "Sec-CH-UA-Model"; + /** * The HTTP {@code * Sec-CH-UA-Platform} header field name. @@ -704,6 +806,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA_PLATFORM = "Sec-CH-UA-Platform"; + /** * The HTTP {@code * Sec-CH-UA-Platform-Version} header field name. @@ -711,6 +814,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA_PLATFORM_VERSION = "Sec-CH-UA-Platform-Version"; + /** * The HTTP {@code * Sec-CH-UA-Full-Version} header field name. @@ -719,6 +823,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ @Deprecated public static final String SEC_CH_UA_FULL_VERSION = "Sec-CH-UA-Full-Version"; + /** * The HTTP {@code * Sec-CH-UA-Full-Version} header field name. @@ -726,6 +831,7 @@ private ReferrerPolicyValues() {} * @since 31.1 */ public static final String SEC_CH_UA_FULL_VERSION_LIST = "Sec-CH-UA-Full-Version-List"; + /** * The HTTP {@code * Sec-CH-UA-Mobile} header field name. @@ -733,6 +839,7 @@ private ReferrerPolicyValues() {} * @since 30.0 */ public static final String SEC_CH_UA_MOBILE = "Sec-CH-UA-Mobile"; + /** * The HTTP {@code * Sec-CH-UA-WoW64} header field name. @@ -740,6 +847,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String SEC_CH_UA_WOW64 = "Sec-CH-UA-WoW64"; + /** * The HTTP {@code * Sec-CH-UA-Bitness} header field name. @@ -773,6 +881,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String SEC_CH_VIEWPORT_WIDTH = "Sec-CH-Viewport-Width"; + /** * The HTTP {@code @@ -781,6 +890,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String SEC_CH_VIEWPORT_HEIGHT = "Sec-CH-Viewport-Height"; + /** * The HTTP {@code * Sec-CH-DPR} header field name. @@ -788,6 +898,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String SEC_CH_DPR = "Sec-CH-DPR"; + /** * The HTTP {@code Sec-Fetch-Dest} * header field name. @@ -795,6 +906,7 @@ private ReferrerPolicyValues() {} * @since 27.1 */ public static final String SEC_FETCH_DEST = "Sec-Fetch-Dest"; + /** * The HTTP {@code Sec-Fetch-Mode} * header field name. @@ -802,6 +914,7 @@ private ReferrerPolicyValues() {} * @since 27.1 */ public static final String SEC_FETCH_MODE = "Sec-Fetch-Mode"; + /** * The HTTP {@code Sec-Fetch-Site} * header field name. @@ -809,6 +922,7 @@ private ReferrerPolicyValues() {} * @since 27.1 */ public static final String SEC_FETCH_SITE = "Sec-Fetch-Site"; + /** * The HTTP {@code Sec-Fetch-User} * header field name. @@ -816,6 +930,7 @@ private ReferrerPolicyValues() {} * @since 27.1 */ public static final String SEC_FETCH_USER = "Sec-Fetch-User"; + /** * The HTTP {@code Sec-Metadata} * header field name. @@ -895,6 +1010,7 @@ private ReferrerPolicyValues() {} * @since 32.0.0 */ public static final String SEC_BROWSING_TOPICS = "Sec-Browsing-Topics"; + /** * The HTTP {@code * Observe-Browsing-Topics} header field name. diff --git a/guava/src/com/google/common/net/InetAddresses.java b/guava/src/com/google/common/net/InetAddresses.java index 4cb146ca0c25..bbfb1e5367d8 100644 --- a/guava/src/com/google/common/net/InetAddresses.java +++ b/guava/src/com/google/common/net/InetAddresses.java @@ -1094,6 +1094,7 @@ public static Inet4Address fromInteger(int address) { public static Inet4Address fromIPv4BigInteger(BigInteger address) { return (Inet4Address) fromBigInteger(address, false); } + /** * Returns the {@code Inet6Address} corresponding to a given {@code BigInteger}. * diff --git a/guava/src/com/google/common/reflect/Parameter.java b/guava/src/com/google/common/reflect/Parameter.java index 1f35aa71f08d..250c7e0c454e 100644 --- a/guava/src/com/google/common/reflect/Parameter.java +++ b/guava/src/com/google/common/reflect/Parameter.java @@ -98,7 +98,9 @@ public A[] getAnnotationsByType(Class annotationType) return getDeclaredAnnotationsByType(annotationType); } - /** @since 18.0 */ + /** + * @since 18.0 + */ @Override public Annotation[] getDeclaredAnnotations() { return annotations.toArray(new Annotation[0]); @@ -118,8 +120,8 @@ public Annotation[] getDeclaredAnnotations() { */ @Override public A[] getDeclaredAnnotationsByType(Class annotationType) { - @Nullable - A[] result = FluentIterable.from(annotations).filter(annotationType).toArray(annotationType); + @Nullable A[] result = + FluentIterable.from(annotations).filter(annotationType).toArray(annotationType); @SuppressWarnings("nullness") // safe because the input list contains no nulls A[] cast = (A[]) result; return cast; diff --git a/guava/src/com/google/common/util/concurrent/AbstractExecutionThreadService.java b/guava/src/com/google/common/util/concurrent/AbstractExecutionThreadService.java index 7e011b9d909a..9df033f91f81 100644 --- a/guava/src/com/google/common/util/concurrent/AbstractExecutionThreadService.java +++ b/guava/src/com/google/common/util/concurrent/AbstractExecutionThreadService.java @@ -161,19 +161,25 @@ public final State state() { return delegate.state(); } - /** @since 13.0 */ + /** + * @since 13.0 + */ @Override public final void addListener(Listener listener, Executor executor) { delegate.addListener(listener, executor); } - /** @since 14.0 */ + /** + * @since 14.0 + */ @Override public final Throwable failureCause() { return delegate.failureCause(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service startAsync() { @@ -181,7 +187,9 @@ public final Service startAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service stopAsync() { @@ -189,37 +197,49 @@ public final Service stopAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning() { delegate.awaitRunning(); } - /** @since 28.0 */ + /** + * @since 28.0 + */ @Override public final void awaitRunning(Duration timeout) throws TimeoutException { Service.super.awaitRunning(timeout); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitRunning(timeout, unit); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated() { delegate.awaitTerminated(); } - /** @since 28.0 */ + /** + * @since 28.0 + */ @Override public final void awaitTerminated(Duration timeout) throws TimeoutException { Service.super.awaitTerminated(timeout); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitTerminated(timeout, unit); diff --git a/guava/src/com/google/common/util/concurrent/AbstractFuture.java b/guava/src/com/google/common/util/concurrent/AbstractFuture.java index 5759ac5d0778..8feee33f4bf7 100644 --- a/guava/src/com/google/common/util/concurrent/AbstractFuture.java +++ b/guava/src/com/google/common/util/concurrent/AbstractFuture.java @@ -842,7 +842,7 @@ public void addListener(Runnable listener, Executor executor) { protected boolean set(@ParametricNullness V value) { Object valueToSet = value == null ? NULL : value; if (ATOMIC_HELPER.casValue(this, null, valueToSet)) { - complete(this, /*callInterruptTask=*/ false); + complete(this, /* callInterruptTask= */ false); return true; } return false; @@ -867,7 +867,7 @@ protected boolean set(@ParametricNullness V value) { protected boolean setException(Throwable throwable) { Object valueToSet = new Failure(checkNotNull(throwable)); if (ATOMIC_HELPER.casValue(this, null, valueToSet)) { - complete(this, /*callInterruptTask=*/ false); + complete(this, /* callInterruptTask= */ false); return true; } return false; diff --git a/guava/src/com/google/common/util/concurrent/AbstractIdleService.java b/guava/src/com/google/common/util/concurrent/AbstractIdleService.java index ae25c4acb3ed..2be821d13a1e 100644 --- a/guava/src/com/google/common/util/concurrent/AbstractIdleService.java +++ b/guava/src/com/google/common/util/concurrent/AbstractIdleService.java @@ -125,19 +125,25 @@ public final State state() { return delegate.state(); } - /** @since 13.0 */ + /** + * @since 13.0 + */ @Override public final void addListener(Listener listener, Executor executor) { delegate.addListener(listener, executor); } - /** @since 14.0 */ + /** + * @since 14.0 + */ @Override public final Throwable failureCause() { return delegate.failureCause(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service startAsync() { @@ -145,7 +151,9 @@ public final Service startAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service stopAsync() { @@ -153,37 +161,49 @@ public final Service stopAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning() { delegate.awaitRunning(); } - /** @since 28.0 */ + /** + * @since 28.0 + */ @Override public final void awaitRunning(Duration timeout) throws TimeoutException { Service.super.awaitRunning(timeout); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitRunning(timeout, unit); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated() { delegate.awaitTerminated(); } - /** @since 28.0 */ + /** + * @since 28.0 + */ @Override public final void awaitTerminated(Duration timeout) throws TimeoutException { Service.super.awaitTerminated(timeout); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitTerminated(timeout, unit); diff --git a/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java b/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java index e12223c1b26c..fd07d4d2fa44 100644 --- a/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java +++ b/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java @@ -420,19 +420,25 @@ public final State state() { return delegate.state(); } - /** @since 13.0 */ + /** + * @since 13.0 + */ @Override public final void addListener(Listener listener, Executor executor) { delegate.addListener(listener, executor); } - /** @since 14.0 */ + /** + * @since 14.0 + */ @Override public final Throwable failureCause() { return delegate.failureCause(); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service startAsync() { @@ -440,7 +446,9 @@ public final Service startAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @CanIgnoreReturnValue @Override public final Service stopAsync() { @@ -448,37 +456,49 @@ public final Service stopAsync() { return this; } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning() { delegate.awaitRunning(); } - /** @since 28.0 */ + /** + * @since 28.0 + */ @Override public final void awaitRunning(Duration timeout) throws TimeoutException { Service.super.awaitRunning(timeout); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitRunning(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitRunning(timeout, unit); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated() { delegate.awaitTerminated(); } - /** @since 28.0 */ + /** + * @since 28.0 + */ @Override public final void awaitTerminated(Duration timeout) throws TimeoutException { Service.super.awaitTerminated(timeout); } - /** @since 15.0 */ + /** + * @since 15.0 + */ @Override public final void awaitTerminated(long timeout, TimeUnit unit) throws TimeoutException { delegate.awaitTerminated(timeout, unit); diff --git a/guava/src/com/google/common/util/concurrent/AbstractService.java b/guava/src/com/google/common/util/concurrent/AbstractService.java index 32a07e622378..921eaccf00c8 100644 --- a/guava/src/com/google/common/util/concurrent/AbstractService.java +++ b/guava/src/com/google/common/util/concurrent/AbstractService.java @@ -310,7 +310,9 @@ public final void awaitRunning() { } } - /** @since 28.0 */ + /** + * @since 28.0 + */ @Override public final void awaitRunning(Duration timeout) throws TimeoutException { Service.super.awaitRunning(timeout); @@ -343,7 +345,9 @@ public final void awaitTerminated() { } } - /** @since 28.0 */ + /** + * @since 28.0 + */ @Override public final void awaitTerminated(Duration timeout) throws TimeoutException { Service.super.awaitTerminated(timeout); @@ -492,13 +496,17 @@ public final State state() { return snapshot.externalState(); } - /** @since 14.0 */ + /** + * @since 14.0 + */ @Override public final Throwable failureCause() { return snapshot.failureCause(); } - /** @since 13.0 */ + /** + * @since 13.0 + */ @Override public final void addListener(Listener listener, Executor executor) { listeners.addListener(listener, executor); @@ -615,7 +623,9 @@ private static final class StateSnapshot { this.failure = failure; } - /** @see Service#state() */ + /** + * @see Service#state() + */ State externalState() { if (shutdownWhenStartupFinishes && state == STARTING) { return STOPPING; @@ -624,7 +634,9 @@ State externalState() { } } - /** @see Service#failureCause() */ + /** + * @see Service#failureCause() + */ Throwable failureCause() { checkState( state == FAILED, diff --git a/guava/src/com/google/common/util/concurrent/ClosingFuture.java b/guava/src/com/google/common/util/concurrent/ClosingFuture.java index e34f5381ee32..56819c213d41 100644 --- a/guava/src/com/google/common/util/concurrent/ClosingFuture.java +++ b/guava/src/com/google/common/util/concurrent/ClosingFuture.java @@ -1379,7 +1379,6 @@ public String toString() { : Futures.whenAllComplete(inputFutures()); } - private ImmutableList> inputFutures() { return FluentIterable.from(inputs) .>transform(future -> future.future) diff --git a/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java b/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java index 8cd223e3b669..12de35eaff01 100644 --- a/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java +++ b/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java @@ -563,10 +563,14 @@ public String getMessage() { */ private interface CycleDetectingLock { - /** @return the {@link LockGraphNode} associated with this lock. */ + /** + * @return the {@link LockGraphNode} associated with this lock. + */ LockGraphNode getLockGraphNode(); - /** @return {@code true} if the current thread has acquired this lock. */ + /** + * @return {@code true} if the current thread has acquired this lock. + */ boolean isAcquiredByCurrentThread(); } diff --git a/guava/src/com/google/common/util/concurrent/InterruptibleTask.java b/guava/src/com/google/common/util/concurrent/InterruptibleTask.java index a85abb2bc25e..9191436088ab 100644 --- a/guava/src/com/google/common/util/concurrent/InterruptibleTask.java +++ b/guava/src/com/google/common/util/concurrent/InterruptibleTask.java @@ -45,6 +45,7 @@ private static final class DoNothingRunnable implements Runnable { @Override public void run() {} } + // The thread executing the task publishes itself to the superclass' reference and the thread // interrupting sets DONE when it has finished interrupting. private static final Runnable DONE = new DoNothingRunnable(); diff --git a/guava/src/com/google/common/util/concurrent/ListeningScheduledExecutorService.java b/guava/src/com/google/common/util/concurrent/ListeningScheduledExecutorService.java index 06507b038b7c..3476ee5e57fa 100644 --- a/guava/src/com/google/common/util/concurrent/ListeningScheduledExecutorService.java +++ b/guava/src/com/google/common/util/concurrent/ListeningScheduledExecutorService.java @@ -38,7 +38,9 @@ public interface ListeningScheduledExecutorService extends ScheduledExecutorService, ListeningExecutorService { - /** @since 15.0 (previously returned ScheduledFuture) */ + /** + * @since 15.0 (previously returned ScheduledFuture) + */ @Override ListenableScheduledFuture schedule(Runnable command, long delay, TimeUnit unit); @@ -51,7 +53,9 @@ default ListenableScheduledFuture schedule(Runnable command, Duration delay) return schedule(command, toNanosSaturated(delay), TimeUnit.NANOSECONDS); } - /** @since 15.0 (previously returned ScheduledFuture) */ + /** + * @since 15.0 (previously returned ScheduledFuture) + */ @Override ListenableScheduledFuture schedule( Callable callable, long delay, TimeUnit unit); @@ -66,7 +70,9 @@ default ListenableScheduledFuture schedule(Runnable command, Duration delay) return schedule(callable, toNanosSaturated(delay), TimeUnit.NANOSECONDS); } - /** @since 15.0 (previously returned ScheduledFuture) */ + /** + * @since 15.0 (previously returned ScheduledFuture) + */ @Override ListenableScheduledFuture scheduleAtFixedRate( Runnable command, long initialDelay, long period, TimeUnit unit); @@ -82,7 +88,9 @@ default ListenableScheduledFuture scheduleAtFixedRate( command, toNanosSaturated(initialDelay), toNanosSaturated(period), TimeUnit.NANOSECONDS); } - /** @since 15.0 (previously returned ScheduledFuture) */ + /** + * @since 15.0 (previously returned ScheduledFuture) + */ @Override ListenableScheduledFuture scheduleWithFixedDelay( Runnable command, long initialDelay, long delay, TimeUnit unit); diff --git a/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java b/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java index 6d1bdbdd7b4f..24fcf5d489dd 100644 --- a/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java +++ b/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java @@ -205,6 +205,7 @@ abstract class SmoothRateLimiter extends RateLimiter { */ static final class SmoothWarmingUp extends SmoothRateLimiter { private final long warmupPeriodMicros; + /** * The slope of the line from the stable interval (when permits == 0), to the cold interval * (when permits == maxPermits) diff --git a/guava/src/com/google/common/util/concurrent/Striped.java b/guava/src/com/google/common/util/concurrent/Striped.java index 0ab7d43388db..3391e209b3eb 100644 --- a/guava/src/com/google/common/util/concurrent/Striped.java +++ b/guava/src/com/google/common/util/concurrent/Striped.java @@ -278,6 +278,7 @@ public static Striped readWriteLock(int stripes) { public static Striped lazyWeakReadWriteLock(int stripes) { return lazyWeakCustom(stripes, WeakSafeReadWriteLock::new); } + /** * ReadWriteLock implementation whose read and write locks retain a reference back to this lock. * Otherwise, a reference to just the read lock or just the write lock would not suffice to ensure