Skip to content

Commit

Permalink
Suppress some CheckReturnValue errors.
Browse files Browse the repository at this point in the history
We may just improve our checker to not issue errors for this `try`-`fail` pattern, but for now, let's get the build green.

RELNOTES=n/a
PiperOrigin-RevId: 488760922
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Nov 15, 2022
1 parent d06cbb6 commit c5d7b86
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void testContainsEntryNullNo() {
@MapFeature.Require(absent = ALLOWS_NULL_KEY_QUERIES)
public void testContainsEntryNullDisallowedBecauseKeyQueriesDisallowed() {
try {
multimap().containsEntry(null, v3());
boolean unused = multimap().containsEntry(null, v3());
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
// success
Expand All @@ -79,7 +79,7 @@ public void testContainsEntryNullDisallowedBecauseKeyQueriesDisallowed() {
@MapFeature.Require(absent = ALLOWS_NULL_VALUE_QUERIES)
public void testContainsEntryNullDisallowedBecauseValueQueriesDisallowed() {
try {
multimap().containsEntry(k3(), null);
boolean unused = multimap().containsEntry(k3(), null);
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
// success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void testContainsKeyNullAbsent() {
@MapFeature.Require(absent = ALLOWS_NULL_KEY_QUERIES)
public void testContainsKeyNullDisallowed() {
try {
multimap().containsKey(null);
boolean unused = multimap().containsKey(null);
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
// success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void testContainsNullValueNo() {
@MapFeature.Require(absent = ALLOWS_NULL_VALUE_QUERIES)
public void testContainsNullValueFails() {
try {
multimap().containsValue(null);
boolean unused = multimap().containsValue(null);
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
// success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void testGetNullAbsent() {
@MapFeature.Require(absent = ALLOWS_NULL_KEY_QUERIES)
public void testGetNullForbidden() {
try {
multimap().get(null);
Collection<V> unused = multimap().get(null);
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
// success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void testCount_nullAbsent() {
@CollectionFeature.Require(absent = ALLOWS_NULL_QUERIES)
public void testCount_null_forbidden() {
try {
getMultiset().count(null);
int unused = getMultiset().count(null);
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public void testPollFirst() {
@CollectionFeature.Require(absent = SUPPORTS_REMOVE)
public void testPollFirstUnsupported() {
try {
sortedMultiset.pollFirstEntry();
Entry<E> unused = sortedMultiset.pollFirstEntry();
fail();
} catch (UnsupportedOperationException e) {
}
Expand Down Expand Up @@ -234,7 +234,7 @@ public void testPollLast() {
@CollectionSize.Require(SEVERAL)
public void testPollLastUnsupported() {
try {
sortedMultiset.pollLastEntry();
Entry<E> unused = sortedMultiset.pollLastEntry();
fail();
} catch (UnsupportedOperationException e) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void testContainsEntryNullNo() {
@MapFeature.Require(absent = ALLOWS_NULL_KEY_QUERIES)
public void testContainsEntryNullDisallowedBecauseKeyQueriesDisallowed() {
try {
multimap().containsEntry(null, v3());
boolean unused = multimap().containsEntry(null, v3());
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
// success
Expand All @@ -79,7 +79,7 @@ public void testContainsEntryNullDisallowedBecauseKeyQueriesDisallowed() {
@MapFeature.Require(absent = ALLOWS_NULL_VALUE_QUERIES)
public void testContainsEntryNullDisallowedBecauseValueQueriesDisallowed() {
try {
multimap().containsEntry(k3(), null);
boolean unused = multimap().containsEntry(k3(), null);
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
// success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void testContainsKeyNullAbsent() {
@MapFeature.Require(absent = ALLOWS_NULL_KEY_QUERIES)
public void testContainsKeyNullDisallowed() {
try {
multimap().containsKey(null);
boolean unused = multimap().containsKey(null);
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
// success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void testContainsNullValueNo() {
@MapFeature.Require(absent = ALLOWS_NULL_VALUE_QUERIES)
public void testContainsNullValueFails() {
try {
multimap().containsValue(null);
boolean unused = multimap().containsValue(null);
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
// success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void testGetNullAbsent() {
@MapFeature.Require(absent = ALLOWS_NULL_KEY_QUERIES)
public void testGetNullForbidden() {
try {
multimap().get(null);
Collection<V> unused = multimap().get(null);
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
// success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void testCount_nullAbsent() {
@CollectionFeature.Require(absent = ALLOWS_NULL_QUERIES)
public void testCount_null_forbidden() {
try {
getMultiset().count(null);
int unused = getMultiset().count(null);
fail("Expected NullPointerException");
} catch (NullPointerException expected) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public void testPollFirst() {
@CollectionFeature.Require(absent = SUPPORTS_REMOVE)
public void testPollFirstUnsupported() {
try {
sortedMultiset.pollFirstEntry();
Entry<E> unused = sortedMultiset.pollFirstEntry();
fail();
} catch (UnsupportedOperationException e) {
}
Expand Down Expand Up @@ -234,7 +234,7 @@ public void testPollLast() {
@CollectionSize.Require(SEVERAL)
public void testPollLastUnsupported() {
try {
sortedMultiset.pollLastEntry();
Entry<E> unused = sortedMultiset.pollLastEntry();
fail();
} catch (UnsupportedOperationException e) {
}
Expand Down

0 comments on commit c5d7b86

Please sign in to comment.