Author: adrianc
Date: Wed Apr 25 16:27:13 2012
New Revision: 1330396

URL: http://svn.apache.org/viewvc?rev=1330396&view=rev
Log:
Modified MiniLangUtil.isConstantPlusExpressionAttribute to allow concatenated 
expressions.

Modified:
    ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangUtil.java

Modified: 
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangUtil.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangUtil.java?rev=1330396&r1=1330395&r2=1330396&view=diff
==============================================================================
--- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangUtil.java 
(original)
+++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangUtil.java Wed 
Apr 25 16:27:13 2012
@@ -77,6 +77,14 @@ public final class MiniLangUtil {
 
     public static boolean isConstantPlusExpressionAttribute(String 
attributeValue) {
         if (attributeValue.length() > 0) {
+            if (attributeValue.startsWith("${") && 
attributeValue.endsWith("}")) {
+                // A lot of existing code uses concatenated expressions, and 
they can be difficult
+                // to convert to a single expression, so we will allow them 
for now.
+                String expression = attributeValue.substring(2, 
attributeValue.length() - 1);
+                if (!expression.contains("${")) {
+                    return true;
+                }
+            }
             FlexibleStringExpander fse = 
FlexibleStringExpander.getInstance(attributeValue);
             return FlexibleStringExpander.containsConstant(fse);
         }


Reply via email to