tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r937309 - in /tomcat/trunk/java/org/apache: catalina/realm/ catalina/session/ catalina/startup/ catalina/util/ tomcat/util/modeler/modules/
Date Fri, 23 Apr 2010 14:23:45 GMT
Author: markt
Date: Fri Apr 23 14:23:45 2010
New Revision: 937309

URL: http://svn.apache.org/viewvc?rev=937309&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49143
Threading / initialisation issues. Not all were valid. Make them volatile anyway so FindBugs
doesn't complain.
Fix some additional issues - use of valueOf() - found along the way

Modified:
    tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java
    tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
    tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java
    tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java
    tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java

Modified: tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java?rev=937309&r1=937308&r2=937309&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java Fri Apr 23 14:23:45 2010
@@ -124,7 +124,7 @@ public abstract class RealmBase extends 
     /**
      * MD5 message digest provider.
      */
-    protected static MessageDigest md5Helper;
+    protected static volatile MessageDigest md5Helper;
 
 
     /**

Modified: tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?rev=937309&r1=937308&r2=937309&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/StandardSession.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/StandardSession.java Fri Apr 23 14:23:45
2010
@@ -249,7 +249,7 @@ public class StandardSession
     /**
      * The HTTP session context associated with this session.
      */
-    protected static HttpSessionContext sessionContext = null;
+    protected static volatile HttpSessionContext sessionContext = null;
 
 
     /**
@@ -1559,12 +1559,12 @@ public class StandardSession
     protected void writeObject(ObjectOutputStream stream) throws IOException {
 
         // Write the scalar instance variables (except Manager)
-        stream.writeObject(new Long(creationTime));
-        stream.writeObject(new Long(lastAccessedTime));
-        stream.writeObject(new Integer(maxInactiveInterval));
-        stream.writeObject(new Boolean(isNew));
-        stream.writeObject(new Boolean(isValid));
-        stream.writeObject(new Long(thisAccessedTime));
+        stream.writeObject(Long.valueOf(creationTime));
+        stream.writeObject(Long.valueOf(lastAccessedTime));
+        stream.writeObject(Integer.valueOf(maxInactiveInterval));
+        stream.writeObject(Boolean.valueOf(isNew));
+        stream.writeObject(Boolean.valueOf(isValid));
+        stream.writeObject(Long.valueOf(thisAccessedTime));
         stream.writeObject(id);
         if (manager.getContainer().getLogger().isDebugEnabled())
             manager.getContainer().getLogger().debug
@@ -1589,7 +1589,7 @@ public class StandardSession
 
         // Serialize the attribute count and the Serializable attributes
         int n = saveNames.size();
-        stream.writeObject(new Integer(n));
+        stream.writeObject(Integer.valueOf(n));
         for (int i = 0; i < n; i++) {
             stream.writeObject(saveNames.get(i));
             try {

Modified: tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java?rev=937309&r1=937308&r2=937309&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java Fri Apr 23 14:23:45 2010
@@ -66,7 +66,7 @@ public final class TldConfig  implements
     private static final String WEB_INF_LIB = "/WEB-INF/lib/";
     
     // Names of JARs that are known not to contain any TLDs
-    private static Set<String> noTldJars = null;
+    private static volatile Set<String> noTldJars = null;
 
     private static final org.apache.juli.logging.Log log=
         org.apache.juli.logging.LogFactory.getLog( TldConfig.class );

Modified: tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java?rev=937309&r1=937308&r2=937309&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java Fri Apr 23 14:23:45
2010
@@ -62,7 +62,8 @@ public final class ExtensionValidator {
     private static final StringManager sm =
         StringManager.getManager("org.apache.catalina.util");
     
-    private static ArrayList<Extension> containerAvailableExtensions = null;
+    private static volatile ArrayList<Extension> containerAvailableExtensions =
+        null;
     private static ArrayList<ManifestResource> containerManifestResources =
         new ArrayList<ManifestResource>();
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java?rev=937309&r1=937308&r2=937309&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
Fri Apr 23 14:23:45 2010
@@ -42,7 +42,7 @@ public class MbeansDescriptorsDigesterSo
     String type;
     Object source;
     List<ObjectName> mbeans = new ArrayList<ObjectName>();
-    protected static Digester digester = null;
+    protected static volatile Digester digester = null;
     
     protected static Digester createDigester(Registry registry) {
 



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


Mime
View raw message