This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch POOL_2_X in repository https://gitbox.apache.org/repos/asf/commons-pool.git
commit c878a2127e918f04b32809b0f30c3d4a14f10d92 Author: Gary Gregory <[email protected]> AuthorDate: Fri Nov 21 20:53:45 2025 +0000 No need to nest else clause --- .../commons/pool2/pool407/AbstractPool407Test.java | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/test/java/org/apache/commons/pool2/pool407/AbstractPool407Test.java b/src/test/java/org/apache/commons/pool2/pool407/AbstractPool407Test.java index b4915441..1a6fb387 100644 --- a/src/test/java/org/apache/commons/pool2/pool407/AbstractPool407Test.java +++ b/src/test/java/org/apache/commons/pool2/pool407/AbstractPool407Test.java @@ -34,22 +34,20 @@ class AbstractPool407Test { // The factory makes non-null objects and non-null PooledObjects, // therefore the ExecutorService should terminate when requested, without delay. assertTrue(termination); - } else { + } else if (poolConfigMaxWait.equals(Pool407Constants.WAIT_FOREVER)) { // The factory makes null objects or null PooledObjects, // therefore the ExecutorService should keep trying to create objects as configured in the pool's config object. - if (poolConfigMaxWait.equals(Pool407Constants.WAIT_FOREVER)) { - // If poolConfigMaxWait is maxed out, then the ExecutorService will not shutdown without delay. - if (obj == null) { - // create() returned null, so wrap() was not even called, and borrowObject() fails fast. - assertTrue(termination); - } else { - // The ExecutorService fails to terminate when requested because - assertFalse(true); - } - } else { - // If poolConfigMaxWait is short, then the ExecutorService should usually shutdown without delay. + // If poolConfigMaxWait is maxed out, then the ExecutorService will not shutdown without delay. + if (obj == null) { + // create() returned null, so wrap() was not even called, and borrowObject() fails fast. assertTrue(termination); + } else { + // The ExecutorService fails to terminate when requested because + assertFalse(true); } + } else { + // If poolConfigMaxWait is short, then the ExecutorService should usually shutdown without delay. + assertTrue(termination); } }
