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 2017/03/10 14:45:38 UTC

svn commit: r1786354 - in /commons/proper/jexl/trunk: ./ src/site/xdoc/ src/test/java/org/apache/commons/jexl3/ src/test/java/org/apache/commons/jexl3/internal/

Author: henrib
Date: Fri Mar 10 14:45:38 2017
New Revision: 1786354

URL: http://svn.apache.org/viewvc?rev=1786354&view=rev
Log:
JEXL:
Various updates & improvements related to last fixes

Modified:
    commons/proper/jexl/trunk/RELEASE-NOTES.txt
    commons/proper/jexl/trunk/pom.xml
    commons/proper/jexl/trunk/src/site/xdoc/changes.xml
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/AnnotationTest.java
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JexlEvalContext.java
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/internal/Util.java

Modified: commons/proper/jexl/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/RELEASE-NOTES.txt?rev=1786354&r1=1786353&r2=1786354&view=diff
==============================================================================
--- commons/proper/jexl/trunk/RELEASE-NOTES.txt (original)
+++ commons/proper/jexl/trunk/RELEASE-NOTES.txt Fri Mar 10 14:45:38 2017
@@ -1,6 +1,6 @@
 
                             Apache Commons JEXL
-                               Version 3.0.1
+                                Version 3.1
                                Release Notes
 
 
@@ -24,21 +24,25 @@ Release 3.1
 ========================================================================================================================
 
 Version 3.1 is a minor release.
+Note that JEXL 3.1 now requires Java 7.
 
 What's new in 3.1:
-================== 
+==================
 * Annotations syntax (@annotation) and processing capabilities.
 * Better support for script execution options, error handling and canceling.
 * All operators can be overloaded.
 
 New Features in 3.1:
 ====================
+* JEXL-216:     Improve parsing concurrency in multithreaded environment
+* JEXL-211:     Add callable method to JexlExpression interface
 * JEXL-201:     Allow Interpreter to use live values from JexlEngine.Option interface implemented by JexlContext
 * JEXL-197:     Add annotations
 * JEXL-194      Allow synchronization on iterableValue in foreach statement
 
 Bugs Fixed in 3.1:
 ====================
+* JEXL-221:     Sporadic undefined property error caused by NPE at MapGetExecutor.tryInvoke()
 * JEXL-210:     The way to cancel script execution with an error
 * JEXL-209:     Unsolvable function/method '<?>.<null>(...)'
 * JEXL-207:     Inconsistent error handling

Modified: commons/proper/jexl/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/pom.xml?rev=1786354&r1=1786353&r2=1786354&view=diff
==============================================================================
--- commons/proper/jexl/trunk/pom.xml (original)
+++ commons/proper/jexl/trunk/pom.xml Fri Mar 10 14:45:38 2017
@@ -19,7 +19,7 @@
     <parent>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-parent</artifactId>
-        <version>39</version>
+        <version>42</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.commons</groupId>
@@ -328,7 +328,7 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>clirr-maven-plugin</artifactId>
-                <!-- version is defined in commons-parent -->
+                <version>2.8</version>
                 <configuration>
                     <excludes>
                         <exclude>org/apache/commons/jexl3/parser/**</exclude>

Modified: commons/proper/jexl/trunk/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/site/xdoc/changes.xml?rev=1786354&r1=1786353&r2=1786354&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/jexl/trunk/src/site/xdoc/changes.xml Fri Mar 10 14:45:38 2017
@@ -26,6 +26,15 @@
     </properties>
     <body>
         <release version="3.1" date="unreleased">
+            <action dev="henrib" type="fix" issue="JEXL-221" due-to="Dmitri Blinov">
+                Sporadic undefined property error caused by NPE at MapGetExecutor.tryInvoke()
+            </action>
+            <action dev="henrib" type="add" issue="JEXL-216" due-to="Dmitri Blinov">
+                Improve parsing concurrency in multithreaded environment
+            </action>
+            <action dev="henrib" type="add" issue="JEXL-211" due-to="Dmitri Blinov">
+                Add callable method to JexlExpression interface
+            </action>
             <action dev="henrib" type="fix" issue="JEXL-210" due-to="Dmitri Blinov">
                 The way to cancel script execution with an error
             </action>
@@ -39,7 +48,7 @@
                 testCallableCancel() test hangs sporadically
             </action>
             <action dev="henrib" type="fix" issue="JEXL-205" due-to="Dmitri Blinov">
-                testCancelForever() is not terminated properly as 'Fixed'
+                testCancelForever() is not terminated properly
             </action>
             <action dev="henrib" type="fix" issue="JEXL-204" due-to="Dmitri Blinov">
                 Script is not interrupted by a method call throwing Exception

Modified: commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/AnnotationTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/AnnotationTest.java?rev=1786354&r1=1786353&r2=1786354&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/AnnotationTest.java (original)
+++ commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/AnnotationTest.java Fri Mar 10 14:45:38 2017
@@ -16,8 +16,6 @@
  */
 package org.apache.commons.jexl3;
 
-import java.math.MathContext;
-import java.nio.charset.Charset;
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.concurrent.Callable;
@@ -90,12 +88,23 @@ public class AnnotationTest extends Jexl
             }
             // transient side effect for silent
             if ("silent".equals(name)) {
-                boolean s = (Boolean) args[0];
-                boolean b = this.isSilent();
-                setSilent(s);
-                Object r = statement.call();
-                setSilent(b);
-                return r;
+                if (args == null || args.length == 0) {
+                    boolean b = this.isSilent();
+                    try {
+                        return statement.call();
+                    } catch(JexlException xjexl) {
+                        return null;
+                    } finally {
+                        setSilent(b);
+                    }
+                } else {
+                    boolean s = (Boolean) args[0];
+                    boolean b = this.isSilent();
+                    setSilent(s);
+                    Object r = statement.call();
+                    setSilent(b);
+                    return r;
+                }
             }
             // durable side effect for scale
             if ("scale".equals(name)) {

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=1786354&r1=1786353&r2=1786354&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 Fri Mar 10 14:45:38 2017
@@ -24,7 +24,10 @@ import java.util.Map;
 /**
  * A JEXL evaluation environment wrapping variables, namespace and options.
  */
-public class JexlEvalContext implements JexlContext, JexlContext.NamespaceResolver, JexlEngine.Options {
+public class JexlEvalContext implements
+       JexlContext,
+       JexlContext.NamespaceResolver,
+       JexlEngine.Options {
     /** The marker for the empty vars. */
     private static final Map<String,Object> EMPTY_MAP = Collections.<String,Object>emptyMap();
     /** The variables.*/

Modified: commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/internal/Util.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/internal/Util.java?rev=1786354&r1=1786353&r2=1786354&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/internal/Util.java (original)
+++ commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/internal/Util.java Fri Mar 10 14:45:38 2017
@@ -44,8 +44,8 @@ public class Util {
         Engine jdbg = new Engine();
         jdbg.parser.allowRegisters(true);
         Debugger dbg = new Debugger();
-        // iterate over all expression in cache
-        Iterator<Map.Entry<String, ASTJexlScript>> inodes = jexl.cache.entrySet().iterator();
+        // iterate over all expression in
+        Iterator<Map.Entry<String, ASTJexlScript>> inodes = jexl.cache.entries().iterator();
         while (inodes.hasNext()) {
             Map.Entry<String, ASTJexlScript> entry = inodes.next();
             JexlNode node = entry.getValue();