[ https://issues.apache.org/jira/browse/POOL-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16935067#comment-16935067 ]
Phil Steitz commented on POOL-376: ---------------------------------- Thanks for reporting this. The patch in the PR would fix the immediate problem, but this code should not be in destroy(). See comments in POOL-356. > invalidateObject should not return NullPointerException > ------------------------------------------------------- > > Key: POOL-376 > URL: https://issues.apache.org/jira/browse/POOL-376 > Project: Commons Pool > Issue Type: Improvement > Affects Versions: 2.6.2 > Reporter: M Sazzadul Hoque > Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > {{GenericObjectPool.invalidateObject(T obj)}} should not return > {{NullPointerException}} when obj is not null. > Please see following stack trace: > {code:java} > Caused by: java.lang.NullPointerException > at > org.apache.commons.pool2.impl.LinkedBlockingDeque.putLast(LinkedBlockingDeque.java:454) > at > org.apache.commons.pool2.impl.LinkedBlockingDeque.put(LinkedBlockingDeque.java:788) > at > org.apache.commons.pool2.impl.GenericObjectPool.destroy(GenericObjectPool.java:939) > at > org.apache.commons.pool2.impl.GenericObjectPool.invalidateObject(GenericObjectPool.java:618) > {code} > Apparent reason: In {{destroy(PooledObject<T> toDestroy)}}, create() may > return null even though {{toDestroy}} is already destroyed. > Please make the fix available for JDK 1.7. -- This message was sent by Atlassian Jira (v8.3.4#803005)