This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-pool.git
The following commit(s) were added to refs/heads/master by this push: new 65940fb Raise embedded if into parent if. 65940fb is described below commit 65940fb117384b681141d7712bedf8fd95cda986 Author: Gary Gregory <gardgreg...@gmail.com> AuthorDate: Sun Feb 28 12:48:28 2021 -0500 Raise embedded if into parent if. --- .../org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java | 6 ++---- .../java/org/apache/commons/pool2/impl/TestGenericObjectPool.java | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java index f32e053..64e7347 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java @@ -180,10 +180,8 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { @Override public void activateObject(final K key, final PooledObject<String> obj) throws Exception { - if (exceptionOnActivate) { - if (!(validateCounter++%2 == 0 ? evenValid : oddValid)) { - throw new Exception(); - } + if (exceptionOnActivate && !(validateCounter++%2 == 0 ? evenValid : oddValid)) { + throw new Exception(); } } @Override diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java index 175662a..2a9841d 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java @@ -285,10 +285,8 @@ public class TestGenericObjectPool extends TestBaseObjectPool { oddTest = oddValid; counter = activationCounter++; } - if (hurl) { - if (!(counter%2 == 0 ? evenTest : oddTest)) { - throw new Exception(); - } + if (hurl && !(counter%2 == 0 ? evenTest : oddTest)) { + throw new Exception(); } } @Override