Small tweaks to fix Error Prone warnings. (#2227)
* Small tweaks to fix Error Prone warnings. * Add another suppression.
This commit is contained in:
parent
66d9621ce8
commit
9578583eff
|
@ -277,7 +277,7 @@ public final class JsonTreeReader extends JsonReader {
|
||||||
JsonToken peeked = peek();
|
JsonToken peeked = peek();
|
||||||
switch (peeked) {
|
switch (peeked) {
|
||||||
case NAME:
|
case NAME:
|
||||||
nextName(true);
|
String unused = nextName(true);
|
||||||
break;
|
break;
|
||||||
case END_ARRAY:
|
case END_ARRAY:
|
||||||
endArray();
|
endArray();
|
||||||
|
|
|
@ -210,7 +210,7 @@ public class JsonArrayAsListTest {
|
||||||
assertFalse(list.contains(new JsonPrimitive(2)));
|
assertFalse(list.contains(new JsonPrimitive(2)));
|
||||||
assertFalse(list.contains(null));
|
assertFalse(list.contains(null));
|
||||||
|
|
||||||
@SuppressWarnings("unlikely-arg-type")
|
@SuppressWarnings({"unlikely-arg-type", "CollectionIncompatibleType"})
|
||||||
boolean containsInt = list.contains(1); // should only contain JsonPrimitive(1)
|
boolean containsInt = list.contains(1); // should only contain JsonPrimitive(1)
|
||||||
assertFalse(containsInt);
|
assertFalse(containsInt);
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ public class JsonArrayAsListTest {
|
||||||
assertEquals(-1, list.indexOf(new JsonPrimitive(2)));
|
assertEquals(-1, list.indexOf(new JsonPrimitive(2)));
|
||||||
assertEquals(-1, list.indexOf(null));
|
assertEquals(-1, list.indexOf(null));
|
||||||
|
|
||||||
@SuppressWarnings("unlikely-arg-type")
|
@SuppressWarnings({"unlikely-arg-type", "CollectionIncompatibleType"})
|
||||||
int indexOfInt = list.indexOf(1); // should only contain JsonPrimitive(1)
|
int indexOfInt = list.indexOf(1); // should only contain JsonPrimitive(1)
|
||||||
assertEquals(-1, indexOfInt);
|
assertEquals(-1, indexOfInt);
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class JsonObjectAsMapTest {
|
||||||
assertFalse(map.containsValue(new JsonPrimitive(2)));
|
assertFalse(map.containsValue(new JsonPrimitive(2)));
|
||||||
assertFalse(map.containsValue(null));
|
assertFalse(map.containsValue(null));
|
||||||
|
|
||||||
@SuppressWarnings("unlikely-arg-type")
|
@SuppressWarnings({"unlikely-arg-type", "CollectionIncompatibleType"})
|
||||||
boolean containsInt = map.containsValue(1); // should only contain JsonPrimitive(1)
|
boolean containsInt = map.containsValue(1); // should only contain JsonPrimitive(1)
|
||||||
assertFalse(containsInt);
|
assertFalse(containsInt);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue