Fix NPE in DeferredHitInfoFlush when Jetty request is recycled#716
Conversation
In makeAhiValue, parameters may contain ContextStack values (which implement Map). The previous check order called ObjectUtilities.isEmpty(value) before value instanceof Map, causing ContextStack.size() to traverse the stack and hit a recycled Jetty EE11 request object in a background thread — resulting in a NullPointerException from ServletApiRequest.getRequest() returning null. Fix by checking instanceof Map/Collection before isEmpty so ContextStack values short-circuit without calling size(). Also add a defensive NullPointerException catch in ServletRequestContainer.getAttributeNames() to mirror the existing IllegalStateException guard in HttpSessionContainer.
|
To reproduced this error visit resource finder screen,
|
In makeAhiValue, parameters may contain ContextStack values (which implement Map). The previous check order called ObjectUtilities.isEmpty(value) before value instanceof Map, causing ContextStack.size() to traverse the stack and hit a recycled Jetty EE11 request object in a background thread — resulting in a NullPointerException from ServletApiRequest.getRequest() returning null.
Fix by checking instanceof Map/Collection before isEmpty so ContextStack values short-circuit without calling size(). Also add a defensive NullPointerException catch in ServletRequestContainer.getAttributeNames() to mirror the existing IllegalStateException guard in HttpSessionContainer.