File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/pool2/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public String readToString(Reader in)
6060 // ignored
6161 }
6262 try {
63- if (null != buf ) {
63+ if (buf != null ) {
6464 pool .returnObject (buf );
6565 }
6666 } catch (Exception e ) {
Original file line number Diff line number Diff line change @@ -941,7 +941,7 @@ private void deregister(final K k) {
941941 // Pool may have changed since we released the read lock
942942 // numInterested decrement could lead to removal while waiting for write lock
943943 objectDeque = poolMap .get (k );
944- if (null != objectDeque && objectDeque .getNumInterested ().get () == 0 && objectDeque .getCreateCount ().get () == 0 ) {
944+ if (objectDeque != null && objectDeque .getNumInterested ().get () == 0 && objectDeque .getCreateCount ().get () == 0 ) {
945945 // NOTE: Keys must always be removed from both poolMap and
946946 // poolKeyList at the same time while protected by
947947 // keyLock.writeLock()
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ public synchronized T borrowObject() throws Exception {
199199 ref .getReference ().clear ();
200200 ref .setReference (new SoftReference <>(obj ));
201201 }
202- if (null != factory && null != obj ) {
202+ if (factory != null && obj != null ) {
203203 try {
204204 factory .activateObject (ref );
205205 if (!factory .validateObject (ref )) {
@@ -231,10 +231,10 @@ public synchronized T borrowObject() throws Exception {
231231 */
232232 @ Override
233233 public synchronized void clear () {
234- if (null != factory ) {
234+ if (factory != null ) {
235235 idleReferences .forEach (ref -> {
236236 try {
237- if (null != ref .getObject ()) {
237+ if (ref .getObject () != null ) {
238238 factory .destroyObject (ref );
239239 }
240240 } catch (final Exception ignored ) {
You can’t perform that action at this time.
0 commit comments