From f09c017033417cc50b047d607f5917fff39ca0dd Mon Sep 17 00:00:00 2001 From: cushon Date: Mon, 4 Feb 2019 11:07:18 -0800 Subject: [PATCH] Reformat with google-java-format RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=232329476 --- .../collect/BinaryTreeTraverserBenchmark.java | 1 - .../com/google/common/base/StringsTest.java | 3 +- .../common/collect/CompactHashMapTest.java | 37 +++++----- .../common/collect/CompactHashSetTest.java | 71 +++++++++++-------- .../collect/CompactLinkedHashMapTest.java | 44 ++++++------ .../collect/CompactLinkedHashSetTest.java | 39 +++++----- .../common/collect/ForwardingMapTest.java | 12 ++-- .../common/graph/AbstractNetworkTest.java | 2 +- .../graph/ConfigurableDirectedGraphTest.java | 5 +- .../ConfigurableUndirectedGraphTest.java | 5 +- .../common/reflect/TypeTokenSubtypeTest.java | 52 +++++++------- .../concurrent/InterruptibleTaskTest.java | 4 +- .../common/util/concurrent/StripedTest.java | 28 ++++---- .../collect/BinaryTreeTraverserBenchmark.java | 1 - .../com/google/common/base/StringsTest.java | 3 +- .../cache/LocalCacheMapComputeTest.java | 14 +++- .../common/collect/CompactHashMapTest.java | 37 +++++----- .../common/collect/CompactHashSetTest.java | 71 +++++++++++-------- .../collect/CompactLinkedHashMapTest.java | 44 ++++++------ .../collect/CompactLinkedHashSetTest.java | 39 +++++----- .../common/collect/ForwardingMapTest.java | 12 ++-- .../common/collect/ImmutableBiMapTest.java | 6 +- .../common/graph/AbstractNetworkTest.java | 2 +- .../graph/ConfigurableDirectedGraphTest.java | 5 +- .../ConfigurableUndirectedGraphTest.java | 5 +- .../common/reflect/TypeTokenSubtypeTest.java | 52 +++++++------- .../concurrent/InterruptibleTaskTest.java | 4 +- .../common/util/concurrent/StripedTest.java | 28 ++++---- 28 files changed, 337 insertions(+), 289 deletions(-) diff --git a/android/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java b/android/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java index 2fd21e978346..75fc1f90d2ef 100644 --- a/android/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java +++ b/android/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java @@ -18,7 +18,6 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import com.google.common.base.Optional; -import com.google.common.collect.ImmutableList; import com.google.common.primitives.Ints; import java.util.List; import java.util.Random; diff --git a/android/guava-tests/test/com/google/common/base/StringsTest.java b/android/guava-tests/test/com/google/common/base/StringsTest.java index 8eda06702a1e..ac3ad20a52dc 100644 --- a/android/guava-tests/test/com/google/common/base/StringsTest.java +++ b/android/guava-tests/test/com/google/common/base/StringsTest.java @@ -242,8 +242,7 @@ public void testLenientFormat_badArgumentToString() { public void testLenientFormat_badArgumentToString_gwtFriendly() { assertThat(Strings.lenientFormat("boiler %s plate", new ThrowsOnToString())) - .matches( - "boiler <.*> plate"); + .matches("boiler <.*> plate"); } private static class ThrowsOnToString { diff --git a/android/guava-tests/test/com/google/common/collect/CompactHashMapTest.java b/android/guava-tests/test/com/google/common/collect/CompactHashMapTest.java index 87480d0914b9..33e601556238 100644 --- a/android/guava-tests/test/com/google/common/collect/CompactHashMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/CompactHashMapTest.java @@ -37,22 +37,27 @@ public class CompactHashMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); - suite.addTest(MapTestSuiteBuilder.using(new TestStringMapGenerator() { - @Override - protected Map create(Entry[] entries) { - Map map = CompactHashMap.create(); - for (Entry entry : entries) { - map.put(entry.getKey(), entry.getValue()); - } - return map; - } - }) - .named("CompactHashMap") - .withFeatures( - CollectionSize.ANY, MapFeature.GENERAL_PURPOSE, MapFeature.ALLOWS_NULL_KEYS, - MapFeature.ALLOWS_NULL_VALUES, CollectionFeature.SERIALIZABLE, - CollectionFeature.SUPPORTS_ITERATOR_REMOVE) - .createTestSuite()); + suite.addTest( + MapTestSuiteBuilder.using( + new TestStringMapGenerator() { + @Override + protected Map create(Entry[] entries) { + Map map = CompactHashMap.create(); + for (Entry entry : entries) { + map.put(entry.getKey(), entry.getValue()); + } + return map; + } + }) + .named("CompactHashMap") + .withFeatures( + CollectionSize.ANY, + MapFeature.GENERAL_PURPOSE, + MapFeature.ALLOWS_NULL_KEYS, + MapFeature.ALLOWS_NULL_VALUES, + CollectionFeature.SERIALIZABLE, + CollectionFeature.SUPPORTS_ITERATOR_REMOVE) + .createTestSuite()); suite.addTestSuite(CompactHashMapTest.class); return suite; } diff --git a/android/guava-tests/test/com/google/common/collect/CompactHashSetTest.java b/android/guava-tests/test/com/google/common/collect/CompactHashSetTest.java index 08eabf5523a2..e5c3a458b57e 100644 --- a/android/guava-tests/test/com/google/common/collect/CompactHashSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/CompactHashSetTest.java @@ -37,40 +37,49 @@ @GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array public class CompactHashSetTest extends TestCase { public static Test suite() { - List> allFeatures = Arrays.>asList( - CollectionSize.ANY, - CollectionFeature.ALLOWS_NULL_VALUES, - CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION, - CollectionFeature.GENERAL_PURPOSE, - CollectionFeature.REMOVE_OPERATIONS, - CollectionFeature.SERIALIZABLE, - CollectionFeature.SUPPORTS_ADD, - CollectionFeature.SUPPORTS_REMOVE); + List> allFeatures = + Arrays.>asList( + CollectionSize.ANY, + CollectionFeature.ALLOWS_NULL_VALUES, + CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION, + CollectionFeature.GENERAL_PURPOSE, + CollectionFeature.REMOVE_OPERATIONS, + CollectionFeature.SERIALIZABLE, + CollectionFeature.SUPPORTS_ADD, + CollectionFeature.SUPPORTS_REMOVE); TestSuite suite = new TestSuite(); suite.addTestSuite(CompactHashSetTest.class); - suite.addTest(SetTestSuiteBuilder.using(new TestStringSetGenerator() { - @Override protected Set create(String[] elements) { - return CompactHashSet.create(Arrays.asList(elements)); - } - }).named("CompactHashSet") - .withFeatures(allFeatures) - .createTestSuite()); - suite.addTest(SetTestSuiteBuilder.using(new TestStringSetGenerator() { - @Override protected Set create(String[] elements) { - CompactHashSet set = CompactHashSet.create(Arrays.asList(elements)); - for (int i = 0; i < 100; i++) { - set.add(i); - } - for (int i = 0; i < 100; i++) { - set.remove(i); - } - set.trimToSize(); - return set; - } - }).named("CompactHashSet#TrimToSize") - .withFeatures(allFeatures) - .createTestSuite()); + suite.addTest( + SetTestSuiteBuilder.using( + new TestStringSetGenerator() { + @Override + protected Set create(String[] elements) { + return CompactHashSet.create(Arrays.asList(elements)); + } + }) + .named("CompactHashSet") + .withFeatures(allFeatures) + .createTestSuite()); + suite.addTest( + SetTestSuiteBuilder.using( + new TestStringSetGenerator() { + @Override + protected Set create(String[] elements) { + CompactHashSet set = CompactHashSet.create(Arrays.asList(elements)); + for (int i = 0; i < 100; i++) { + set.add(i); + } + for (int i = 0; i < 100; i++) { + set.remove(i); + } + set.trimToSize(); + return set; + } + }) + .named("CompactHashSet#TrimToSize") + .withFeatures(allFeatures) + .createTestSuite()); return suite; } diff --git a/android/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java b/android/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java index 4235f6bbfa93..f7e28572967a 100644 --- a/android/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java @@ -35,22 +35,28 @@ public class CompactLinkedHashMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); - suite.addTest(MapTestSuiteBuilder.using(new TestStringMapGenerator() { - @Override - protected Map create(Entry[] entries) { - Map map = CompactLinkedHashMap.create(); - for (Entry entry : entries) { - map.put(entry.getKey(), entry.getValue()); - } - return map; - } - }).named("CompactLinkedHashMap").withFeatures(CollectionSize.ANY, - CollectionFeature.SUPPORTS_ITERATOR_REMOVE, - MapFeature.GENERAL_PURPOSE, - MapFeature.ALLOWS_NULL_KEYS, - MapFeature.ALLOWS_NULL_VALUES, - CollectionFeature.SERIALIZABLE, - CollectionFeature.KNOWN_ORDER).createTestSuite()); + suite.addTest( + MapTestSuiteBuilder.using( + new TestStringMapGenerator() { + @Override + protected Map create(Entry[] entries) { + Map map = CompactLinkedHashMap.create(); + for (Entry entry : entries) { + map.put(entry.getKey(), entry.getValue()); + } + return map; + } + }) + .named("CompactLinkedHashMap") + .withFeatures( + CollectionSize.ANY, + CollectionFeature.SUPPORTS_ITERATOR_REMOVE, + MapFeature.GENERAL_PURPOSE, + MapFeature.ALLOWS_NULL_KEYS, + MapFeature.ALLOWS_NULL_VALUES, + CollectionFeature.SERIALIZABLE, + CollectionFeature.KNOWN_ORDER) + .createTestSuite()); suite.addTestSuite(CompactLinkedHashMapTest.class); return suite; } @@ -119,8 +125,7 @@ public void testTrimToSize() { testHasMapEntriesInOrder(map, 1, "a", 4, "b", 3, "d", 2, "c"); } - private void testHasMapEntriesInOrder(Map map, - Object... alternatingKeysAndValues) { + private void testHasMapEntriesInOrder(Map map, Object... alternatingKeysAndValues) { List> entries = Lists.newArrayList(map.entrySet()); List keys = Lists.newArrayList(map.keySet()); List values = Lists.newArrayList(map.values()); @@ -130,8 +135,7 @@ private void testHasMapEntriesInOrder(Map map, for (int i = 0; i < map.size(); i++) { Object expectedKey = alternatingKeysAndValues[2 * i]; Object expectedValue = alternatingKeysAndValues[2 * i + 1]; - Entry expectedEntry = Maps.immutableEntry( - expectedKey, expectedValue); + Entry expectedEntry = Maps.immutableEntry(expectedKey, expectedValue); assertEquals(expectedEntry, entries.get(i)); assertEquals(expectedKey, keys.get(i)); assertEquals(expectedValue, values.get(i)); diff --git a/android/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java b/android/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java index 2e9bad2ad29b..a95e4861c2a2 100644 --- a/android/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java +++ b/android/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java @@ -37,26 +37,31 @@ @GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array public class CompactLinkedHashSetTest extends TestCase { public static Test suite() { - List> allFeatures = Arrays.>asList( - CollectionSize.ANY, - CollectionFeature.ALLOWS_NULL_VALUES, - CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION, - CollectionFeature.GENERAL_PURPOSE, - CollectionFeature.REMOVE_OPERATIONS, - CollectionFeature.SERIALIZABLE, - CollectionFeature.KNOWN_ORDER, - CollectionFeature.SUPPORTS_ADD, - CollectionFeature.SUPPORTS_REMOVE); + List> allFeatures = + Arrays.>asList( + CollectionSize.ANY, + CollectionFeature.ALLOWS_NULL_VALUES, + CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION, + CollectionFeature.GENERAL_PURPOSE, + CollectionFeature.REMOVE_OPERATIONS, + CollectionFeature.SERIALIZABLE, + CollectionFeature.KNOWN_ORDER, + CollectionFeature.SUPPORTS_ADD, + CollectionFeature.SUPPORTS_REMOVE); TestSuite suite = new TestSuite(); suite.addTestSuite(CompactLinkedHashSetTest.class); - suite.addTest(SetTestSuiteBuilder.using(new TestStringSetGenerator() { - @Override protected Set create(String[] elements) { - return CompactLinkedHashSet.create(Arrays.asList(elements)); - } - }).named("CompactLinkedHashSet") - .withFeatures(allFeatures) - .createTestSuite()); + suite.addTest( + SetTestSuiteBuilder.using( + new TestStringSetGenerator() { + @Override + protected Set create(String[] elements) { + return CompactLinkedHashSet.create(Arrays.asList(elements)); + } + }) + .named("CompactLinkedHashSet") + .withFeatures(allFeatures) + .createTestSuite()); return suite; } diff --git a/android/guava-tests/test/com/google/common/collect/ForwardingMapTest.java b/android/guava-tests/test/com/google/common/collect/ForwardingMapTest.java index 62988ed0189c..6ca5b8cc145a 100644 --- a/android/guava-tests/test/com/google/common/collect/ForwardingMapTest.java +++ b/android/guava-tests/test/com/google/common/collect/ForwardingMapTest.java @@ -329,10 +329,11 @@ protected Map delegate() { }; } - private static final ImmutableMap JUF_METHODS = ImmutableMap.of( - "java.util.function.Predicate", "test", - "java.util.function.Consumer", "accept", - "java.util.function.IntFunction", "apply"); + private static final ImmutableMap JUF_METHODS = + ImmutableMap.of( + "java.util.function.Predicate", "test", + "java.util.function.Consumer", "accept", + "java.util.function.IntFunction", "apply"); private static Object getDefaultValue(final TypeToken type) { Class rawType = type.getRawType(); @@ -387,8 +388,7 @@ private static void callAllPublicMethods(TypeToken type, T object) } } } catch (Throwable cause) { - throw new InvocationTargetException( - cause, method + " with args: " + Arrays.toString(args)); + throw new InvocationTargetException(cause, method + " with args: " + Arrays.toString(args)); } } } diff --git a/android/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java b/android/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java index 0a927302d48d..9154a7389077 100644 --- a/android/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java +++ b/android/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java @@ -120,7 +120,7 @@ protected boolean addNode(Integer n) { * add an edge whose end-points don't already exist in the graph), you should not use this * method. * - * TODO(user): remove the addNode() calls, that's now contractually guaranteed + *

TODO(user): remove the addNode() calls, that's now contractually guaranteed * * @return {@code true} iff the graph was modified as a result of this call */ diff --git a/android/guava-tests/test/com/google/common/graph/ConfigurableDirectedGraphTest.java b/android/guava-tests/test/com/google/common/graph/ConfigurableDirectedGraphTest.java index 80533fc10155..ed998eb4226a 100644 --- a/android/guava-tests/test/com/google/common/graph/ConfigurableDirectedGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/ConfigurableDirectedGraphTest.java @@ -59,9 +59,8 @@ public void incidentEdges_selfLoop() { putEdge(N1, N1); assertThat(graph.incidentEdges(N1)).containsExactly(EndpointPair.ordered(N1, N1)); putEdge(N1, N2); - assertThat(graph.incidentEdges(N1)).containsExactly( - EndpointPair.ordered(N1, N1), - EndpointPair.ordered(N1, N2)); + assertThat(graph.incidentEdges(N1)) + .containsExactly(EndpointPair.ordered(N1, N1), EndpointPair.ordered(N1, N2)); } @Test diff --git a/android/guava-tests/test/com/google/common/graph/ConfigurableUndirectedGraphTest.java b/android/guava-tests/test/com/google/common/graph/ConfigurableUndirectedGraphTest.java index 8f8cd13bf08f..3bdfd74d7e26 100644 --- a/android/guava-tests/test/com/google/common/graph/ConfigurableUndirectedGraphTest.java +++ b/android/guava-tests/test/com/google/common/graph/ConfigurableUndirectedGraphTest.java @@ -59,9 +59,8 @@ public void incidentEdges_selfLoop() { putEdge(N1, N1); assertThat(graph.incidentEdges(N1)).containsExactly(EndpointPair.unordered(N1, N1)); putEdge(N1, N2); - assertThat(graph.incidentEdges(N1)).containsExactly( - EndpointPair.unordered(N1, N1), - EndpointPair.unordered(N1, N2)); + assertThat(graph.incidentEdges(N1)) + .containsExactly(EndpointPair.unordered(N1, N1), EndpointPair.unordered(N1, N2)); } @Test diff --git a/android/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java b/android/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java index beb000fdf8a2..0dd2318e9776 100644 --- a/android/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java +++ b/android/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java @@ -93,7 +93,8 @@ abstract class StringList implements List {} try { numberList.getSubtype(StringList.class); fail(); - } catch (IllegalArgumentException expected) {} + } catch (IllegalArgumentException expected) { + } } private static class OwnerTypeSubtypingTests extends SubtypeTester { @@ -230,7 +231,7 @@ private static class RecursiveTypeBoundBugExample> ifYouUseTheTypeVariableOnTheClassAndItIsRecursive( List>> arg) { - return notSubtype(arg); // isSubtype() currently incorectly considers it a subtype. + return notSubtype(arg); // isSubtype() currently incorectly considers it a subtype. } } @@ -275,15 +276,13 @@ public Iterable> listOfEnums(List> listOfEnums) { @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public UseList>>> - wildcardBoundUsesImplicitlyRecursiveBoundedWildcard( - UseList>> arg) { + wildcardBoundUsesImplicitlyRecursiveBoundedWildcard(UseList>> arg) { return isSubtype(arg); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public UseList>>> - wildcardBoundHasImplicitBoundAtsInvariantPosition( - UseList>> arg) { + wildcardBoundHasImplicitBoundAtsInvariantPosition(UseList>> arg) { return isSubtype(arg); } @@ -301,14 +300,14 @@ public Iterable> nestedExplicitEnumBoundIsSubtypeOfImplicitEnumBound( @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>>> - implicitEnumBoundIsSubtypeOfNestedExplicitEnumBound(List> listOfEnums) { + implicitEnumBoundIsSubtypeOfNestedExplicitEnumBound(List> listOfEnums) { return isSubtype(listOfEnums); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>> - listOfEnumsWithImplicitBoundIsSubtypeOfIterableOfEnumWithExplicitBound( - List> listOfEnums) { + listOfEnumsWithImplicitBoundIsSubtypeOfIterableOfEnumWithExplicitBound( + List> listOfEnums) { return isSubtype(listOfEnums); } @@ -326,43 +325,43 @@ public List>> typeVariableBoundOm @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public List> - wildcardUpperBoundIsNotSubtypeOfTypeVariableBound( - List> arg) { + wildcardUpperBoundIsNotSubtypeOfTypeVariableBound( + List> arg) { return notSubtype(arg); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public List>>>> - wildcardBoundUsesParameterizedTypeWithImplicitBound( - List>>> arg) { + wildcardBoundUsesParameterizedTypeWithImplicitBound( + List>>> arg) { return isSubtype(arg); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public List>>>> - wildcardBoundUsesRecursiveParameterizedTypeWithImplicitBound( - List>>> arg) { + wildcardBoundUsesRecursiveParameterizedTypeWithImplicitBound( + List>>> arg) { return isSubtype(arg); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public List>>>> - wildcardBoundUsesParameterizedTypeDefinedWithImplicitBound( - List>>> arg) { + wildcardBoundUsesParameterizedTypeDefinedWithImplicitBound( + List>>> arg) { return isSubtype(arg); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>> - wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyBounded( - List> withImplicitBounds) { + wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyBounded( + List> withImplicitBounds) { return isSubtype(withImplicitBounds); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>> - wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyPartialBounded( - List> withImplicitBounds) { + wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyPartialBounded( + List> withImplicitBounds) { return isSubtype(withImplicitBounds); } @@ -373,23 +372,22 @@ public Iterable>> useListOfIterableWildcard( } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) - public Iterable> - listOfExplicitBoundedIsSubtypeOfListOfImplicitlyBounded( + public Iterable> listOfExplicitBoundedIsSubtypeOfListOfImplicitlyBounded( List>> withExplicitBounds) { return isSubtype(withExplicitBounds); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>> - wildcardOfImplicitBoundedIsNotSubtypeOfNonWildcardOfExplicitlyBounded( - List> withImplicitBounds) { + wildcardOfImplicitBoundedIsNotSubtypeOfNonWildcardOfExplicitlyBounded( + List> withImplicitBounds) { return notSubtype(withImplicitBounds); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>> - wildcardOfImplicitBoundedIsNotSubtypeOfWildcardWithNarrowerBounds( - List> withImplicitBounds) { + wildcardOfImplicitBoundedIsNotSubtypeOfWildcardWithNarrowerBounds( + List> withImplicitBounds) { return notSubtype(withImplicitBounds); } diff --git a/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java b/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java index 4c67d515d7c3..8f91bcc21563 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java @@ -36,7 +36,7 @@ Void runInterruptibly() throws Exception { BrokenChannel bc = new BrokenChannel(); bc.doBegin(); isInterruptibleRegistered.countDown(); - new CountDownLatch(1).await(); // the interrupt will wake us up + new CountDownLatch(1).await(); // the interrupt will wake us up return null; } @@ -95,7 +95,7 @@ Void runInterruptibly() throws Exception { slowChannel.doBegin(); isInterruptibleRegistered.countDown(); try { - new CountDownLatch(1).await(); // the interrupt will wake us up + new CountDownLatch(1).await(); // the interrupt will wake us up } catch (InterruptedException ie) { // continue } diff --git a/android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java b/android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java index 1bd3c95bde8f..9832c30b029c 100644 --- a/android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java +++ b/android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java @@ -50,18 +50,22 @@ private static List> strongImplementations() { Striped.readWriteLock(256), Striped.lock(100), Striped.lock(256), - Striped.custom(100, new Supplier() { - @Override - public Lock get() { - return new ReentrantLock(true); - } - }), - Striped.custom(256, new Supplier() { - @Override - public Lock get() { - return new ReentrantLock(true); - } - }), + Striped.custom( + 100, + new Supplier() { + @Override + public Lock get() { + return new ReentrantLock(true); + } + }), + Striped.custom( + 256, + new Supplier() { + @Override + public Lock get() { + return new ReentrantLock(true); + } + }), Striped.semaphore(100, 1), Striped.semaphore(256, 1)); } diff --git a/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java b/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java index 2fd21e978346..75fc1f90d2ef 100644 --- a/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java +++ b/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java @@ -18,7 +18,6 @@ import com.google.caliper.Benchmark; import com.google.caliper.Param; import com.google.common.base.Optional; -import com.google.common.collect.ImmutableList; import com.google.common.primitives.Ints; import java.util.List; import java.util.Random; diff --git a/guava-tests/test/com/google/common/base/StringsTest.java b/guava-tests/test/com/google/common/base/StringsTest.java index 8eda06702a1e..ac3ad20a52dc 100644 --- a/guava-tests/test/com/google/common/base/StringsTest.java +++ b/guava-tests/test/com/google/common/base/StringsTest.java @@ -242,8 +242,7 @@ public void testLenientFormat_badArgumentToString() { public void testLenientFormat_badArgumentToString_gwtFriendly() { assertThat(Strings.lenientFormat("boiler %s plate", new ThrowsOnToString())) - .matches( - "boiler <.*> plate"); + .matches("boiler <.*> plate"); } private static class ThrowsOnToString { diff --git a/guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java b/guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java index c49b80e1e6bb..2c1e1e8cb4ab 100644 --- a/guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java +++ b/guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java @@ -115,9 +115,17 @@ public void testCompute() { public void testComputeExceptionally() { try { - doParallelCacheOp(count, n -> { - cache.asMap().compute(key, (k, v) -> { throw new RuntimeException(); }); - }); + doParallelCacheOp( + count, + n -> { + cache + .asMap() + .compute( + key, + (k, v) -> { + throw new RuntimeException(); + }); + }); fail("Should not get here"); } catch (RuntimeException ex) { } diff --git a/guava-tests/test/com/google/common/collect/CompactHashMapTest.java b/guava-tests/test/com/google/common/collect/CompactHashMapTest.java index 87480d0914b9..33e601556238 100644 --- a/guava-tests/test/com/google/common/collect/CompactHashMapTest.java +++ b/guava-tests/test/com/google/common/collect/CompactHashMapTest.java @@ -37,22 +37,27 @@ public class CompactHashMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); - suite.addTest(MapTestSuiteBuilder.using(new TestStringMapGenerator() { - @Override - protected Map create(Entry[] entries) { - Map map = CompactHashMap.create(); - for (Entry entry : entries) { - map.put(entry.getKey(), entry.getValue()); - } - return map; - } - }) - .named("CompactHashMap") - .withFeatures( - CollectionSize.ANY, MapFeature.GENERAL_PURPOSE, MapFeature.ALLOWS_NULL_KEYS, - MapFeature.ALLOWS_NULL_VALUES, CollectionFeature.SERIALIZABLE, - CollectionFeature.SUPPORTS_ITERATOR_REMOVE) - .createTestSuite()); + suite.addTest( + MapTestSuiteBuilder.using( + new TestStringMapGenerator() { + @Override + protected Map create(Entry[] entries) { + Map map = CompactHashMap.create(); + for (Entry entry : entries) { + map.put(entry.getKey(), entry.getValue()); + } + return map; + } + }) + .named("CompactHashMap") + .withFeatures( + CollectionSize.ANY, + MapFeature.GENERAL_PURPOSE, + MapFeature.ALLOWS_NULL_KEYS, + MapFeature.ALLOWS_NULL_VALUES, + CollectionFeature.SERIALIZABLE, + CollectionFeature.SUPPORTS_ITERATOR_REMOVE) + .createTestSuite()); suite.addTestSuite(CompactHashMapTest.class); return suite; } diff --git a/guava-tests/test/com/google/common/collect/CompactHashSetTest.java b/guava-tests/test/com/google/common/collect/CompactHashSetTest.java index 08eabf5523a2..e5c3a458b57e 100644 --- a/guava-tests/test/com/google/common/collect/CompactHashSetTest.java +++ b/guava-tests/test/com/google/common/collect/CompactHashSetTest.java @@ -37,40 +37,49 @@ @GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array public class CompactHashSetTest extends TestCase { public static Test suite() { - List> allFeatures = Arrays.>asList( - CollectionSize.ANY, - CollectionFeature.ALLOWS_NULL_VALUES, - CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION, - CollectionFeature.GENERAL_PURPOSE, - CollectionFeature.REMOVE_OPERATIONS, - CollectionFeature.SERIALIZABLE, - CollectionFeature.SUPPORTS_ADD, - CollectionFeature.SUPPORTS_REMOVE); + List> allFeatures = + Arrays.>asList( + CollectionSize.ANY, + CollectionFeature.ALLOWS_NULL_VALUES, + CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION, + CollectionFeature.GENERAL_PURPOSE, + CollectionFeature.REMOVE_OPERATIONS, + CollectionFeature.SERIALIZABLE, + CollectionFeature.SUPPORTS_ADD, + CollectionFeature.SUPPORTS_REMOVE); TestSuite suite = new TestSuite(); suite.addTestSuite(CompactHashSetTest.class); - suite.addTest(SetTestSuiteBuilder.using(new TestStringSetGenerator() { - @Override protected Set create(String[] elements) { - return CompactHashSet.create(Arrays.asList(elements)); - } - }).named("CompactHashSet") - .withFeatures(allFeatures) - .createTestSuite()); - suite.addTest(SetTestSuiteBuilder.using(new TestStringSetGenerator() { - @Override protected Set create(String[] elements) { - CompactHashSet set = CompactHashSet.create(Arrays.asList(elements)); - for (int i = 0; i < 100; i++) { - set.add(i); - } - for (int i = 0; i < 100; i++) { - set.remove(i); - } - set.trimToSize(); - return set; - } - }).named("CompactHashSet#TrimToSize") - .withFeatures(allFeatures) - .createTestSuite()); + suite.addTest( + SetTestSuiteBuilder.using( + new TestStringSetGenerator() { + @Override + protected Set create(String[] elements) { + return CompactHashSet.create(Arrays.asList(elements)); + } + }) + .named("CompactHashSet") + .withFeatures(allFeatures) + .createTestSuite()); + suite.addTest( + SetTestSuiteBuilder.using( + new TestStringSetGenerator() { + @Override + protected Set create(String[] elements) { + CompactHashSet set = CompactHashSet.create(Arrays.asList(elements)); + for (int i = 0; i < 100; i++) { + set.add(i); + } + for (int i = 0; i < 100; i++) { + set.remove(i); + } + set.trimToSize(); + return set; + } + }) + .named("CompactHashSet#TrimToSize") + .withFeatures(allFeatures) + .createTestSuite()); return suite; } diff --git a/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java b/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java index 4235f6bbfa93..f7e28572967a 100644 --- a/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java +++ b/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java @@ -35,22 +35,28 @@ public class CompactLinkedHashMapTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); - suite.addTest(MapTestSuiteBuilder.using(new TestStringMapGenerator() { - @Override - protected Map create(Entry[] entries) { - Map map = CompactLinkedHashMap.create(); - for (Entry entry : entries) { - map.put(entry.getKey(), entry.getValue()); - } - return map; - } - }).named("CompactLinkedHashMap").withFeatures(CollectionSize.ANY, - CollectionFeature.SUPPORTS_ITERATOR_REMOVE, - MapFeature.GENERAL_PURPOSE, - MapFeature.ALLOWS_NULL_KEYS, - MapFeature.ALLOWS_NULL_VALUES, - CollectionFeature.SERIALIZABLE, - CollectionFeature.KNOWN_ORDER).createTestSuite()); + suite.addTest( + MapTestSuiteBuilder.using( + new TestStringMapGenerator() { + @Override + protected Map create(Entry[] entries) { + Map map = CompactLinkedHashMap.create(); + for (Entry entry : entries) { + map.put(entry.getKey(), entry.getValue()); + } + return map; + } + }) + .named("CompactLinkedHashMap") + .withFeatures( + CollectionSize.ANY, + CollectionFeature.SUPPORTS_ITERATOR_REMOVE, + MapFeature.GENERAL_PURPOSE, + MapFeature.ALLOWS_NULL_KEYS, + MapFeature.ALLOWS_NULL_VALUES, + CollectionFeature.SERIALIZABLE, + CollectionFeature.KNOWN_ORDER) + .createTestSuite()); suite.addTestSuite(CompactLinkedHashMapTest.class); return suite; } @@ -119,8 +125,7 @@ public void testTrimToSize() { testHasMapEntriesInOrder(map, 1, "a", 4, "b", 3, "d", 2, "c"); } - private void testHasMapEntriesInOrder(Map map, - Object... alternatingKeysAndValues) { + private void testHasMapEntriesInOrder(Map map, Object... alternatingKeysAndValues) { List> entries = Lists.newArrayList(map.entrySet()); List keys = Lists.newArrayList(map.keySet()); List values = Lists.newArrayList(map.values()); @@ -130,8 +135,7 @@ private void testHasMapEntriesInOrder(Map map, for (int i = 0; i < map.size(); i++) { Object expectedKey = alternatingKeysAndValues[2 * i]; Object expectedValue = alternatingKeysAndValues[2 * i + 1]; - Entry expectedEntry = Maps.immutableEntry( - expectedKey, expectedValue); + Entry expectedEntry = Maps.immutableEntry(expectedKey, expectedValue); assertEquals(expectedEntry, entries.get(i)); assertEquals(expectedKey, keys.get(i)); assertEquals(expectedValue, values.get(i)); diff --git a/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java b/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java index 2e9bad2ad29b..a95e4861c2a2 100644 --- a/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java +++ b/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java @@ -37,26 +37,31 @@ @GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array public class CompactLinkedHashSetTest extends TestCase { public static Test suite() { - List> allFeatures = Arrays.>asList( - CollectionSize.ANY, - CollectionFeature.ALLOWS_NULL_VALUES, - CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION, - CollectionFeature.GENERAL_PURPOSE, - CollectionFeature.REMOVE_OPERATIONS, - CollectionFeature.SERIALIZABLE, - CollectionFeature.KNOWN_ORDER, - CollectionFeature.SUPPORTS_ADD, - CollectionFeature.SUPPORTS_REMOVE); + List> allFeatures = + Arrays.>asList( + CollectionSize.ANY, + CollectionFeature.ALLOWS_NULL_VALUES, + CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION, + CollectionFeature.GENERAL_PURPOSE, + CollectionFeature.REMOVE_OPERATIONS, + CollectionFeature.SERIALIZABLE, + CollectionFeature.KNOWN_ORDER, + CollectionFeature.SUPPORTS_ADD, + CollectionFeature.SUPPORTS_REMOVE); TestSuite suite = new TestSuite(); suite.addTestSuite(CompactLinkedHashSetTest.class); - suite.addTest(SetTestSuiteBuilder.using(new TestStringSetGenerator() { - @Override protected Set create(String[] elements) { - return CompactLinkedHashSet.create(Arrays.asList(elements)); - } - }).named("CompactLinkedHashSet") - .withFeatures(allFeatures) - .createTestSuite()); + suite.addTest( + SetTestSuiteBuilder.using( + new TestStringSetGenerator() { + @Override + protected Set create(String[] elements) { + return CompactLinkedHashSet.create(Arrays.asList(elements)); + } + }) + .named("CompactLinkedHashSet") + .withFeatures(allFeatures) + .createTestSuite()); return suite; } diff --git a/guava-tests/test/com/google/common/collect/ForwardingMapTest.java b/guava-tests/test/com/google/common/collect/ForwardingMapTest.java index 62988ed0189c..6ca5b8cc145a 100644 --- a/guava-tests/test/com/google/common/collect/ForwardingMapTest.java +++ b/guava-tests/test/com/google/common/collect/ForwardingMapTest.java @@ -329,10 +329,11 @@ protected Map delegate() { }; } - private static final ImmutableMap JUF_METHODS = ImmutableMap.of( - "java.util.function.Predicate", "test", - "java.util.function.Consumer", "accept", - "java.util.function.IntFunction", "apply"); + private static final ImmutableMap JUF_METHODS = + ImmutableMap.of( + "java.util.function.Predicate", "test", + "java.util.function.Consumer", "accept", + "java.util.function.IntFunction", "apply"); private static Object getDefaultValue(final TypeToken type) { Class rawType = type.getRawType(); @@ -387,8 +388,7 @@ private static void callAllPublicMethods(TypeToken type, T object) } } } catch (Throwable cause) { - throw new InvocationTargetException( - cause, method + " with args: " + Arrays.toString(args)); + throw new InvocationTargetException(cause, method + " with args: " + Arrays.toString(args)); } } } diff --git a/guava-tests/test/com/google/common/collect/ImmutableBiMapTest.java b/guava-tests/test/com/google/common/collect/ImmutableBiMapTest.java index 319512ad277a..36e781cbb2b8 100644 --- a/guava-tests/test/com/google/common/collect/ImmutableBiMapTest.java +++ b/guava-tests/test/com/google/common/collect/ImmutableBiMapTest.java @@ -792,8 +792,7 @@ enum AdversaryType { ADVERSARIAL_KEYS { @Override List> createAdversarialEntries(int power, CallsCounter counter) { - return createAdversarialObjects(power, counter) - .stream() + return createAdversarialObjects(power, counter).stream() .map(k -> Maps.immutableEntry(k, new Object())) .collect(toList()); } @@ -801,8 +800,7 @@ enum AdversaryType { ADVERSARIAL_VALUES { @Override List> createAdversarialEntries(int power, CallsCounter counter) { - return createAdversarialObjects(power, counter) - .stream() + return createAdversarialObjects(power, counter).stream() .map(k -> Maps.immutableEntry(new Object(), k)) .collect(toList()); } diff --git a/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java b/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java index 6b9998ab6003..9e13710aaad7 100644 --- a/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java +++ b/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java @@ -120,7 +120,7 @@ protected boolean addNode(Integer n) { * add an edge whose end-points don't already exist in the graph), you should not use this * method. * - * TODO(user): remove the addNode() calls, that's now contractually guaranteed + *

TODO(user): remove the addNode() calls, that's now contractually guaranteed * * @return {@code true} iff the graph was modified as a result of this call */ diff --git a/guava-tests/test/com/google/common/graph/ConfigurableDirectedGraphTest.java b/guava-tests/test/com/google/common/graph/ConfigurableDirectedGraphTest.java index 80533fc10155..ed998eb4226a 100644 --- a/guava-tests/test/com/google/common/graph/ConfigurableDirectedGraphTest.java +++ b/guava-tests/test/com/google/common/graph/ConfigurableDirectedGraphTest.java @@ -59,9 +59,8 @@ public void incidentEdges_selfLoop() { putEdge(N1, N1); assertThat(graph.incidentEdges(N1)).containsExactly(EndpointPair.ordered(N1, N1)); putEdge(N1, N2); - assertThat(graph.incidentEdges(N1)).containsExactly( - EndpointPair.ordered(N1, N1), - EndpointPair.ordered(N1, N2)); + assertThat(graph.incidentEdges(N1)) + .containsExactly(EndpointPair.ordered(N1, N1), EndpointPair.ordered(N1, N2)); } @Test diff --git a/guava-tests/test/com/google/common/graph/ConfigurableUndirectedGraphTest.java b/guava-tests/test/com/google/common/graph/ConfigurableUndirectedGraphTest.java index 8f8cd13bf08f..3bdfd74d7e26 100644 --- a/guava-tests/test/com/google/common/graph/ConfigurableUndirectedGraphTest.java +++ b/guava-tests/test/com/google/common/graph/ConfigurableUndirectedGraphTest.java @@ -59,9 +59,8 @@ public void incidentEdges_selfLoop() { putEdge(N1, N1); assertThat(graph.incidentEdges(N1)).containsExactly(EndpointPair.unordered(N1, N1)); putEdge(N1, N2); - assertThat(graph.incidentEdges(N1)).containsExactly( - EndpointPair.unordered(N1, N1), - EndpointPair.unordered(N1, N2)); + assertThat(graph.incidentEdges(N1)) + .containsExactly(EndpointPair.unordered(N1, N1), EndpointPair.unordered(N1, N2)); } @Test diff --git a/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java b/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java index beb000fdf8a2..0dd2318e9776 100644 --- a/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java +++ b/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java @@ -93,7 +93,8 @@ abstract class StringList implements List {} try { numberList.getSubtype(StringList.class); fail(); - } catch (IllegalArgumentException expected) {} + } catch (IllegalArgumentException expected) { + } } private static class OwnerTypeSubtypingTests extends SubtypeTester { @@ -230,7 +231,7 @@ private static class RecursiveTypeBoundBugExample> ifYouUseTheTypeVariableOnTheClassAndItIsRecursive( List>> arg) { - return notSubtype(arg); // isSubtype() currently incorectly considers it a subtype. + return notSubtype(arg); // isSubtype() currently incorectly considers it a subtype. } } @@ -275,15 +276,13 @@ public Iterable> listOfEnums(List> listOfEnums) { @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public UseList>>> - wildcardBoundUsesImplicitlyRecursiveBoundedWildcard( - UseList>> arg) { + wildcardBoundUsesImplicitlyRecursiveBoundedWildcard(UseList>> arg) { return isSubtype(arg); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public UseList>>> - wildcardBoundHasImplicitBoundAtsInvariantPosition( - UseList>> arg) { + wildcardBoundHasImplicitBoundAtsInvariantPosition(UseList>> arg) { return isSubtype(arg); } @@ -301,14 +300,14 @@ public Iterable> nestedExplicitEnumBoundIsSubtypeOfImplicitEnumBound( @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>>> - implicitEnumBoundIsSubtypeOfNestedExplicitEnumBound(List> listOfEnums) { + implicitEnumBoundIsSubtypeOfNestedExplicitEnumBound(List> listOfEnums) { return isSubtype(listOfEnums); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>> - listOfEnumsWithImplicitBoundIsSubtypeOfIterableOfEnumWithExplicitBound( - List> listOfEnums) { + listOfEnumsWithImplicitBoundIsSubtypeOfIterableOfEnumWithExplicitBound( + List> listOfEnums) { return isSubtype(listOfEnums); } @@ -326,43 +325,43 @@ public List>> typeVariableBoundOm @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public List> - wildcardUpperBoundIsNotSubtypeOfTypeVariableBound( - List> arg) { + wildcardUpperBoundIsNotSubtypeOfTypeVariableBound( + List> arg) { return notSubtype(arg); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public List>>>> - wildcardBoundUsesParameterizedTypeWithImplicitBound( - List>>> arg) { + wildcardBoundUsesParameterizedTypeWithImplicitBound( + List>>> arg) { return isSubtype(arg); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public List>>>> - wildcardBoundUsesRecursiveParameterizedTypeWithImplicitBound( - List>>> arg) { + wildcardBoundUsesRecursiveParameterizedTypeWithImplicitBound( + List>>> arg) { return isSubtype(arg); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public List>>>> - wildcardBoundUsesParameterizedTypeDefinedWithImplicitBound( - List>>> arg) { + wildcardBoundUsesParameterizedTypeDefinedWithImplicitBound( + List>>> arg) { return isSubtype(arg); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>> - wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyBounded( - List> withImplicitBounds) { + wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyBounded( + List> withImplicitBounds) { return isSubtype(withImplicitBounds); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>> - wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyPartialBounded( - List> withImplicitBounds) { + wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyPartialBounded( + List> withImplicitBounds) { return isSubtype(withImplicitBounds); } @@ -373,23 +372,22 @@ public Iterable>> useListOfIterableWildcard( } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) - public Iterable> - listOfExplicitBoundedIsSubtypeOfListOfImplicitlyBounded( + public Iterable> listOfExplicitBoundedIsSubtypeOfListOfImplicitlyBounded( List>> withExplicitBounds) { return isSubtype(withExplicitBounds); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>> - wildcardOfImplicitBoundedIsNotSubtypeOfNonWildcardOfExplicitlyBounded( - List> withImplicitBounds) { + wildcardOfImplicitBoundedIsNotSubtypeOfNonWildcardOfExplicitlyBounded( + List> withImplicitBounds) { return notSubtype(withImplicitBounds); } @TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true) public Iterable>> - wildcardOfImplicitBoundedIsNotSubtypeOfWildcardWithNarrowerBounds( - List> withImplicitBounds) { + wildcardOfImplicitBoundedIsNotSubtypeOfWildcardWithNarrowerBounds( + List> withImplicitBounds) { return notSubtype(withImplicitBounds); } diff --git a/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java b/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java index 4c67d515d7c3..8f91bcc21563 100644 --- a/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java @@ -36,7 +36,7 @@ Void runInterruptibly() throws Exception { BrokenChannel bc = new BrokenChannel(); bc.doBegin(); isInterruptibleRegistered.countDown(); - new CountDownLatch(1).await(); // the interrupt will wake us up + new CountDownLatch(1).await(); // the interrupt will wake us up return null; } @@ -95,7 +95,7 @@ Void runInterruptibly() throws Exception { slowChannel.doBegin(); isInterruptibleRegistered.countDown(); try { - new CountDownLatch(1).await(); // the interrupt will wake us up + new CountDownLatch(1).await(); // the interrupt will wake us up } catch (InterruptedException ie) { // continue } diff --git a/guava-tests/test/com/google/common/util/concurrent/StripedTest.java b/guava-tests/test/com/google/common/util/concurrent/StripedTest.java index 1bd3c95bde8f..9832c30b029c 100644 --- a/guava-tests/test/com/google/common/util/concurrent/StripedTest.java +++ b/guava-tests/test/com/google/common/util/concurrent/StripedTest.java @@ -50,18 +50,22 @@ private static List> strongImplementations() { Striped.readWriteLock(256), Striped.lock(100), Striped.lock(256), - Striped.custom(100, new Supplier() { - @Override - public Lock get() { - return new ReentrantLock(true); - } - }), - Striped.custom(256, new Supplier() { - @Override - public Lock get() { - return new ReentrantLock(true); - } - }), + Striped.custom( + 100, + new Supplier() { + @Override + public Lock get() { + return new ReentrantLock(true); + } + }), + Striped.custom( + 256, + new Supplier() { + @Override + public Lock get() { + return new ReentrantLock(true); + } + }), Striped.semaphore(100, 1), Striped.semaphore(256, 1)); }