Skip to content

Commit 89a6d25

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Address assorted warnings for Error Prone, Android Lint, etc.
RELNOTES=n/a PiperOrigin-RevId: 726095812
1 parent cf77dac commit 89a6d25

File tree

9 files changed

+11
-5
lines changed

9 files changed

+11
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public void testExplicit_one() {
162162
public void testExplicitMax_b297601553() {
163163
Ordering<Integer> c = Ordering.explicit(1, 2, 3);
164164

165-
// TODO(b/297601553): this should probably throw an CCE since 0 isn't explicitly listed
165+
// TODO(b/297601553): this should probably throw CCE since 0 isn't explicitly listed
166166
assertEquals(0, (int) c.max(asList(0)));
167167
IncomparableValueException expected =
168168
assertThrows(IncomparableValueException.class, () -> c.max(asList(0, 1)));

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ public static Predicate<Class<?>> subtypeOf(Class<?> clazz) {
210210
*
211211
* @param target the collection that may contain the function input
212212
*/
213+
@SuppressWarnings("NoHardKeywords") // We're stuck with the name for compatibility reasons.
213214
public static <T extends @Nullable Object> Predicate<T> in(Collection<? extends T> target) {
214215
return new InPredicate<>(target);
215216
}

android/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
* @author Louis Wasserman
8888
*/
8989
@GwtCompatible
90+
@SuppressWarnings("WrongCommentType") // false positive
9091
abstract class AbstractMapBasedMultimap<K extends @Nullable Object, V extends @Nullable Object>
9192
extends AbstractMultimap<K, V> implements Serializable {
9293
/*

android/guava/src/com/google/common/collect/ImmutableBiMap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ private void readObject(ObjectInputStream stream) throws InvalidObjectException
625625
* ImmutableMap#toImmutableMap(Function, Function)} from consumers of {@code ImmutableBiMap}.
626626
*
627627
* @throws UnsupportedOperationException always
628-
* @deprecated Use {@link ImmutableBiMap#toImmutableBiMap}.
628+
* @deprecated Use {@link ImmutableBiMap#toImmutableBiMap(Function, Function)}.
629629
* @since 33.2.0 (available since 21.0 in guava-jre)
630630
*/
631631
@Deprecated
@@ -645,7 +645,7 @@ private void readObject(ObjectInputStream stream) throws InvalidObjectException
645645
* {@code ImmutableBiMap}.
646646
*
647647
* @throws UnsupportedOperationException always
648-
* @deprecated
648+
* @deprecated Use {@link ImmutableBiMap#toImmutableBiMap(Function, Function, BinaryOperator)}.
649649
* @since 33.2.0 (available since 21.0 in guava-jre)
650650
*/
651651
@Deprecated

android/guava/src/com/google/common/collect/LinkedListMultimap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
* @since 2.0
9595
*/
9696
@GwtCompatible(serializable = true, emulated = true)
97+
@SuppressWarnings("WrongCommentType") // false positive
9798
public class LinkedListMultimap<K extends @Nullable Object, V extends @Nullable Object>
9899
extends AbstractMultimap<K, V> implements ListMultimap<K, V>, Serializable {
99100
/*

guava/src/com/google/common/base/Predicates.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ public static Predicate<Class<?>> subtypeOf(Class<?> clazz) {
210210
*
211211
* @param target the collection that may contain the function input
212212
*/
213+
@SuppressWarnings("NoHardKeywords") // We're stuck with the name for compatibility reasons.
213214
public static <T extends @Nullable Object> Predicate<T> in(Collection<? extends T> target) {
214215
return new InPredicate<>(target);
215216
}

guava/src/com/google/common/collect/AbstractMapBasedMultimap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
* @author Louis Wasserman
9090
*/
9191
@GwtCompatible
92+
@SuppressWarnings("WrongCommentType") // false positive
9293
abstract class AbstractMapBasedMultimap<K extends @Nullable Object, V extends @Nullable Object>
9394
extends AbstractMultimap<K, V> implements Serializable {
9495
/*

guava/src/com/google/common/collect/ImmutableBiMap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ private void readObject(ObjectInputStream stream) throws InvalidObjectException
648648
* ImmutableMap#toImmutableMap(Function, Function)} from consumers of {@code ImmutableBiMap}.
649649
*
650650
* @throws UnsupportedOperationException always
651-
* @deprecated Use {@link ImmutableBiMap#toImmutableBiMap}.
651+
* @deprecated Use {@link ImmutableBiMap#toImmutableBiMap(Function, Function)}.
652652
*/
653653
@Deprecated
654654
@DoNotCall("Use toImmutableBiMap")
@@ -665,7 +665,7 @@ private void readObject(ObjectInputStream stream) throws InvalidObjectException
665665
* {@code ImmutableBiMap}.
666666
*
667667
* @throws UnsupportedOperationException always
668-
* @deprecated
668+
* @deprecated Use {@link ImmutableBiMap#toImmutableBiMap(Function, Function, BinaryOperator)}.
669669
*/
670670
@Deprecated
671671
@DoNotCall("Use toImmutableBiMap")

guava/src/com/google/common/collect/LinkedListMultimap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
* @since 2.0
9797
*/
9898
@GwtCompatible(serializable = true, emulated = true)
99+
@SuppressWarnings("WrongCommentType") // false positive
99100
public class LinkedListMultimap<K extends @Nullable Object, V extends @Nullable Object>
100101
extends AbstractMultimap<K, V> implements ListMultimap<K, V>, Serializable {
101102
/*

0 commit comments

Comments
 (0)