Skip to content

Commit c4965e4

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
RELNOTES=n/a PiperOrigin-RevId: 728791732
1 parent 7d73105 commit c4965e4

File tree

103 files changed

+482
-522
lines changed

Some content is hidden

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

103 files changed

+482
-522
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ private void compareResultsForThisListOfStimuli() {
368368
}
369369

370370
private static List<Object> subListCopy(Object[] source, int size) {
371-
final Object[] copy = new Object[size];
371+
Object[] copy = new Object[size];
372372
arraycopy(source, 0, copy, 0, size);
373373
return asList(copy);
374374
}
@@ -479,7 +479,7 @@ private <T extends Iterator<E>> void internalExecuteAndCompare(
479479
};
480480

481481
private final IteratorOperation newAddMethod() {
482-
final Object toInsert = elementsToInsert.next();
482+
Object toInsert = elementsToInsert.next();
483483
return new IteratorOperation() {
484484
@Override
485485
public @Nullable Object execute(Iterator<?> iterator) {
@@ -492,7 +492,7 @@ private final IteratorOperation newAddMethod() {
492492
}
493493

494494
private final IteratorOperation newSetMethod() {
495-
final E toInsert = elementsToInsert.next();
495+
E toInsert = elementsToInsert.next();
496496
return new IteratorOperation() {
497497
@Override
498498
public @Nullable Object execute(Iterator<?> iterator) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public Test testsForAbstractList() {
275275
return ListTestSuiteBuilder.using(
276276
new TestStringListGenerator() {
277277
@Override
278-
protected List<String> create(final String[] elements) {
278+
protected List<String> create(String[] elements) {
279279
return new AbstractList<String>() {
280280
@Override
281281
public int size() {
@@ -300,9 +300,9 @@ public Test testsForAbstractSequentialList() {
300300
return ListTestSuiteBuilder.using(
301301
new TestStringListGenerator() {
302302
@Override
303-
protected List<String> create(final String[] elements) {
303+
protected List<String> create(String[] elements) {
304304
// For this test we trust ArrayList works
305-
final List<String> list = new ArrayList<>();
305+
List<String> list = new ArrayList<>();
306306
Collections.addAll(list, elements);
307307
return new AbstractSequentialList<String>() {
308308
@Override

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public Test testsForAbstractSet() {
351351
new TestStringSetGenerator() {
352352
@Override
353353
protected Set<String> create(String[] elements) {
354-
final String[] deduped = dedupe(elements);
354+
String[] deduped = dedupe(elements);
355355
return new AbstractSet<String>() {
356356
@Override
357357
public int size() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ private static <T> void setImplementation(Class<T> type, Class<? extends T> impl
365365
if (Modifier.isAbstract(type.getModifiers()) || !Modifier.isPublic(type.getModifiers())) {
366366
return arbitraryConstantInstanceOrNull(type);
367367
}
368-
final Constructor<T> constructor;
368+
Constructor<T> constructor;
369369
try {
370370
constructor = type.getConstructor();
371371
} catch (NoSuchMethodException e) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ public FactoryMethodReturnValueTester testEqualsAndSerializable() throws Excepti
570570
}
571571
}
572572

573-
private void testEqualsUsing(final Invokable<?, ?> factory)
573+
private void testEqualsUsing(Invokable<?, ?> factory)
574574
throws ParameterNotInstantiableException,
575575
ParameterHasNoDistinctValueException,
576576
IllegalAccessException,
@@ -587,7 +587,7 @@ private void testEqualsUsing(final Invokable<?, ?> factory)
587587
Object instance = createInstance(factory, args);
588588
List<Object> equalArgs = generateEqualFactoryArguments(factory, params, args);
589589
// Each group is a List of items, each item has a list of factory args.
590-
final List<List<List<Object>>> argGroups = Lists.newArrayList();
590+
List<List<List<Object>>> argGroups = Lists.newArrayList();
591591
argGroups.add(ImmutableList.of(args, equalArgs));
592592
EqualsTester tester =
593593
new EqualsTester(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ final <T> void addSampleInstances(Class<T> type, Iterable<? extends T> instances
193193
return Primitives.wrap(type).cast(generateFresh(TypeToken.of(type)));
194194
}
195195

196-
final <T> T newFreshProxy(final Class<T> interfaceType) {
196+
final <T> T newFreshProxy(Class<T> interfaceType) {
197197
T proxy = newProxy(interfaceType);
198198
freshness.incrementAndGet();
199199
return proxy;
@@ -268,7 +268,7 @@ final <T> T newFreshProxy(final Class<T> interfaceType) {
268268
return ArbitraryInstances.get(rawType);
269269
}
270270

271-
private <T> T newProxy(final Class<T> interfaceType) {
271+
private <T> T newProxy(Class<T> interfaceType) {
272272
return Reflection.newProxy(interfaceType, new FreshInvocationHandler(interfaceType));
273273
}
274274

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ private void testParameter(
451451
}
452452

453453
private <F, T> Converter<F, T> defaultConverter(
454-
final TypeToken<F> convertFromType, final TypeToken<T> convertToType) {
454+
TypeToken<F> convertFromType, TypeToken<T> convertToType) {
455455
return new Converter<F, T>() {
456456
@Override
457457
protected T doForward(F a) {
@@ -477,7 +477,7 @@ private static TypeToken<?> getFirstTypeParameter(Type type) {
477477
}
478478
}
479479

480-
private <T> T newDefaultReturningProxy(final TypeToken<T> type) {
480+
private <T> T newDefaultReturningProxy(TypeToken<T> type) {
481481
return new DummyProxy() {
482482
@Override
483483
<R> @Nullable R dummyReturnValue(TypeToken<R> returnType) {

android/guava/src/com/google/common/base/CharMatcher.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public static CharMatcher singleWidth() {
294294
// Static factories
295295

296296
/** Returns a {@code char} matcher that matches only one specified BMP character. */
297-
public static CharMatcher is(final char match) {
297+
public static CharMatcher is(char match) {
298298
return new Is(match);
299299
}
300300

@@ -303,15 +303,15 @@ public static CharMatcher is(final char match) {
303303
*
304304
* <p>To negate another {@code CharMatcher}, use {@link #negate()}.
305305
*/
306-
public static CharMatcher isNot(final char match) {
306+
public static CharMatcher isNot(char match) {
307307
return new IsNot(match);
308308
}
309309

310310
/**
311311
* Returns a {@code char} matcher that matches any BMP character present in the given character
312312
* sequence. Returns a bogus matcher if the sequence contains supplementary characters.
313313
*/
314-
public static CharMatcher anyOf(final CharSequence sequence) {
314+
public static CharMatcher anyOf(CharSequence sequence) {
315315
switch (sequence.length()) {
316316
case 0:
317317
return none();
@@ -341,15 +341,15 @@ public static CharMatcher noneOf(CharSequence sequence) {
341341
*
342342
* @throws IllegalArgumentException if {@code endInclusive < startInclusive}
343343
*/
344-
public static CharMatcher inRange(final char startInclusive, final char endInclusive) {
344+
public static CharMatcher inRange(char startInclusive, char endInclusive) {
345345
return new InRange(startInclusive, endInclusive);
346346
}
347347

348348
/**
349349
* Returns a matcher with identical behavior to the given {@link Character}-based predicate, but
350350
* which operates on primitive {@code char} instances instead.
351351
*/
352-
public static CharMatcher forPredicate(final Predicate<? super Character> predicate) {
352+
public static CharMatcher forPredicate(Predicate<? super Character> predicate) {
353353
return predicate instanceof CharMatcher ? (CharMatcher) predicate : new ForPredicate(predicate);
354354
}
355355

@@ -416,7 +416,7 @@ public CharMatcher precomputed() {
416416
*/
417417
@GwtIncompatible // SmallCharMatcher
418418
CharMatcher precomputedInternal() {
419-
final BitSet table = new BitSet();
419+
BitSet table = new BitSet();
420420
setBits(table);
421421
int totalCharacters = table.cardinality();
422422
if (totalCharacters * 2 <= DISTINCT_CHARS) {
@@ -426,7 +426,7 @@ CharMatcher precomputedInternal() {
426426
table.flip(Character.MIN_VALUE, Character.MAX_VALUE + 1);
427427
int negatedCharacters = DISTINCT_CHARS - totalCharacters;
428428
String suffix = ".negate()";
429-
final String description = toString();
429+
String description = toString();
430430
String negatedDescription =
431431
description.endsWith(suffix)
432432
? description.substring(0, description.length() - suffix.length())

android/guava/src/com/google/common/base/Optional.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public java.util.Optional<T> toJavaUtil() {
351351
* @since 11.0 (generics widened in 13.0)
352352
*/
353353
public static <T> Iterable<T> presentInstances(
354-
final Iterable<? extends Optional<? extends T>> optionals) {
354+
Iterable<? extends Optional<? extends T>> optionals) {
355355
checkNotNull(optionals);
356356
return () ->
357357
new AbstractIterator<T>() {

android/guava/src/com/google/common/base/Splitter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public static Splitter on(char separator) {
137137
* separator
138138
* @return a splitter, with default settings, that uses this matcher
139139
*/
140-
public static Splitter on(final CharMatcher separatorMatcher) {
140+
public static Splitter on(CharMatcher separatorMatcher) {
141141
checkNotNull(separatorMatcher);
142142

143143
return new Splitter(
@@ -163,7 +163,7 @@ int separatorEnd(int separatorPosition) {
163163
* @param separator the literal, nonempty string to recognize as a separator
164164
* @return a splitter, with default settings, that recognizes that separator
165165
*/
166-
public static Splitter on(final String separator) {
166+
public static Splitter on(String separator) {
167167
checkArgument(separator.length() != 0, "The separator may not be the empty string.");
168168
if (separator.length() == 1) {
169169
return Splitter.on(separator.charAt(0));
@@ -210,15 +210,15 @@ public static Splitter on(Pattern separatorPattern) {
210210
}
211211

212212
/** Internal utility; see {@link #on(Pattern)} instead. */
213-
static Splitter onPatternInternal(final CommonPattern separatorPattern) {
213+
static Splitter onPatternInternal(CommonPattern separatorPattern) {
214214
checkArgument(
215215
!separatorPattern.matcher("").matches(),
216216
"The pattern may not match the empty string: %s",
217217
separatorPattern);
218218

219219
return new Splitter(
220220
(splitter, toSplit) -> {
221-
final CommonMatcher matcher = separatorPattern.matcher(toSplit);
221+
CommonMatcher matcher = separatorPattern.matcher(toSplit);
222222
return new SplittingIterator(splitter, toSplit) {
223223
@Override
224224
public int separatorStart(int start) {
@@ -268,7 +268,7 @@ public static Splitter onPattern(String separatorPattern) {
268268
* @return a splitter, with default settings, that can split into fixed sized pieces
269269
* @throws IllegalArgumentException if {@code length} is zero or negative
270270
*/
271-
public static Splitter fixedLength(final int length) {
271+
public static Splitter fixedLength(int length) {
272272
checkArgument(length > 0, "The length may not be less than 1");
273273

274274
return new Splitter(
@@ -365,7 +365,7 @@ public Splitter trimResults(CharMatcher trimmer) {
365365
* @param sequence the sequence of characters to split
366366
* @return an iteration over the segments split from the parameter
367367
*/
368-
public Iterable<String> split(final CharSequence sequence) {
368+
public Iterable<String> split(CharSequence sequence) {
369369
checkNotNull(sequence);
370370

371371
return new Iterable<String>() {

0 commit comments

Comments
 (0)