commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1195775 - in /commons/proper/vfs/trunk: core/src/main/java/org/apache/commons/vfs2/util/Messages.java src/changes/changes.xml
Date Tue, 01 Nov 2011 02:34:22 GMT
Author: ggregory
Date: Tue Nov  1 02:34:22 2011
New Revision: 1195775

URL: http://svn.apache.org/viewvc?rev=1195775&view=rev
Log:
[VFS-364] Incorrect lazy initialization of static field org.apache.commons.vfs2.util.Messages.resources
in org.apache.commons.vfs2.util.Messages.findMessage(String)

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java
    commons/proper/vfs/trunk/src/changes/changes.xml

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java?rev=1195775&r1=1195774&r2=1195775&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java
Tue Nov  1 02:34:22 2011
@@ -34,7 +34,7 @@ public final class Messages
      */
     private static ConcurrentMap<String, MessageFormat> messages =
         new ConcurrentHashMap<String, MessageFormat>();
-    private static ResourceBundle resources;
+    private static final ResourceBundle resources = new CombinedResources("org.apache.commons.vfs2.Resources");
 
     private Messages()
     {
@@ -101,11 +101,6 @@ public final class Messages
             return msg;
         }
 
-        // Locate the message
-        if (resources == null)
-        {
-            resources = new CombinedResources("org.apache.commons.vfs2.Resources");
-        }
         final String msgText = resources.getString(code);
         msg = new MessageFormat(msgText);
         messages.putIfAbsent(code, msg);

Modified: commons/proper/vfs/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/src/changes/changes.xml?rev=1195775&r1=1195774&r2=1195775&view=diff
==============================================================================
--- commons/proper/vfs/trunk/src/changes/changes.xml (original)
+++ commons/proper/vfs/trunk/src/changes/changes.xml Tue Nov  1 02:34:22 2011
@@ -23,6 +23,9 @@
 
   <body>
     <release version="2.1" date="TBD" description="">
+      <action issue="VFS-374" dev="ggregory" type="fix">
+        Incorrect lazy initialization of static field org.apache.commons.vfs2.util.Messages.resources
in org.apache.commons.vfs2.util.Messages.findMessage(String)Add FileContent write APIs.
+      </action>
       <action issue="VFS-373" dev="ggregory" type="add">
         Add FileContent write APIs.
       </action>



Mime
View raw message