Author: henrib
Date: Thu Aug  4 13:52:18 2016
New Revision: 1755188

URL: http://svn.apache.org/viewvc?rev=1755188&view=rev
Log:
JEXL-201: added setting options from engine

Modified:
    
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JexlEvalContext.java

Modified: 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JexlEvalContext.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JexlEvalContext.java?rev=1755188&r1=1755187&r2=1755188&view=diff
==============================================================================
--- 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JexlEvalContext.java
 (original)
+++ 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JexlEvalContext.java
 Thu Aug  4 13:52:18 2016
@@ -117,6 +117,17 @@ public class JexlEvalContext implements
     }
 
     /**
+     * Set options from engine.
+     * @param jexl the engine
+     */
+    public void setOptions(JexlEngine jexl) {
+        silent = jexl.isSilent();
+        strict = jexl.isStrict();
+        mathScale = jexl.getArithmetic().getMathScale();
+        mathContext = jexl.getArithmetic().getMathContext();
+    }
+
+    /**
      * Sets whether the engine will throw JexlException during evaluation when 
an error is triggered.
      * @param s true means no JexlException will occur, false allows them
      */
@@ -147,9 +158,9 @@ public class JexlEvalContext implements
      * @param se the engine strict flag
      * @param sa the arithmetic strict flag
      */
-    public void setStrict(boolean se, boolean sa) {
-        this.strict = se ? Boolean.TRUE : Boolean.FALSE;
-        this.mathStrict = sa ? Boolean.TRUE : Boolean.FALSE;
+    public void setStrict(Boolean se, Boolean sa) {
+        this.strict = se == null? null : se ? Boolean.TRUE : Boolean.FALSE;
+        this.mathStrict = sa == null? null : sa ? Boolean.TRUE : Boolean.FALSE;
     }
 
     /**


Reply via email to