Skip to content

Commit

Permalink
CR iteration 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyk-91 committed Jun 21, 2021
1 parent 34db391 commit 91a4083
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1054,10 +1054,10 @@ public void evict() throws Exception {
destroy(evictionKey, underTest, true, DestroyMode.NORMAL);
destroyedByEvictorCount.incrementAndGet();
if (validationThrowable != null) {
final NoSuchElementException nsee
= new NoSuchElementException("Unable to validate object");
nsee.initCause(validationThrowable);
throw nsee;
if (validationThrowable instanceof RuntimeException) {
throw (RuntimeException) validationThrowable;
}
throw (Error) validationThrowable;
}
} else {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,10 @@ public void evict() throws Exception {
destroy(underTest, DestroyMode.NORMAL);
destroyedByEvictorCount.incrementAndGet();
if (validationThrowable != null) {
final NoSuchElementException nsee
= new NoSuchElementException("Unable to validate object");
nsee.initCause(validationThrowable);
throw nsee;
if (validationThrowable instanceof RuntimeException) {
throw (RuntimeException) validationThrowable;
}
throw (Error) validationThrowable;
}
} else {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1572,8 +1572,8 @@ public void testExceptionInValidationDuringEviction() throws Exception {
simpleFactory.setThrowExceptionOnValidate(true);
try {
gkoPool.evict();
fail("Expecting NoSuchElementException");
} catch (NoSuchElementException e) {
fail("Expecting RuntimeException");
} catch (RuntimeException e) {
// expected
}
assertEquals(0, gkoPool.getNumActive());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1725,8 +1725,8 @@ public void testExceptionInValidationDuringEviction() throws Exception {

try {
genericObjectPool.evict();
fail("Expecting NoSuchElementException");
} catch (NoSuchElementException e) {
fail("Expecting RuntimeException");
} catch (RuntimeException e) {
// expected
}
assertEquals(0, genericObjectPool.getNumActive());
Expand Down

0 comments on commit 91a4083

Please sign in to comment.