You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by he...@apache.org on 2009/08/30 15:44:25 UTC
svn commit: r809337 - in
/commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl:
JexlArithmetic.java JexlEngine.java
Author: henrib
Date: Sun Aug 30 13:44:24 2009
New Revision: 809337
URL: http://svn.apache.org/viewvc?rev=809337&view=rev
Log:
Document setSilent/setDebug/setLenient/setFunctions methods as non-thread-safe (cf JEXL-83)
Modified:
commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java
commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlEngine.java
Modified: commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java?rev=809337&r1=809336&r2=809337&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java (original)
+++ commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlArithmetic.java Sun Aug 30 13:44:24 2009
@@ -46,9 +46,13 @@
/**
* Sets whether this JexlArithmetic instance triggers errors during evaluation when
* null is used as an operand.
+ * <p>This method is <em>not</em> thread safe; it may be called as an optional step by the JexlEngine
+ * in its initialization code before expression creation & evaluation.</p>
+ * @see JexlEngine#setSilent
+ * @see JexlEngine#setDebug
* @param lenient true means no JexlException will occur, false allows them
*/
- public void setLenient(boolean lenient) {
+ void setLenient(boolean lenient) {
this.strict = !lenient;
}
Modified: commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlEngine.java?rev=809337&r1=809336&r2=809337&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlEngine.java (original)
+++ commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/JexlEngine.java Sun Aug 30 13:44:24 2009
@@ -168,6 +168,10 @@
/**
* Sets whether this engine reports debugging information when error occurs.
+ * <p>This method is <em>not</em> thread safe; it should be called as an optional step of the JexlEngine
+ * initialization code before expression creation & evaluation.</p>
+ * @see JexlEngine#setSilent
+ * @see JexlEngine#setLenient
* @param flag true implies debug is on, false implies debug is off.
*/
public void setDebug(boolean flag) {
@@ -184,6 +188,10 @@
/**
* Sets whether this engine throws JexlException during evaluation when an error is triggered.
+ * <p>This method is <em>not</em> thread safe; it should be called as an optional step of the JexlEngine
+ * initialization code before expression creation & evaluation.</p>
+ * @see JexlEngine#setDebug
+ * @see JexlEngine#setLenient
* @param flag true means no JexlException will occur, false allows them
*/
public void setSilent(boolean flag) {
@@ -201,6 +209,10 @@
/**
* Sets whether this engine triggers errors during evaluation when null is used as
* an operand.
+ * <p>This method is <em>not</em> thread safe; it should be called as an optional step of the JexlEngine
+ * initialization code before expression creation & evaluation.</p>
+ * @see JexlEngine#setSilent
+ * @see JexlEngine#setDebug
* @param flag true means no JexlException will occur, false allows them
*/
public void setLenient(boolean flag) {
@@ -234,8 +246,8 @@
/**
* Sets the map of function namespaces.
* <p>
- * It should be defined once and not modified afterwards since it might be shared
- * between multiple engines evaluating expressions concurrently.
+ * This method is <em>not</em> thread safe; it should be called as an optional step of the JexlEngine
+ * initialization code before expression creation & evaluation.
* </p>
* <p>
* Each entry key is used as a prefix, each entry value used as a bean implementing