Skip to content

Commit

Permalink
Small tweaks to fix Error Prone warnings. (#2227)
Browse files Browse the repository at this point in the history
* Small tweaks to fix Error Prone warnings.

* Add another suppression.
  • Loading branch information
eamonnmcmanus authored Oct 24, 2022
1 parent 66d9621 commit 9578583
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ JsonElement nextJsonElement() throws IOException {
JsonToken peeked = peek();
switch (peeked) {
case NAME:
nextName(true);
String unused = nextName(true);
break;
case END_ARRAY:
endArray();
Expand Down
4 changes: 2 additions & 2 deletions gson/src/test/java/com/google/gson/JsonArrayAsListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void testContains() {
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);
}
Expand All @@ -227,7 +227,7 @@ public void testIndexOf() {
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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void testContainsValue() {
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);
}
Expand Down

0 comments on commit 9578583

Please sign in to comment.