Project: Tomcat
Bug 49110 runtime.JspFactoryImpl$PageContextPool needs to be static
Reported: 2010-04-12 19:50:48 | Status: resolved fixed

Findbugs says: Bug: org.apache.jasper.runtime.JspFactoryImpl$PageContextPool needs to be _static_ to avoid a deadly embrace with org.apache.jasper.runtime.JspFactoryImpl.localPool Pattern id: SIC_THREADLOCAL_DEADLY_EMBRACE, type: SIC, category: CORRECTNESS This class is an inner class, but should probably be a static inner class. As it is, there is a serious danger of a deadly embrace between the inner class and the thread local in the outer class. Because the inner class isn't static, it retains a reference to the outer class. If the thread local contains a reference to an instance of the inner class, the inner and outer instance will both be reachable and not eligible for garbage collection.

Files changed in fix:
java/org/apache/jasper/runtime/JspFactoryImpl.java