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/07/07 17:18:35 UTC

svn commit: r674523 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/collections/ResourceBundleMapWrapper.java

Author: adrianc
Date: Mon Jul  7 08:18:35 2008
New Revision: 674523

URL: http://svn.apache.org/viewvc?rev=674523&view=rev
Log:
Small fixup for last commit - faster, safer code.

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

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/collections/ResourceBundleMapWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/collections/ResourceBundleMapWrapper.java?rev=674523&r1=674522&r2=674523&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/collections/ResourceBundleMapWrapper.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/collections/ResourceBundleMapWrapper.java Mon Jul  7 08:18:35 2008
@@ -118,10 +118,12 @@
         Object value = this.rbmwStack.get(arg0);
         if (value == null) {
             value = arg0;
-        } else {
-            String str = (String) value;
-            if (str.contains("${") && context != null) {
+        } else if (context != null){
+            try {
+                String str = (String) value;
                 return FlexibleStringExpander.expandString(str, context);
+            } catch (Exception e) {
+                // Potential ClassCastException - do nothing
             }
         }
         return value;