Small tweaks to fix Error Prone warnings. (#2227)

* Small tweaks to fix Error Prone warnings.

* Add another suppression.
This commit is contained in:
Éamonn McManus 2022-10-24 10:28:25 -07:00 committed by GitHub
parent 66d9621ce8
commit 9578583eff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -277,7 +277,7 @@ public final class JsonTreeReader extends JsonReader {
JsonToken peeked = peek();
switch (peeked) {
case NAME:
nextName(true);
String unused = nextName(true);
break;
case END_ARRAY:
endArray();

View File

@ -210,7 +210,7 @@ public class JsonArrayAsListTest {
assertFalse(list.contains(new JsonPrimitive(2)));
assertFalse(list.contains(null));
@SuppressWarnings("unlikely-arg-type")
@SuppressWarnings({"unlikely-arg-type", "CollectionIncompatibleType"})
boolean containsInt = list.contains(1); // should only contain JsonPrimitive(1)
assertFalse(containsInt);
}
@ -227,7 +227,7 @@ public class JsonArrayAsListTest {
assertEquals(-1, list.indexOf(new JsonPrimitive(2)));
assertEquals(-1, list.indexOf(null));
@SuppressWarnings("unlikely-arg-type")
@SuppressWarnings({"unlikely-arg-type", "CollectionIncompatibleType"})
int indexOfInt = list.indexOf(1); // should only contain JsonPrimitive(1)
assertEquals(-1, indexOfInt);

View File

@ -59,7 +59,7 @@ public class JsonObjectAsMapTest {
assertFalse(map.containsValue(new JsonPrimitive(2)));
assertFalse(map.containsValue(null));
@SuppressWarnings("unlikely-arg-type")
@SuppressWarnings({"unlikely-arg-type", "CollectionIncompatibleType"})
boolean containsInt = map.containsValue(1); // should only contain JsonPrimitive(1)
assertFalse(containsInt);
}