Skip to content

Commit af59e64

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
RELNOTES=n/a PiperOrigin-RevId: 793360913
1 parent 5b38150 commit af59e64

File tree

53 files changed

+216
-26
lines changed

Some content is hidden

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

53 files changed

+216
-26
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,4 +551,12 @@ public static Method getMethod(Class<?> clazz, String name) {
551551
throw new IllegalArgumentException(e);
552552
}
553553
}
554+
555+
/**
556+
* Useless constructor for a class of static utility methods.
557+
*
558+
* @deprecated Do not instantiate this utility class.
559+
*/
560+
@Deprecated
561+
public Helpers() {}
554562
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,12 @@ protected BiMap<String, String> create(Entry<String, String>[] entries) {
6565
return ImmutableBiMap.copyOf(asList(entries));
6666
}
6767
}
68+
69+
/**
70+
* Useless constructor for a class of static utility methods.
71+
*
72+
* @deprecated Do not instantiate this utility class.
73+
*/
74+
@Deprecated
75+
public BiMapGenerators() {}
6876
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,12 @@ public Collection<Integer>[] createValueArray(int length) {
237237
return new ImmutableSet[length];
238238
}
239239
}
240+
241+
/**
242+
* Useless constructor for a class of static utility methods.
243+
*
244+
* @deprecated Do not instantiate this utility class.
245+
*/
246+
@Deprecated
247+
public MapGenerators() {}
240248
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,12 @@ final ContiguousSet<Integer> checkedCreate(SortedSet<Integer> elementsSet) {
426426
return ContiguousSet.create(range, DiscreteDomain.integers());
427427
}
428428
}
429+
430+
/**
431+
* Useless constructor for a class of static utility methods.
432+
*
433+
* @deprecated Do not instantiate this utility class.
434+
*/
435+
@Deprecated
436+
public SetGenerators() {}
429437
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,12 @@ protected List<String> create(String[] elements) {
132132
return builder.build().values().asList();
133133
}
134134
}
135+
136+
/**
137+
* Useless constructor for a class of static utility methods.
138+
*
139+
* @deprecated Do not instantiate this utility class.
140+
*/
141+
@Deprecated
142+
public SortedMapGenerators() {}
135143
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,12 @@ void assertMultimapIsUnmodifiable(Multimap<K, V> multimap, K sampleKey, V sample
417417
void assertMultimapRemainsUnmodified(Multimap<K, V> expected, List<Entry<K, V>> actual) {
418418
assertIteratorsInOrder(expected.entries().iterator(), actual.iterator());
419419
}
420+
421+
/**
422+
* Useless constructor for a class of static utility methods.
423+
*
424+
* @deprecated Do not instantiate this utility class.
425+
*/
426+
@Deprecated
427+
public UnmodifiableCollectionTests() {}
420428
}

android/guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ protected void tearDown() {
9191

9292
static final Exception EXCEPTION = new Exception();
9393

94-
static class ExampleClassUnderTest {
94+
static final class ExampleClassUnderTest {
9595
static final Logger logger = Logger.getLogger(ExampleClassUnderTest.class.getName());
9696

9797
static void foo() {
9898
logger.log(Level.INFO, "message", EXCEPTION);
9999
}
100+
101+
private ExampleClassUnderTest() {}
100102
}
101103
}

android/guava-tests/test/com/google/common/base/BenchmarkHelpers.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* @author Louis Wasserman
2424
*/
2525
@NullUnmarked
26-
class BenchmarkHelpers {
26+
final class BenchmarkHelpers {
2727
private static final String WHITESPACE_CHARACTERS =
2828
"\u00a0\u180e\u202f\t\n\013\f\r \u0085"
2929
+ "\u1680\u2028\u2029\u205f\u3000\u2000\u2001\u2002\u2003\u2004\u2005"
@@ -88,4 +88,6 @@ public enum SampleMatcherConfig {
8888
this.matchingChars = matchingChars;
8989
}
9090
}
91+
92+
private BenchmarkHelpers() {}
9193
}

android/guava-tests/test/com/google/common/cache/CacheTesting.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
*/
5656
@SuppressWarnings("GuardedBy") // TODO(b/35466881): Fix or suppress.
5757
@NullUnmarked
58-
class CacheTesting {
58+
final class CacheTesting {
5959

6060
/**
6161
* Poke into the Cache internals to simulate garbage collection of the value associated with the
@@ -495,4 +495,6 @@ static void checkEmpty(Collection<?> collection) {
495495
.testEquals();
496496
}
497497
}
498+
499+
private CacheTesting() {}
498500
}

android/guava-tests/test/com/google/common/cache/TestingCacheLoaders.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
@GwtCompatible
3636
@NullUnmarked
37-
class TestingCacheLoaders {
37+
final class TestingCacheLoaders {
3838

3939
/**
4040
* Returns a {@link CacheLoader} that implements a naive {@link CacheLoader#loadAll}, delegating
@@ -166,4 +166,6 @@ public T load(T key) {
166166
return key;
167167
}
168168
}
169+
170+
private TestingCacheLoaders() {}
169171
}

0 commit comments

Comments
 (0)