aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcushon <cushon@google.com>2019-02-04 11:07:18 -0800
committerRon Shapiro <shapiro.rd@gmail.com>2019-02-26 14:18:53 -0500
commitf09c017033417cc50b047d607f5917fff39ca0dd (patch)
tree50388f08684d2e61a621f7907a792b290c0d7747
parent3e7f6fe874f482a87e6aad27f29ad2abbf10d3ea (diff)
downloadguava-f09c017033417cc50b047d607f5917fff39ca0dd.tar.gz
Reformat with google-java-format
RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=232329476
-rw-r--r--android/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java1
-rw-r--r--android/guava-tests/test/com/google/common/base/StringsTest.java3
-rw-r--r--android/guava-tests/test/com/google/common/collect/CompactHashMapTest.java37
-rw-r--r--android/guava-tests/test/com/google/common/collect/CompactHashSetTest.java71
-rw-r--r--android/guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java44
-rw-r--r--android/guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java39
-rw-r--r--android/guava-tests/test/com/google/common/collect/ForwardingMapTest.java12
-rw-r--r--android/guava-tests/test/com/google/common/graph/AbstractNetworkTest.java2
-rw-r--r--android/guava-tests/test/com/google/common/graph/ConfigurableDirectedGraphTest.java5
-rw-r--r--android/guava-tests/test/com/google/common/graph/ConfigurableUndirectedGraphTest.java5
-rw-r--r--android/guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java52
-rw-r--r--android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java4
-rw-r--r--android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java28
-rw-r--r--guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java1
-rw-r--r--guava-tests/test/com/google/common/base/StringsTest.java3
-rw-r--r--guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java14
-rw-r--r--guava-tests/test/com/google/common/collect/CompactHashMapTest.java37
-rw-r--r--guava-tests/test/com/google/common/collect/CompactHashSetTest.java71
-rw-r--r--guava-tests/test/com/google/common/collect/CompactLinkedHashMapTest.java44
-rw-r--r--guava-tests/test/com/google/common/collect/CompactLinkedHashSetTest.java39
-rw-r--r--guava-tests/test/com/google/common/collect/ForwardingMapTest.java12
-rw-r--r--guava-tests/test/com/google/common/collect/ImmutableBiMapTest.java6
-rw-r--r--guava-tests/test/com/google/common/graph/AbstractNetworkTest.java2
-rw-r--r--guava-tests/test/com/google/common/graph/ConfigurableDirectedGraphTest.java5
-rw-r--r--guava-tests/test/com/google/common/graph/ConfigurableUndirectedGraphTest.java5
-rw-r--r--guava-tests/test/com/google/common/reflect/TypeTokenSubtypeTest.java52
-rw-r--r--guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java4
-rw-r--r--guava-tests/test/com/google/common/util/concurrent/StripedTest.java28
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 2fd21e978..75fc1f90d 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.BeforeExperiment;
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 8eda06702..ac3ad20a5 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 class StringsTest extends TestCase {
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 87480d091..33e601556 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 @@ import junit.framework.TestSuite;
public class CompactHashMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
- suite.addTest(MapTestSuiteBuilder.using(new TestStringMapGenerator() {
- @Override
- protected Map<String, String> create(Entry<String, String>[] entries) {
- Map<String, String> map = CompactHashMap.create();
- for (Entry<String, String> 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<String, String> create(Entry<String, String>[] entries) {
+ Map<String, String> map = CompactHashMap.create();
+ for (Entry<String, String> 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 08eabf552..e5c3a458b 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 @@ import junit.framework.TestSuite;
@GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array
public class CompactHashSetTest extends TestCase {
public static Test suite() {
- List<Feature<?>> allFeatures = Arrays.<Feature<?>>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<Feature<?>> allFeatures =
+ Arrays.<Feature<?>>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<String> create(String[] elements) {
- return CompactHashSet.create(Arrays.asList(elements));
- }
- }).named("CompactHashSet")
- .withFeatures(allFeatures)
- .createTestSuite());
- suite.addTest(SetTestSuiteBuilder.using(new TestStringSetGenerator() {
- @Override protected Set<String> 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<String> create(String[] elements) {
+ return CompactHashSet.create(Arrays.asList(elements));
+ }
+ })
+ .named("CompactHashSet")
+ .withFeatures(allFeatures)
+ .createTestSuite());
+ suite.addTest(
+ SetTestSuiteBuilder.using(
+ new TestStringSetGenerator() {
+ @Override
+ protected Set<String> 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 4235f6bbf..f7e285729 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 @@ import junit.framework.TestSuite;
public class CompactLinkedHashMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
- suite.addTest(MapTestSuiteBuilder.using(new TestStringMapGenerator() {
- @Override
- protected Map<String, String> create(Entry<String, String>[] entries) {
- Map<String, String> map = CompactLinkedHashMap.create();
- for (Entry<String, String> 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<String, String> create(Entry<String, String>[] entries) {
+ Map<String, String> map = CompactLinkedHashMap.create();
+ for (Entry<String, String> 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 class CompactLinkedHashMapTest extends TestCase {
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<? extends Entry<?, ?>> entries = Lists.newArrayList(map.entrySet());
List<Object> keys = Lists.newArrayList(map.keySet());
List<Object> values = Lists.newArrayList(map.values());
@@ -130,8 +135,7 @@ public class CompactLinkedHashMapTest extends TestCase {
for (int i = 0; i < map.size(); i++) {
Object expectedKey = alternatingKeysAndValues[2 * i];
Object expectedValue = alternatingKeysAndValues[2 * i + 1];
- Entry<Object, Object> expectedEntry = Maps.immutableEntry(
- expectedKey, expectedValue);
+ Entry<Object, Object> 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 2e9bad2ad..a95e4861c 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 @@ import junit.framework.TestSuite;
@GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array
public class CompactLinkedHashSetTest extends TestCase {
public static Test suite() {
- List<Feature<?>> allFeatures = Arrays.<Feature<?>>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<Feature<?>> allFeatures =
+ Arrays.<Feature<?>>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<String> create(String[] elements) {
- return CompactLinkedHashSet.create(Arrays.asList(elements));
- }
- }).named("CompactLinkedHashSet")
- .withFeatures(allFeatures)
- .createTestSuite());
+ suite.addTest(
+ SetTestSuiteBuilder.using(
+ new TestStringSetGenerator() {
+ @Override
+ protected Set<String> 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 62988ed01..6ca5b8cc1 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 @@ public class ForwardingMapTest extends TestCase {
};
}
- private static final ImmutableMap<String, String> JUF_METHODS = ImmutableMap.of(
- "java.util.function.Predicate", "test",
- "java.util.function.Consumer", "accept",
- "java.util.function.IntFunction", "apply");
+ private static final ImmutableMap<String, String> 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 @@ public class ForwardingMapTest extends TestCase {
}
}
} 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 0a927302d..9154a7389 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 @@ public abstract class AbstractNetworkTest {
* add an edge whose end-points don't already exist in the graph), you should <b>not</b> use this
* method.
*
- * TODO(user): remove the addNode() calls, that's now contractually guaranteed
+ * <p>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 80533fc10..ed998eb42 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 class ConfigurableDirectedGraphTest extends ConfigurableSimpleDirectedGra
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 8f8cd13bf..3bdfd74d7 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 class ConfigurableUndirectedGraphTest extends ConfigurableSimpleUndirecte
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 beb000fdf..0dd2318e9 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 @@ public class TypeTokenSubtypeTest extends TestCase {
try {
numberList.getSubtype(StringList.class);
fail();
- } catch (IllegalArgumentException expected) {}
+ } catch (IllegalArgumentException expected) {
+ }
}
private static class OwnerTypeSubtypingTests extends SubtypeTester {
@@ -230,7 +231,7 @@ public class TypeTokenSubtypeTest extends TestCase {
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public List<RecursiveTypeBoundBugExample<?>> ifYouUseTheTypeVariableOnTheClassAndItIsRecursive(
List<RecursiveTypeBoundBugExample<? extends RecursiveTypeBoundBugExample<T>>> 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 class TypeTokenSubtypeTest extends TestCase {
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public UseList<? extends List<Enum<? extends Enum<?>>>>
- wildcardBoundUsesImplicitlyRecursiveBoundedWildcard(
- UseList<? extends List<Enum<?>>> arg) {
+ wildcardBoundUsesImplicitlyRecursiveBoundedWildcard(UseList<? extends List<Enum<?>>> arg) {
return isSubtype(arg);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public UseList<? extends List<Enum<? extends Enum<?>>>>
- wildcardBoundHasImplicitBoundAtsInvariantPosition(
- UseList<? extends List<Enum<?>>> arg) {
+ wildcardBoundHasImplicitBoundAtsInvariantPosition(UseList<? extends List<Enum<?>>> arg) {
return isSubtype(arg);
}
@@ -301,14 +300,14 @@ public class TypeTokenSubtypeTest extends TestCase {
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<Enum<? extends Enum<? extends Enum<?>>>>
- implicitEnumBoundIsSubtypeOfNestedExplicitEnumBound(List<Enum<?>> listOfEnums) {
+ implicitEnumBoundIsSubtypeOfNestedExplicitEnumBound(List<Enum<?>> listOfEnums) {
return isSubtype(listOfEnums);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<Enum<? extends Enum<?>>>
- listOfEnumsWithImplicitBoundIsSubtypeOfIterableOfEnumWithExplicitBound(
- List<Enum<?>> listOfEnums) {
+ listOfEnumsWithImplicitBoundIsSubtypeOfIterableOfEnumWithExplicitBound(
+ List<Enum<?>> listOfEnums) {
return isSubtype(listOfEnums);
}
@@ -326,43 +325,43 @@ public class TypeTokenSubtypeTest extends TestCase {
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public List<MyTypeBoundUsesImplicitBound<? extends MyEnum>>
- wildcardUpperBoundIsNotSubtypeOfTypeVariableBound(
- List<MyTypeBoundUsesImplicitBound<?>> arg) {
+ wildcardUpperBoundIsNotSubtypeOfTypeVariableBound(
+ List<MyTypeBoundUsesImplicitBound<?>> arg) {
return notSubtype(arg);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public List<List<? extends Iterable<UseList<? extends List<?>>>>>
- wildcardBoundUsesParameterizedTypeWithImplicitBound(
- List<List<? extends Iterable<UseList<?>>>> arg) {
+ wildcardBoundUsesParameterizedTypeWithImplicitBound(
+ List<List<? extends Iterable<UseList<?>>>> arg) {
return isSubtype(arg);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public List<List<? extends Iterable<Enum<? extends Enum<?>>>>>
- wildcardBoundUsesRecursiveParameterizedTypeWithImplicitBound(
- List<List<? extends Iterable<Enum<?>>>> arg) {
+ wildcardBoundUsesRecursiveParameterizedTypeWithImplicitBound(
+ List<List<? extends Iterable<Enum<?>>>> arg) {
return isSubtype(arg);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public List<List<? extends Iterable<MyTypeBoundUsesImplicitBound<? extends Enum<?>>>>>
- wildcardBoundUsesParameterizedTypeDefinedWithImplicitBound(
- List<List<? extends Iterable<MyTypeBoundUsesImplicitBound<?>>>> arg) {
+ wildcardBoundUsesParameterizedTypeDefinedWithImplicitBound(
+ List<List<? extends Iterable<MyTypeBoundUsesImplicitBound<?>>>> arg) {
return isSubtype(arg);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<UseIterable<? extends Iterable<?>>>
- wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyBounded(
- List<UseIterable<?>> withImplicitBounds) {
+ wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyBounded(
+ List<UseIterable<?>> withImplicitBounds) {
return isSubtype(withImplicitBounds);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<UseSerializableIterable<? extends Iterable<?>>>
- wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyPartialBounded(
- List<UseSerializableIterable<?>> withImplicitBounds) {
+ wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyPartialBounded(
+ List<UseSerializableIterable<?>> withImplicitBounds) {
return isSubtype(withImplicitBounds);
}
@@ -373,23 +372,22 @@ public class TypeTokenSubtypeTest extends TestCase {
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
- public Iterable<UseIterable<?>>
- listOfExplicitBoundedIsSubtypeOfListOfImplicitlyBounded(
+ public Iterable<UseIterable<?>> listOfExplicitBoundedIsSubtypeOfListOfImplicitlyBounded(
List<UseIterable<? extends Iterable<?>>> withExplicitBounds) {
return isSubtype(withExplicitBounds);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<UseIterable<? extends Iterable<?>>>
- wildcardOfImplicitBoundedIsNotSubtypeOfNonWildcardOfExplicitlyBounded(
- List<? extends UseIterable<?>> withImplicitBounds) {
+ wildcardOfImplicitBoundedIsNotSubtypeOfNonWildcardOfExplicitlyBounded(
+ List<? extends UseIterable<?>> withImplicitBounds) {
return notSubtype(withImplicitBounds);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<UseIterable<? extends List<?>>>
- wildcardOfImplicitBoundedIsNotSubtypeOfWildcardWithNarrowerBounds(
- List<UseIterable<?>> withImplicitBounds) {
+ wildcardOfImplicitBoundedIsNotSubtypeOfWildcardWithNarrowerBounds(
+ List<UseIterable<?>> 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 4c67d515d..8f91bcc21 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 @@ public final class InterruptibleTaskTest extends TestCase {
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 @@ public final class InterruptibleTaskTest extends TestCase {
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 1bd3c95bd..9832c30b0 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 @@ public class StripedTest extends TestCase {
Striped.readWriteLock(256),
Striped.lock(100),
Striped.lock(256),
- Striped.custom(100, new Supplier<Lock>() {
- @Override
- public Lock get() {
- return new ReentrantLock(true);
- }
- }),
- Striped.custom(256, new Supplier<Lock>() {
- @Override
- public Lock get() {
- return new ReentrantLock(true);
- }
- }),
+ Striped.custom(
+ 100,
+ new Supplier<Lock>() {
+ @Override
+ public Lock get() {
+ return new ReentrantLock(true);
+ }
+ }),
+ Striped.custom(
+ 256,
+ new Supplier<Lock>() {
+ @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 2fd21e978..75fc1f90d 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.BeforeExperiment;
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 8eda06702..ac3ad20a5 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 class StringsTest extends TestCase {
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 c49b80e1e..2c1e1e8cb 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 class LocalCacheMapComputeTest extends TestCase {
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 87480d091..33e601556 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 @@ import junit.framework.TestSuite;
public class CompactHashMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
- suite.addTest(MapTestSuiteBuilder.using(new TestStringMapGenerator() {
- @Override
- protected Map<String, String> create(Entry<String, String>[] entries) {
- Map<String, String> map = CompactHashMap.create();
- for (Entry<String, String> 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<String, String> create(Entry<String, String>[] entries) {
+ Map<String, String> map = CompactHashMap.create();
+ for (Entry<String, String> 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 08eabf552..e5c3a458b 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 @@ import junit.framework.TestSuite;
@GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array
public class CompactHashSetTest extends TestCase {
public static Test suite() {
- List<Feature<?>> allFeatures = Arrays.<Feature<?>>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<Feature<?>> allFeatures =
+ Arrays.<Feature<?>>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<String> create(String[] elements) {
- return CompactHashSet.create(Arrays.asList(elements));
- }
- }).named("CompactHashSet")
- .withFeatures(allFeatures)
- .createTestSuite());
- suite.addTest(SetTestSuiteBuilder.using(new TestStringSetGenerator() {
- @Override protected Set<String> 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<String> create(String[] elements) {
+ return CompactHashSet.create(Arrays.asList(elements));
+ }
+ })
+ .named("CompactHashSet")
+ .withFeatures(allFeatures)
+ .createTestSuite());
+ suite.addTest(
+ SetTestSuiteBuilder.using(
+ new TestStringSetGenerator() {
+ @Override
+ protected Set<String> 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 4235f6bbf..f7e285729 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 @@ import junit.framework.TestSuite;
public class CompactLinkedHashMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
- suite.addTest(MapTestSuiteBuilder.using(new TestStringMapGenerator() {
- @Override
- protected Map<String, String> create(Entry<String, String>[] entries) {
- Map<String, String> map = CompactLinkedHashMap.create();
- for (Entry<String, String> 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<String, String> create(Entry<String, String>[] entries) {
+ Map<String, String> map = CompactLinkedHashMap.create();
+ for (Entry<String, String> 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 class CompactLinkedHashMapTest extends TestCase {
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<? extends Entry<?, ?>> entries = Lists.newArrayList(map.entrySet());
List<Object> keys = Lists.newArrayList(map.keySet());
List<Object> values = Lists.newArrayList(map.values());
@@ -130,8 +135,7 @@ public class CompactLinkedHashMapTest extends TestCase {
for (int i = 0; i < map.size(); i++) {
Object expectedKey = alternatingKeysAndValues[2 * i];
Object expectedValue = alternatingKeysAndValues[2 * i + 1];
- Entry<Object, Object> expectedEntry = Maps.immutableEntry(
- expectedKey, expectedValue);
+ Entry<Object, Object> 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 2e9bad2ad..a95e4861c 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 @@ import junit.framework.TestSuite;
@GwtIncompatible // java.util.Arrays#copyOf(Object[], int), java.lang.reflect.Array
public class CompactLinkedHashSetTest extends TestCase {
public static Test suite() {
- List<Feature<?>> allFeatures = Arrays.<Feature<?>>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<Feature<?>> allFeatures =
+ Arrays.<Feature<?>>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<String> create(String[] elements) {
- return CompactLinkedHashSet.create(Arrays.asList(elements));
- }
- }).named("CompactLinkedHashSet")
- .withFeatures(allFeatures)
- .createTestSuite());
+ suite.addTest(
+ SetTestSuiteBuilder.using(
+ new TestStringSetGenerator() {
+ @Override
+ protected Set<String> 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 62988ed01..6ca5b8cc1 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 @@ public class ForwardingMapTest extends TestCase {
};
}
- private static final ImmutableMap<String, String> JUF_METHODS = ImmutableMap.of(
- "java.util.function.Predicate", "test",
- "java.util.function.Consumer", "accept",
- "java.util.function.IntFunction", "apply");
+ private static final ImmutableMap<String, String> 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 @@ public class ForwardingMapTest extends TestCase {
}
}
} 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 319512ad2..36e781cbb 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 @@ public class ImmutableBiMapTest extends TestCase {
ADVERSARIAL_KEYS {
@Override
List<? extends Entry<?, ?>> 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 @@ public class ImmutableBiMapTest extends TestCase {
ADVERSARIAL_VALUES {
@Override
List<? extends Entry<?, ?>> 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 6b9998ab6..9e13710aa 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 @@ public abstract class AbstractNetworkTest {
* add an edge whose end-points don't already exist in the graph), you should <b>not</b> use this
* method.
*
- * TODO(user): remove the addNode() calls, that's now contractually guaranteed
+ * <p>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 80533fc10..ed998eb42 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 class ConfigurableDirectedGraphTest extends ConfigurableSimpleDirectedGra
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 8f8cd13bf..3bdfd74d7 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 class ConfigurableUndirectedGraphTest extends ConfigurableSimpleUndirecte
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 beb000fdf..0dd2318e9 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 @@ public class TypeTokenSubtypeTest extends TestCase {
try {
numberList.getSubtype(StringList.class);
fail();
- } catch (IllegalArgumentException expected) {}
+ } catch (IllegalArgumentException expected) {
+ }
}
private static class OwnerTypeSubtypingTests extends SubtypeTester {
@@ -230,7 +231,7 @@ public class TypeTokenSubtypeTest extends TestCase {
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public List<RecursiveTypeBoundBugExample<?>> ifYouUseTheTypeVariableOnTheClassAndItIsRecursive(
List<RecursiveTypeBoundBugExample<? extends RecursiveTypeBoundBugExample<T>>> 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 class TypeTokenSubtypeTest extends TestCase {
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public UseList<? extends List<Enum<? extends Enum<?>>>>
- wildcardBoundUsesImplicitlyRecursiveBoundedWildcard(
- UseList<? extends List<Enum<?>>> arg) {
+ wildcardBoundUsesImplicitlyRecursiveBoundedWildcard(UseList<? extends List<Enum<?>>> arg) {
return isSubtype(arg);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public UseList<? extends List<Enum<? extends Enum<?>>>>
- wildcardBoundHasImplicitBoundAtsInvariantPosition(
- UseList<? extends List<Enum<?>>> arg) {
+ wildcardBoundHasImplicitBoundAtsInvariantPosition(UseList<? extends List<Enum<?>>> arg) {
return isSubtype(arg);
}
@@ -301,14 +300,14 @@ public class TypeTokenSubtypeTest extends TestCase {
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<Enum<? extends Enum<? extends Enum<?>>>>
- implicitEnumBoundIsSubtypeOfNestedExplicitEnumBound(List<Enum<?>> listOfEnums) {
+ implicitEnumBoundIsSubtypeOfNestedExplicitEnumBound(List<Enum<?>> listOfEnums) {
return isSubtype(listOfEnums);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<Enum<? extends Enum<?>>>
- listOfEnumsWithImplicitBoundIsSubtypeOfIterableOfEnumWithExplicitBound(
- List<Enum<?>> listOfEnums) {
+ listOfEnumsWithImplicitBoundIsSubtypeOfIterableOfEnumWithExplicitBound(
+ List<Enum<?>> listOfEnums) {
return isSubtype(listOfEnums);
}
@@ -326,43 +325,43 @@ public class TypeTokenSubtypeTest extends TestCase {
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public List<MyTypeBoundUsesImplicitBound<? extends MyEnum>>
- wildcardUpperBoundIsNotSubtypeOfTypeVariableBound(
- List<MyTypeBoundUsesImplicitBound<?>> arg) {
+ wildcardUpperBoundIsNotSubtypeOfTypeVariableBound(
+ List<MyTypeBoundUsesImplicitBound<?>> arg) {
return notSubtype(arg);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public List<List<? extends Iterable<UseList<? extends List<?>>>>>
- wildcardBoundUsesParameterizedTypeWithImplicitBound(
- List<List<? extends Iterable<UseList<?>>>> arg) {
+ wildcardBoundUsesParameterizedTypeWithImplicitBound(
+ List<List<? extends Iterable<UseList<?>>>> arg) {
return isSubtype(arg);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public List<List<? extends Iterable<Enum<? extends Enum<?>>>>>
- wildcardBoundUsesRecursiveParameterizedTypeWithImplicitBound(
- List<List<? extends Iterable<Enum<?>>>> arg) {
+ wildcardBoundUsesRecursiveParameterizedTypeWithImplicitBound(
+ List<List<? extends Iterable<Enum<?>>>> arg) {
return isSubtype(arg);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public List<List<? extends Iterable<MyTypeBoundUsesImplicitBound<? extends Enum<?>>>>>
- wildcardBoundUsesParameterizedTypeDefinedWithImplicitBound(
- List<List<? extends Iterable<MyTypeBoundUsesImplicitBound<?>>>> arg) {
+ wildcardBoundUsesParameterizedTypeDefinedWithImplicitBound(
+ List<List<? extends Iterable<MyTypeBoundUsesImplicitBound<?>>>> arg) {
return isSubtype(arg);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<UseIterable<? extends Iterable<?>>>
- wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyBounded(
- List<UseIterable<?>> withImplicitBounds) {
+ wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyBounded(
+ List<UseIterable<?>> withImplicitBounds) {
return isSubtype(withImplicitBounds);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<UseSerializableIterable<? extends Iterable<?>>>
- wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyPartialBounded(
- List<UseSerializableIterable<?>> withImplicitBounds) {
+ wildcardOfImplicitBoundedIsSubtypeOfWildcardOfExplicitlyPartialBounded(
+ List<UseSerializableIterable<?>> withImplicitBounds) {
return isSubtype(withImplicitBounds);
}
@@ -373,23 +372,22 @@ public class TypeTokenSubtypeTest extends TestCase {
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
- public Iterable<UseIterable<?>>
- listOfExplicitBoundedIsSubtypeOfListOfImplicitlyBounded(
+ public Iterable<UseIterable<?>> listOfExplicitBoundedIsSubtypeOfListOfImplicitlyBounded(
List<UseIterable<? extends Iterable<?>>> withExplicitBounds) {
return isSubtype(withExplicitBounds);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<UseIterable<? extends Iterable<?>>>
- wildcardOfImplicitBoundedIsNotSubtypeOfNonWildcardOfExplicitlyBounded(
- List<? extends UseIterable<?>> withImplicitBounds) {
+ wildcardOfImplicitBoundedIsNotSubtypeOfNonWildcardOfExplicitlyBounded(
+ List<? extends UseIterable<?>> withImplicitBounds) {
return notSubtype(withImplicitBounds);
}
@TestSubtype(suppressGetSupertype = true, suppressGetSubtype = true)
public Iterable<UseIterable<? extends List<?>>>
- wildcardOfImplicitBoundedIsNotSubtypeOfWildcardWithNarrowerBounds(
- List<UseIterable<?>> withImplicitBounds) {
+ wildcardOfImplicitBoundedIsNotSubtypeOfWildcardWithNarrowerBounds(
+ List<UseIterable<?>> 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 4c67d515d..8f91bcc21 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 @@ public final class InterruptibleTaskTest extends TestCase {
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 @@ public final class InterruptibleTaskTest extends TestCase {
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 1bd3c95bd..9832c30b0 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 @@ public class StripedTest extends TestCase {
Striped.readWriteLock(256),
Striped.lock(100),
Striped.lock(256),
- Striped.custom(100, new Supplier<Lock>() {
- @Override
- public Lock get() {
- return new ReentrantLock(true);
- }
- }),
- Striped.custom(256, new Supplier<Lock>() {
- @Override
- public Lock get() {
- return new ReentrantLock(true);
- }
- }),
+ Striped.custom(
+ 100,
+ new Supplier<Lock>() {
+ @Override
+ public Lock get() {
+ return new ReentrantLock(true);
+ }
+ }),
+ Striped.custom(
+ 256,
+ new Supplier<Lock>() {
+ @Override
+ public Lock get() {
+ return new ReentrantLock(true);
+ }
+ }),
Striped.semaphore(100, 1),
Striped.semaphore(256, 1));
}