Skip to content

Commit 1b58195

Browse files
committed
Flip null test
1 parent 1979d4c commit 1b58195

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private static void remove(final BaseGenericObjectPool<?>.Evictor evictor) {
220220
* @param period Duration between executions.
221221
*/
222222
static synchronized void schedule(final BaseGenericObjectPool<?>.Evictor pool, final Duration delay, final Duration period) {
223-
if (null == executor) {
223+
if (executor == null) {
224224
executor = new ScheduledThreadPoolExecutor(1, new EvictorThreadFactory());
225225
executor.setRemoveOnCancelPolicy(true);
226226
executor.scheduleAtFixedRate(new Reaper(), delay.toMillis(), period.toMillis(), TimeUnit.MILLISECONDS);

src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ public synchronized T borrowObject() throws Exception {
179179
T obj = null;
180180
boolean newlyCreated = false;
181181
PooledSoftReference<T> ref = null;
182-
while (null == obj) {
182+
while (obj == null) {
183183
if (idleReferences.isEmpty()) {
184-
if (null == factory) {
184+
if (factory == null) {
185185
throw new NoSuchElementException();
186186
}
187187
newlyCreated = true;

0 commit comments

Comments
 (0)