You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2008/11/07 18:06:53 UTC

svn commit: r712201 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java

Author: adrianc
Date: Fri Nov  7 09:06:48 2008
New Revision: 712201

URL: http://svn.apache.org/viewvc?rev=712201&view=rev
Log:
Fixed a small bug in UtilProperties.java where some properties files were cached twice.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java?rev=712201&r1=712200&r2=712201&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java Fri Nov  7 09:06:48 2008
@@ -160,10 +160,11 @@
      * @return The properties file
      */
     public static Properties getProperties(String resource) {
-        if (resource == null || resource.length() <= 0)
+        if (resource == null || resource.length() <= 0) {
             return null;
-        FlexibleProperties properties = resourceCache.get(resource);
-
+        }
+        String cacheKey = resource.replace(".properties", "");
+        FlexibleProperties properties = resourceCache.get(cacheKey);
         if (properties == null) {
             try {
                 URL url = UtilURL.fromResource(resource);
@@ -171,7 +172,7 @@
                 if (url == null)
                     return null;
                 properties = FlexibleProperties.makeFlexibleProperties(url);
-                resourceCache.put(resource, properties);
+                resourceCache.put(cacheKey, properties);
             } catch (MissingResourceException e) {
                 Debug.log(e.getMessage(), module);
             }