This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch POOL_2_X
in repository https://gitbox.apache.org/repos/asf/commons-pool.git
The following commit(s) were added to refs/heads/POOL_2_X by this push:
new 1b581950 Flip null test
1b581950 is described below
commit 1b581950768aee539a6d2003f43f2acd86bbaf15
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Jul 5 10:00:33 2026 -0400
Flip null test
---
src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java | 2 +-
.../java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
b/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
index 7867ef87..96dd2655 100644
--- a/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
+++ b/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
@@ -220,7 +220,7 @@ final class EvictionTimer {
* @param period Duration between executions.
*/
static synchronized void schedule(final BaseGenericObjectPool<?>.Evictor
pool, final Duration delay, final Duration period) {
- if (null == executor) {
+ if (executor == null) {
executor = new ScheduledThreadPoolExecutor(1, new
EvictorThreadFactory());
executor.setRemoveOnCancelPolicy(true);
executor.scheduleAtFixedRate(new Reaper(), delay.toMillis(),
period.toMillis(), TimeUnit.MILLISECONDS);
diff --git
a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
index 472aa62c..1ae3adba 100644
--- a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
@@ -179,9 +179,9 @@ public class SoftReferenceObjectPool<T> extends
BaseObjectPool<T> {
T obj = null;
boolean newlyCreated = false;
PooledSoftReference<T> ref = null;
- while (null == obj) {
+ while (obj == null) {
if (idleReferences.isEmpty()) {
- if (null == factory) {
+ if (factory == null) {
throw new NoSuchElementException();
}
newlyCreated = true;