Skip to content

Commit 176cf74

Browse files
cpovirkGoogle Java Core Libraries
authored and
Google Java Core Libraries
committed
Reformat.
RELNOTES=n/a PiperOrigin-RevId: 716870912
1 parent a3d5c96 commit 176cf74

File tree

151 files changed

+966
-348
lines changed

Some content is hidden

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

151 files changed

+966
-348
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,16 @@ protected Collection<E> resetContainer(Collection<E> newContents) {
5353
return collection;
5454
}
5555

56-
/** @see AbstractContainerTester#resetContainer() */
56+
/**
57+
* @see AbstractContainerTester#resetContainer()
58+
*/
5759
protected void resetCollection() {
5860
resetContainer();
5961
}
6062

61-
/** @return an array of the proper size with {@code null} inserted into the middle element. */
63+
/**
64+
* @return an array of the proper size with {@code null} inserted into the middle element.
65+
*/
6266
protected E[] createArrayWithNullElement() {
6367
E[] array = createSamplesArray();
6468
array[getNullLocation()] = null;

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ protected Collection<Entry<K, V>> actualContents() {
5656
return getMap().entrySet();
5757
}
5858

59-
/** @see AbstractContainerTester#resetContainer() */
59+
/**
60+
* @see AbstractContainerTester#resetContainer()
61+
*/
6062
protected final void resetMap() {
6163
resetContainer();
6264
}
@@ -77,7 +79,9 @@ protected void expectMissingValues(V... elements) {
7779
}
7880
}
7981

80-
/** @return an array of the proper size with {@code null} as the key of the middle element. */
82+
/**
83+
* @return an array of the proper size with {@code null} as the key of the middle element.
84+
*/
8185
protected Entry<K, V>[] createArrayWithNullKey() {
8286
Entry<K, V>[] array = createSamplesArray();
8387
int nullKeyLocation = getNullLocation();
@@ -102,7 +106,9 @@ private Entry<K, V> getEntryNullReplaces() {
102106
return entries.next();
103107
}
104108

105-
/** @return an array of the proper size with {@code null} as the value of the middle element. */
109+
/**
110+
* @return an array of the proper size with {@code null} as the value of the middle element.
111+
*/
106112
protected Entry<K, V>[] createArrayWithNullValue() {
107113
Entry<K, V>[] array = createSamplesArray();
108114
int nullValueLocation = getNullLocation();

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

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ public void testNulls(Class<?> cls) {
203203
}
204204

205205
void doTestNulls(Class<?> cls, Visibility visibility)
206-
throws ParameterNotInstantiableException, IllegalAccessException, InvocationTargetException,
206+
throws ParameterNotInstantiableException,
207+
IllegalAccessException,
208+
InvocationTargetException,
207209
FactoryMethodReturnsNullException {
208210
if (!Modifier.isAbstract(cls.getModifiers())) {
209211
nullPointerTester.testConstructors(cls, visibility);
@@ -295,8 +297,11 @@ public void testEquals(Class<?> cls) {
295297
}
296298

297299
void doTestEquals(Class<?> cls)
298-
throws ParameterNotInstantiableException, ParameterHasNoDistinctValueException,
299-
IllegalAccessException, InvocationTargetException, FactoryMethodReturnsNullException {
300+
throws ParameterNotInstantiableException,
301+
ParameterHasNoDistinctValueException,
302+
IllegalAccessException,
303+
InvocationTargetException,
304+
FactoryMethodReturnsNullException {
300305
if (cls.isEnum()) {
301306
return;
302307
}
@@ -566,8 +571,11 @@ public FactoryMethodReturnValueTester testEqualsAndSerializable() throws Excepti
566571
}
567572

568573
private void testEqualsUsing(final Invokable<?, ?> factory)
569-
throws ParameterNotInstantiableException, ParameterHasNoDistinctValueException,
570-
IllegalAccessException, InvocationTargetException, FactoryMethodReturnsNullException {
574+
throws ParameterNotInstantiableException,
575+
ParameterHasNoDistinctValueException,
576+
IllegalAccessException,
577+
InvocationTargetException,
578+
FactoryMethodReturnsNullException {
571579
List<Parameter> params = factory.getParameters();
572580
List<FreshValueGenerator> argGenerators = Lists.newArrayListWithCapacity(params.size());
573581
List<@Nullable Object> args = Lists.newArrayListWithCapacity(params.size());
@@ -617,8 +625,10 @@ String reportItem(Item<?> item) {
617625
*/
618626
private List<Object> generateEqualFactoryArguments(
619627
Invokable<?, ?> factory, List<Parameter> params, List<Object> args)
620-
throws ParameterNotInstantiableException, FactoryMethodReturnsNullException,
621-
InvocationTargetException, IllegalAccessException {
628+
throws ParameterNotInstantiableException,
629+
FactoryMethodReturnsNullException,
630+
InvocationTargetException,
631+
IllegalAccessException {
622632
List<Object> equalArgs = Lists.newArrayList(args);
623633
for (int i = 0; i < args.size(); i++) {
624634
Parameter param = params.get(i);

android/guava-tests/benchmark/com/google/common/base/SplitterBenchmark.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class SplitterBenchmark {
3232
// overall size of string
3333
@Param({"1", "10", "100", "1000"})
3434
int length;
35+
3536
// Number of matching strings
3637
@Param({"xxxx", "xxXx", "xXxX", "XXXX"})
3738
String text;

android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ interface ExecutionListWrapper {
5252
void add(Runnable runnable, Executor executor);
5353

5454
void execute();
55+
5556
/** Returns the underlying implementation, useful for the Footprint benchmark. */
5657
Object getImpl();
5758
}

android/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ private enum ExceptionType {
102102
@Param Validator validator;
103103
@Param Result result;
104104
@Param ExceptionType exceptionType;
105+
105106
/**
106107
* The number of other exception types in the cache of known-good exceptions and the number of
107108
* other {@code ClassValue} entries for the exception type to be tested. This lets us evaluate

android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ public class MonitorBasedArrayBlockingQueue<E> extends AbstractQueue<E>
6262

6363
/** The queued items */
6464
final E[] items;
65+
6566
/** items index for next take, poll or remove */
6667
int takeIndex;
68+
6769
/** items index for next put, offer, or add. */
6870
int putIndex;
71+
6972
/** Number of items in the queue */
7073
private int count;
7174

android/guava-tests/test/com/google/common/collect/AbstractImmutableSetTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public void testComplexBuilder() {
389389

390390
public void testBuilderAddHandlesNullsCorrectly() {
391391
{
392-
ImmutableSet.Builder<String> builder = this.<String>builder();
392+
ImmutableSet.Builder<String> builder = this.<String>builder();
393393
assertThrows(NullPointerException.class, () -> builder.add((String) null));
394394
}
395395

@@ -421,7 +421,7 @@ public void testBuilderAddHandlesNullsCorrectly() {
421421

422422
public void testBuilderAddAllHandlesNullsCorrectly() {
423423
{
424-
ImmutableSet.Builder<String> builder = this.<String>builder();
424+
ImmutableSet.Builder<String> builder = this.<String>builder();
425425
assertThrows(NullPointerException.class, () -> builder.addAll((Iterable<String>) null));
426426
}
427427

@@ -432,13 +432,13 @@ public void testBuilderAddAllHandlesNullsCorrectly() {
432432

433433
{
434434
ImmutableSet.Builder<String> builder = this.<String>builder();
435-
List<@Nullable String> listWithNulls = asList("a", null, "b");
435+
List<@Nullable String> listWithNulls = asList("a", null, "b");
436436
assertThrows(NullPointerException.class, () -> builder.addAll((List<String>) listWithNulls));
437437
}
438438

439439
{
440440
ImmutableSet.Builder<String> builder = this.<String>builder();
441-
Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b");
441+
Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b");
442442
assertThrows(
443443
NullPointerException.class, () -> builder.addAll((Iterable<String>) iterableWithNulls));
444444
}

android/guava-tests/test/com/google/common/collect/FilteredMapTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.common.collect;
1818

19-
2019
import com.google.common.annotations.GwtCompatible;
2120
import java.util.Map;
2221
import org.jspecify.annotations.NullMarked;

android/guava-tests/test/com/google/common/collect/ImmutableListTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ public void testBuilderAddHandlesNullsCorrectly() {
567567

568568
public void testBuilderAddAllHandlesNullsCorrectly() {
569569
{
570-
ImmutableList.Builder<String> builder = ImmutableList.builder();
570+
ImmutableList.Builder<String> builder = ImmutableList.builder();
571571
assertThrows(NullPointerException.class, () -> builder.addAll((Iterable<String>) null));
572572
}
573573

@@ -578,21 +578,21 @@ public void testBuilderAddAllHandlesNullsCorrectly() {
578578

579579
{
580580
ImmutableList.Builder<String> builder = ImmutableList.builder();
581-
List<@Nullable String> listWithNulls = asList("a", null, "b");
581+
List<@Nullable String> listWithNulls = asList("a", null, "b");
582582
assertThrows(NullPointerException.class, () -> builder.addAll((List<String>) listWithNulls));
583583
}
584584

585585
{
586586
ImmutableList.Builder<String> builder = ImmutableList.builder();
587-
Iterator<@Nullable String> iteratorWithNulls =
588-
Arrays.<@Nullable String>asList("a", null, "b").iterator();
587+
Iterator<@Nullable String> iteratorWithNulls =
588+
Arrays.<@Nullable String>asList("a", null, "b").iterator();
589589
assertThrows(
590590
NullPointerException.class, () -> builder.addAll((Iterator<String>) iteratorWithNulls));
591591
}
592592

593593
{
594594
ImmutableList.Builder<String> builder = ImmutableList.builder();
595-
Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b");
595+
Iterable<@Nullable String> iterableWithNulls = MinimalIterable.of("a", null, "b");
596596
assertThrows(
597597
NullPointerException.class, () -> builder.addAll((Iterable<String>) iterableWithNulls));
598598
}

android/guava-tests/test/com/google/common/collect/ImmutableMapTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,9 @@ public void testBuilder_keepingLast_thenOrThrow() {
554554
// being true.
555555
Pattern pattern = Pattern.compile("Multiple entries with same key: four=(.*) and four=(.*)");
556556
assertThat(expected).hasMessageThat().matches(pattern);
557-
Matcher matcher = pattern.matcher(expected.getMessage());
558-
assertThat(matcher.matches()).isTrue();
559-
assertThat(matcher.group(1)).isNotEqualTo(matcher.group(2));
557+
Matcher matcher = pattern.matcher(expected.getMessage());
558+
assertThat(matcher.matches()).isTrue();
559+
assertThat(matcher.group(1)).isNotEqualTo(matcher.group(2));
560560
}
561561

562562
public void testOf() {

android/guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,20 +404,20 @@ public void testBuilderAddHandlesNullsCorrectly() {
404404

405405
public void testBuilderAddAllHandlesNullsCorrectly() {
406406
{
407-
ImmutableMultiset.Builder<String> builder = ImmutableMultiset.builder();
407+
ImmutableMultiset.Builder<String> builder = ImmutableMultiset.builder();
408408
assertThrows(NullPointerException.class, () -> builder.addAll((Collection<String>) null));
409409
}
410410

411411
{
412412
ImmutableMultiset.Builder<String> builder = ImmutableMultiset.builder();
413-
List<@Nullable String> listWithNulls = asList("a", null, "b");
413+
List<@Nullable String> listWithNulls = asList("a", null, "b");
414414
assertThrows(NullPointerException.class, () -> builder.addAll((List<String>) listWithNulls));
415415
}
416416

417417
{
418418
ImmutableMultiset.Builder<String> builder = ImmutableMultiset.builder();
419-
Multiset<@Nullable String> multisetWithNull =
420-
LinkedHashMultiset.create(Arrays.<@Nullable String>asList("a", null, "b"));
419+
Multiset<@Nullable String> multisetWithNull =
420+
LinkedHashMultiset.create(Arrays.<@Nullable String>asList("a", null, "b"));
421421
assertThrows(
422422
NullPointerException.class, () -> builder.addAll((Multiset<String>) multisetWithNull));
423423
}

android/guava-tests/test/com/google/common/collect/IterablesTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,9 @@ public void testGetLast_withDefault_multiple() {
838838
* need to prove that it isn't called.
839839
*/
840840
private static class DiesOnIteratorArrayList extends ArrayList<String> {
841-
/** @throws UnsupportedOperationException all the time */
841+
/**
842+
* @throws UnsupportedOperationException all the time
843+
*/
842844
@Override
843845
public Iterator<String> iterator() {
844846
throw new UnsupportedOperationException();

android/guava-tests/test/com/google/common/collect/MapsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,12 +1412,12 @@ public void testUnmodifiableNavigableMap() {
14121412
iterator.remove();
14131413
});
14141414
{
1415-
Entry<Integer, String> entry = entries.iterator().next();
1415+
Entry<Integer, String> entry = entries.iterator().next();
14161416
assertThrows(UnsupportedOperationException.class, () -> entry.setValue("four"));
14171417
}
14181418
{
14191419
Entry<Integer, String> entry = unmod.lowerEntry(1);
1420-
assertNull(entry);
1420+
assertNull(entry);
14211421
}
14221422
{
14231423
Entry<Integer, String> entry = unmod.floorEntry(2);

android/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ public void testFalsePositivesForNextEscapedIndex() {
151151
protected char @Nullable [] escape(int cp) {
152152
return ('a' <= cp && cp <= 'z') ? new char[] {Character.toUpperCase((char) cp)} : null;
153153
}
154+
154155
// Inefficient implementation that defines all letters as escapable.
155156
@Override
156157
protected int nextEscapeIndex(CharSequence csq, int index, int end) {

android/guava-tests/test/com/google/common/graph/TestUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static void assertNodeNotInGraphErrorMessage(Throwable throwable) {
4545
assertThat(throwable).hasMessageThat().startsWith(NODE_STRING);
4646
assertThat(throwable).hasMessageThat().contains(ERROR_ELEMENT_NOT_IN_GRAPH);
4747
}
48-
48+
4949
static void assertEdgeNotInGraphErrorMessage(Throwable throwable) {
5050
assertThat(throwable).hasMessageThat().startsWith(EDGE_STRING);
5151
assertThat(throwable).hasMessageThat().contains(ERROR_ELEMENT_NOT_IN_GRAPH);

android/guava-tests/test/com/google/common/math/IntMathTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public void testFloorPowerOfTwoZero() {
9898
@GwtIncompatible // BigIntegerMath // TODO(cpovirk): GWT-enable BigIntegerMath
9999
public void testConstantMaxPowerOfSqrt2Unsigned() {
100100
assertEquals(
101-
/*expected=*/ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Integer.SIZE - 1), FLOOR)
101+
/* expected= */ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Integer.SIZE - 1), FLOOR)
102102
.intValue(),
103-
/*actual=*/ IntMath.MAX_POWER_OF_SQRT2_UNSIGNED);
103+
/* actual= */ IntMath.MAX_POWER_OF_SQRT2_UNSIGNED);
104104
}
105105

106106
@GwtIncompatible // pow()
@@ -148,8 +148,8 @@ public void testConstantsBiggestBinomials() {
148148
@GwtIncompatible // sqrt
149149
public void testPowersSqrtMaxInt() {
150150
assertEquals(
151-
/*expected=*/ IntMath.sqrt(Integer.MAX_VALUE, FLOOR),
152-
/*actual=*/ IntMath.FLOOR_SQRT_MAX_INT);
151+
/* expected= */ IntMath.sqrt(Integer.MAX_VALUE, FLOOR),
152+
/* actual= */ IntMath.FLOOR_SQRT_MAX_INT);
153153
}
154154

155155
@AndroidIncompatible // presumably slow

android/guava-tests/test/com/google/common/math/LongMathTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ public void testFloorPowerOfTwoZero() {
9999
@GwtIncompatible // TODO
100100
public void testConstantMaxPowerOfSqrt2Unsigned() {
101101
assertEquals(
102-
/*expected=*/ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Long.SIZE - 1), FLOOR)
102+
/* expected= */ BigIntegerMath.sqrt(BigInteger.ZERO.setBit(2 * Long.SIZE - 1), FLOOR)
103103
.longValue(),
104-
/*actual=*/ LongMath.MAX_POWER_OF_SQRT2_UNSIGNED);
104+
/* actual= */ LongMath.MAX_POWER_OF_SQRT2_UNSIGNED);
105105
}
106106

107107
@GwtIncompatible // BigIntegerMath // TODO(cpovirk): GWT-enable BigIntegerMath
@@ -137,8 +137,8 @@ public void testConstantsHalfPowersOf10() {
137137
@GwtIncompatible // TODO
138138
public void testConstantsSqrtMaxLong() {
139139
assertEquals(
140-
/*expected=*/ LongMath.sqrt(Long.MAX_VALUE, FLOOR),
141-
/*actual=*/ LongMath.FLOOR_SQRT_MAX_LONG);
140+
/* expected= */ LongMath.sqrt(Long.MAX_VALUE, FLOOR),
141+
/* actual= */ LongMath.FLOOR_SQRT_MAX_LONG);
142142
}
143143

144144
@GwtIncompatible // TODO

android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ public void testValueOfLong() {
106106
}
107107
}
108108

109-
110109
public void testValueOfBigInteger() {
111110
BigInteger min = BigInteger.ZERO;
112111
BigInteger max = UnsignedLong.MAX_VALUE.bigIntegerValue();

android/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public void testImmediateCancelledFutureStack() throws Exception {
194194
assertThrows(CancellationException.class, () -> CallerClass2.get(future));
195195
List<StackTraceElement> stackTrace = ImmutableList.copyOf(expected.getStackTrace());
196196
assertFalse(Iterables.any(stackTrace, hasClassName(CallerClass1.class)));
197-
assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class)));
197+
assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class)));
198198

199199
// See AbstractFutureCancellationCauseTest for how to set causes.
200200
assertThat(expected).hasCauseThat().isNull();
@@ -2253,7 +2253,7 @@ public void testAllAsList_logging_error() throws Exception {
22532253
() -> getDone(allAsList(immediateFailedFuture(new SomeError()))));
22542254
assertThat(expected).hasCauseThat().isInstanceOf(SomeError.class);
22552255
List<LogRecord> logged = aggregateFutureLogHandler.getStoredLogRecords();
2256-
assertThat(logged).hasSize(1); // errors are always logged
2256+
assertThat(logged).hasSize(1); // errors are always logged
22572257
assertThat(logged.get(0).getThrown()).isInstanceOf(SomeError.class);
22582258
}
22592259

@@ -2269,8 +2269,8 @@ public void testAllAsList_logging_multipleExceptions_alreadyDone() throws Except
22692269
immediateFailedFuture(new MyException()))));
22702270
assertThat(expected).hasCauseThat().isInstanceOf(MyException.class);
22712271
List<LogRecord> logged = aggregateFutureLogHandler.getStoredLogRecords();
2272-
assertThat(logged).hasSize(1); // the second failure is logged
2273-
assertThat(logged.get(0).getThrown()).isInstanceOf(MyException.class);
2272+
assertThat(logged).hasSize(1); // the second failure is logged
2273+
assertThat(logged.get(0).getThrown()).isInstanceOf(MyException.class);
22742274
}
22752275

22762276
/** All as list will log extra exceptions that occur later. */

android/guava-tests/test/com/google/common/util/concurrent/TrustedInputFutureTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.common.util.concurrent;
1818

19-
2019
import com.google.common.annotations.GwtCompatible;
2120
import com.google.common.util.concurrent.AbstractFuture.TrustedFuture;
2221
import org.jspecify.annotations.NullUnmarked;

android/guava-tests/test/com/google/common/util/concurrent/UntrustedInputFutureTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.common.util.concurrent;
1818

19-
2019
import com.google.common.annotations.GwtCompatible;
2120
import com.google.common.util.concurrent.AbstractFuture.TrustedFuture;
2221
import org.jspecify.annotations.NullUnmarked;

0 commit comments

Comments
 (0)