Skip to content

Commit

Permalink
Fix a bad name for an exception parameter.
Browse files Browse the repository at this point in the history
_Some_ kind of exception is _required_ here, not merely _tolerated_. (The test _behavior_ is at least already correct: There's a `fail()` call at the end of the `try` block.)

I was ready to blame this on my multicatch cl/165645769 (which I figured may have merged 2 `catch` blocks with different parameter names), but in fact the name has been wrong since the file was written back in 2008 :)

RELNOTES=n/a
PiperOrigin-RevId: 651885774
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Jul 12, 2024
1 parent 8b6d8bb commit 123ae0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void testSet_unsupportedByEmptyList() {
try {
getList().set(0, e3());
fail("set() should throw UnsupportedOperationException or IndexOutOfBoundsException");
} catch (UnsupportedOperationException | IndexOutOfBoundsException tolerated) {
} catch (UnsupportedOperationException | IndexOutOfBoundsException expected) {
}
expectUnchanged();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void testSet_unsupportedByEmptyList() {
try {
getList().set(0, e3());
fail("set() should throw UnsupportedOperationException or IndexOutOfBoundsException");
} catch (UnsupportedOperationException | IndexOutOfBoundsException tolerated) {
} catch (UnsupportedOperationException | IndexOutOfBoundsException expected) {
}
expectUnchanged();
}
Expand Down

0 comments on commit 123ae0b

Please sign in to comment.