Author: markt
Date: Wed Aug 12 11:32:00 2009
New Revision: 803456

URL: http://svn.apache.org/viewvc?rev=803456&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=41661
Thread safety issue in JspConfig.init() seen in production

Modified:
    tomcat/tc5.5.x/trunk/STATUS.txt
    tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml
    
tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/JspConfig.java

Modified: tomcat/tc5.5.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/STATUS.txt?rev=803456&r1=803455&r2=803456&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/STATUS.txt (original)
+++ tomcat/tc5.5.x/trunk/STATUS.txt Wed Aug 12 11:32:00 2009
@@ -77,12 +77,6 @@
   -1: 
   rjung: minus the generics
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=41661
-  Thread safety issue in JspConfig.init() seen in production
-  http://svn.apache.org/viewvc?rev=795210&view=rev
-  +1: markt, kkolinko, rjung
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46907
   Debug logging should not cause input stream to be swallowed
   http://svn.apache.org/viewvc?view=rev&revision=797168

Modified: tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml?rev=803456&r1=803455&r2=803456&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml (original)
+++ tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml Wed Aug 12 
11:32:00 2009
@@ -66,6 +66,9 @@
   </subsection>
   <subsection name="Jasper">
     <changelog>
+      <fix>
+        <bug>41661</bug>: Fix thread safety issue in JspConfig.init() (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Cluster">

Modified: 
tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/JspConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/JspConfig.java?rev=803456&r1=803455&r2=803456&view=diff
==============================================================================
--- 
tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/JspConfig.java 
(original)
+++ 
tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/JspConfig.java 
Wed Aug 12 11:32:00 2009
@@ -47,7 +47,7 @@
 
     private Vector jspProperties = null;
     private ServletContext ctxt;
-    private boolean initialized = false;
+    private volatile boolean initialized = false;
 
     private String defaultIsXml = null;                // unspecified
     private String defaultIsELIgnored = null;        // unspecified
@@ -195,12 +195,15 @@
     private void init() throws JasperException {
 
         if (!initialized) {
-            processWebDotXml(ctxt);
-            defaultJspProperty = new JspProperty(defaultIsXml,
-                                                 defaultIsELIgnored,
-                                                 defaultIsScriptingInvalid,
-                                                 null, null, null);
-            initialized = true;
+            synchronized (this) {
+                if (!initialized) {
+                    processWebDotXml(ctxt);
+                    defaultJspProperty = new JspProperty(defaultIsXml,
+                            defaultIsELIgnored, defaultIsScriptingInvalid,
+                            null, null, null);
+                    initialized = true;
+                }                
+            }
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to