svn commit: r724373 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelUtil.java

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

svn commit: r724373 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelUtil.java

adrianc
Author: adrianc
Date: Mon Dec  8 06:58:14 2008
New Revision: 724373

URL: http://svn.apache.org/viewvc?rev=724373&view=rev
Log:
Fixed parsing errors in Unified Expression Language code.

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

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelUtil.java?rev=724373&r1=724372&r2=724373&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelUtil.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/UelUtil.java Mon Dec  8 06:58:14 2008
@@ -24,9 +24,12 @@
 
 import javolution.util.FastMap;
 
+import org.ofbiz.base.util.Debug;
+
 /** Implements the Unified Expression Language (JSR-245). */
 public class UelUtil {
     
+    protected static final String module = UelUtil.class.getName();
     public static final FunctionMapper functionMapper = new Functions();
     protected static final ExpressionFactory exprFactory = new de.odysseus.el.ExpressionFactoryImpl();
     protected static final ELResolver defaultResolver = new CompositeELResolver() {
@@ -45,12 +48,14 @@
      * @return Result object
      */
     public static Object evaluate(Map<String, ? extends Object> context, String expression) {
-        ELContext elContext = new BasicContext(context);
-        ValueExpression ve = exprFactory.createValueExpression(elContext, expression, Object.class);
         Object obj = null;
         try {
+            ELContext elContext = new BasicContext(context);
+            ValueExpression ve = exprFactory.createValueExpression(elContext, expression, Object.class);
             obj = ve.getValue(elContext);
-        } catch (Exception e) {}
+        } catch (Exception e) {
+            Debug.logVerbose("Error evaluating expression: " + e, module);
+        }
         return obj;
     }