Bug 49110 - runtime.JspFactoryImpl$PageContextPool needs to be static
Summary: runtime.JspFactoryImpl$PageContextPool needs to be static
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Jasper (show other bugs)
Version: trunk
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-12 19:50 UTC by Sebb
Modified: 2010-04-14 18:48 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebb 2010-04-12 19:50:48 UTC
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.
Comment 1 Mark Thomas 2010-04-14 18:48:01 UTC
Fixed for 7.0.0