Skip to content

Commit

Permalink
Combine else if.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Gregory committed May 26, 2021
1 parent 347bd1b commit 1077d2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,8 @@ public T borrowObject(final K key, final long borrowMaxWaitMillis) throws Except
throw new NoSuchElementException(
"Timeout waiting for idle object");
}
} else {
if (p == null) {
throw new NoSuchElementException("Pool exhausted");
}
} else if (p == null) {
throw new NoSuchElementException("Pool exhausted");
}
if (!p.allocate()) {
p = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,8 @@ public T borrowObject(final Duration borrowMaxWait) throws Exception {
if (p == null) {
throw new NoSuchElementException("Timeout waiting for idle object");
}
} else {
if (p == null) {
throw new NoSuchElementException("Pool exhausted");
}
} else if (p == null) {
throw new NoSuchElementException("Pool exhausted");
}
if (!p.allocate()) {
p = null;
Expand Down

0 comments on commit 1077d2b

Please sign in to comment.