svn commit: r1620249 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1620249 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java

adrianc
Author: adrianc
Date: Mon Aug 25 00:37:24 2014
New Revision: 1620249

URL: http://svn.apache.org/r1620249
Log:
Small code cleanup in UtilCache.java.

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

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java?rev=1620249&r1=1620248&r2=1620249&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java Mon Aug 25 00:37:24 2014
@@ -190,17 +190,15 @@ public class UtilCache<K, V> implements
 
     public static String getPropertyParam(ResourceBundle res, String[] propNames, String parameter) {
         try {
-            for (String propName: propNames) {
-            if(res.containsKey(propName+ '.' + parameter)) {
-                try {
-                return res.getString(propName + '.' + parameter);
-                } catch (MissingResourceException e) {}
-            }
+            for (String propName : propNames) {
+                String key = propName.concat(".").concat(parameter);
+                if (res.containsKey(key)) {
+                    try {
+                        return res.getString(key);
+                    } catch (MissingResourceException e) {
+                    }
+                }
             }
-            // don't need this, just return null
-            //if (value == null) {
-            //    throw new MissingResourceException("Can't find resource for bundle", res.getClass().getName(), Arrays.asList(propNames) + "." + parameter);
-            //}
         } catch (Exception e) {
             Debug.logWarning(e, "Error getting " + parameter + " value from ResourceBundle for propNames: " + propNames, module);
         }