Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
The clean up code in AbandonedTrace is subject to the reference being cleared in between the condition being checked and the referent being added to the result.
while (iter.hasNext()) { WeakReference<AbandonedTrace> ref = iter.next(); if (ref.get() == null) { // Clean-up since we are here anyway iter.remove(); } else { result.add(ref.get()); } }
This can surface as a NullPointerException, e.g.
Caused by: java.lang.NullPointerException at org.apache.tomcat.dbcp.dbcp2.DelegatingStatement.close(DelegatingStatement.java:149)