diff --git a/0001-Port-to-current-javacc.patch b/0001-Port-to-current-javacc.patch deleted file mode 100644 index 855eb39c9d63ed6c315872cbfc10d838f1cfc0b6..0000000000000000000000000000000000000000 --- a/0001-Port-to-current-javacc.patch +++ /dev/null @@ -1,45 +0,0 @@ -From f171cd8a95735c7f2fbcd20c323b2d936d8cc01b Mon Sep 17 00:00:00 2001 -From: Michael Simacek -Date: Wed, 7 Sep 2016 16:36:53 +0200 -Subject: [PATCH] Port to current javacc - ---- - src/main/java/org/apache/commons/jexl2/parser/SimpleNode.java | 2 ++ - .../java/org/apache/commons/jexl2/parser/TokenMgrError.java | 10 ++++++++++ - 2 files changed, 12 insertions(+) - -diff --git a/src/main/java/org/apache/commons/jexl2/parser/SimpleNode.java b/src/main/java/org/apache/commons/jexl2/parser/SimpleNode.java -index cab2378..4d83b1d 100644 ---- a/src/main/java/org/apache/commons/jexl2/parser/SimpleNode.java -+++ b/src/main/java/org/apache/commons/jexl2/parser/SimpleNode.java -@@ -180,6 +180,8 @@ public class SimpleNode implements Node { - } - } - } -+ -+ public int getId() { return id; } - } - - /* JavaCC - OriginalChecksum=7dff880883d088a37c1e3197e4b455a0 (do not edit this line) */ -diff --git a/src/main/java/org/apache/commons/jexl2/parser/TokenMgrError.java b/src/main/java/org/apache/commons/jexl2/parser/TokenMgrError.java -index 1e9b623..3e1236e 100644 ---- a/src/main/java/org/apache/commons/jexl2/parser/TokenMgrError.java -+++ b/src/main/java/org/apache/commons/jexl2/parser/TokenMgrError.java -@@ -142,4 +142,14 @@ public class TokenMgrError extends Error { - current = curChar; - errorCode = reason; - } -+ -+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar, int reason) { -+ eof = EOFSeen; -+ state = lexState; -+ line = errorLine; -+ column = errorColumn; -+ after = errorAfter; -+ current = (char)curChar; -+ errorCode = reason; -+ } - } --- -2.7.4 - diff --git a/001-Fix-tests.patch b/001-Fix-tests.patch deleted file mode 100644 index b2859c8882408e2cc3a35770b89dbf177b883053..0000000000000000000000000000000000000000 --- a/001-Fix-tests.patch +++ /dev/null @@ -1,21 +0,0 @@ -Description: Fix a test failure with JUnit 4.11 due to the out of order - execution of the test methods. This issue is fixed in JEXL 3. -Author: Emmanuel Bourg -Forwarded: not-needed ---- a/src/test/java/org/apache/commons/jexl2/ArithmeticTest.java -+++ b/src/test/java/org/apache/commons/jexl2/ArithmeticTest.java -@@ -137,6 +137,7 @@ - * test some simple mathematical calculations - */ - public void testCalculations() throws Exception { -+ JexlThreadedArithmetic.setLenient(Boolean.TRUE); - - asserter.setVariable("foo", new Integer(2)); - -@@ -347,4 +348,4 @@ - } - debuggerCheck(jexl); - } --} -\ No newline at end of file -+} diff --git a/apache-commons-jexl-javacc.patch b/apache-commons-jexl-javacc.patch new file mode 100644 index 0000000000000000000000000000000000000000..973c4d81ab99341bc0c8e7d471fb0418575aff6c --- /dev/null +++ b/apache-commons-jexl-javacc.patch @@ -0,0 +1,15 @@ +--- commons-jexl3-3.3-src/pom.xml.orig 2022-12-30 09:12:53.000000000 -0700 ++++ commons-jexl3-3.3-src/pom.xml 2023-07-13 13:39:32.520453897 -0600 +@@ -155,9 +155,9 @@ + + + +- com.helger.maven +- ph-javacc-maven-plugin +- 4.1.5 ++ org.codehaus.mojo ++ javacc-maven-plugin ++ 3.0.1 + + + jexl-jjtree diff --git a/apache-commons-jexl-javadoc.patch b/apache-commons-jexl-javadoc.patch index c474c023b0a258f6a47f5dd93d9eb22c5fb3c29f..e85f1cc7fd38b350599a0199eda3791a03917779 100644 --- a/apache-commons-jexl-javadoc.patch +++ b/apache-commons-jexl-javadoc.patch @@ -1,452 +1,80 @@ -diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/ExpressionImpl.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/ExpressionImpl.java ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/ExpressionImpl.java.javadoc 2011-12-19 06:15:00.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/ExpressionImpl.java 2015-04-15 19:05:24.054352570 -0600 -@@ -32,7 +32,7 @@ public class ExpressionImpl implements E - /** The engine for this expression. */ - protected final JexlEngine jexl; - /** -- * Original expression stripped from leading & trailing spaces. -+ * Original expression stripped from leading & trailing spaces. - */ - protected final String expression; - /** -@@ -171,4 +171,4 @@ public class ExpressionImpl implements E - }; - } - --} -\ No newline at end of file -+} -diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/IntrospectorBase.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/IntrospectorBase.java ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/IntrospectorBase.java.javadoc 2011-12-19 06:15:01.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/IntrospectorBase.java 2015-04-15 19:05:24.055352589 -0600 -@@ -31,7 +31,7 @@ import org.apache.commons.logging.Log; - * This basic function of this class is to return a Method object for a - * particular class given the name of a method and the parameters to the method - * in the form of an Object[] -- *

-+ *

- * The first time the Introspector sees a class it creates a class method map - * for the class in question. Basically the class method map is a Hastable where - * Method objects are keyed by a concatenation of the method name and the names -@@ -324,4 +324,4 @@ public class IntrospectorBase { - return classMap; - } - } --} -\ No newline at end of file -+} -diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/MethodKey.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/MethodKey.java ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/MethodKey.java.javadoc 2011-12-19 06:15:01.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/MethodKey.java 2015-04-15 19:05:24.055352589 -0600 -@@ -40,7 +40,7 @@ import java.util.Arrays; - *

- * A key can be constructed either from arguments (array of objects) or from parameters - * (array of class). -- * Roughly 3x faster than string key to access the map & uses less memory. -+ * Roughly 3x faster than string key to access the map & uses less memory. - */ - public final class MethodKey { - /** The hash code. */ -diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/Introspector.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/Introspector.java ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/Introspector.java.javadoc 2011-12-19 06:15:01.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/Introspector.java 2015-04-15 19:05:24.055352589 -0600 -@@ -28,11 +28,11 @@ import org.apache.commons.logging.Log; - - /** - * Default introspection services. -- *

Finding methods as well as property getters & setters.

-+ *

Finding methods as well as property getters & setters.

- * @since 1.0 - */ - public class Introspector { -- /** The logger to use for all warnings & errors. */ -+ /** The logger to use for all warnings & errors. */ - protected final Log rlog; - /** The soft reference to the introspector currently in use. */ - private volatile SoftReference ref; -diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/introspection/Sandbox.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/introspection/Sandbox.java ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/introspection/Sandbox.java.javadoc 2011-12-19 06:14:59.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/introspection/Sandbox.java 2015-04-15 19:34:32.872928036 -0600 -@@ -26,6 +26,7 @@ import java.util.Set; - * through "whitelists" and "blacklists". - *

- * A whitelist explicitly allows methods/properties for a class; -+ *

- *
    - *
  • - * If a whitelist is empty and thus does not contain any names, all properties/methods are allowed for its class. -@@ -34,9 +35,9 @@ import java.util.Set; - * If it is not empty, the only allowed properties/methods are the ones contained. - *
  • - *
-- *

- *

- * A blacklist explicitly forbids methods/properties for a class; -+ *

- *
    - *
  • - * If a blacklist is empty and thus does not contain any names, all properties/methods are forbidden for its class. -@@ -47,12 +48,12 @@ import java.util.Set; - *
- *

- * Permissions are composed of three lists, read, write, execute, each being "white" or "black": -+ *

- *
    - *
  • read controls readable properties
  • - *
  • write controls writeable properties
  • - *
  • execute controls executable methods and constructor
  • - *
-- *

- * @since 2.1 - */ - public final class Sandbox { -diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java.javadoc 2011-12-19 06:14:59.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java 2015-04-15 19:53:47.277461744 -0600 -@@ -26,6 +26,7 @@ import java.math.MathContext; - * Perform arithmetic. - *

- * All arithmetic operators (+, - , *, /, %) follow the same rules regarding their arguments. -+ *

- *
    - *
  1. If both are null, result is 0
  2. - *
  3. If either is a BigDecimal, coerce both to BigDecimal and and perform operation
  4. -@@ -39,7 +40,6 @@ import java.math.MathContext; - *
- * - * -- *

- * Note that the only exception throw by JexlArithmetic is ArithmeticException. - * @since 2.0 - */ -@@ -630,7 +630,7 @@ public class JexlArithmetic { - * Performs a bitwise and. - * @param left the left operand - * @param right the right operator -- * @return left & right -+ * @return left & right - * @since 2.1 - */ - public Object bitwiseAnd(Object left, Object right) { -@@ -681,7 +681,7 @@ public class JexlArithmetic { - * @param left the left operand - * @param right the right operator - * @param operator the operator -- * @return -1 if left < right; +1 if left > > right; 0 if left == right -+ * @return -1 if left < right; +1 if left > right; 0 if left == right - * @throws ArithmeticException if either left or right is null - * @since 2.1 - */ -@@ -761,7 +761,7 @@ public class JexlArithmetic { - } - - /** -- * Test if left < right. -+ * Test if left < right. - * - * @param left first value - * @param right second value -@@ -777,7 +777,7 @@ public class JexlArithmetic { - } - - /** -- * Test if left > right. -+ * Test if left > right. - * - * @param left first value - * @param right second value -@@ -792,7 +792,7 @@ public class JexlArithmetic { - } - - /** -- * Test if left <= right. -+ * Test if left ≤ right. - * - * @param left first value - * @param right second value -@@ -809,7 +809,7 @@ public class JexlArithmetic { - } - - /** -- * Test if left >= right. -+ * Test if left ≥ right. - * - * @param left first value - * @param right second value -@@ -1141,4 +1141,4 @@ public class JexlArithmetic { - } - return result; - } --} -\ No newline at end of file -+} -diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/JexlEngine.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/JexlEngine.java ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/JexlEngine.java.javadoc 2011-12-19 06:15:00.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/JexlEngine.java 2015-04-15 19:29:36.837248669 -0600 -@@ -53,14 +53,14 @@ import org.apache.commons.jexl2.parser.A - /** - *

- * Creates and evaluates Expression and Script objects. -- * Determines the behavior of Expressions & Scripts during their evaluation with respect to: -+ * Determines the behavior of Expressions & Scripts during their evaluation with respect to: -+ *

- *
    - *
  • Introspection, see {@link Uberspect}
  • -- *
  • Arithmetic & comparison, see {@link JexlArithmetic}
  • -+ *
  • Arithmetic & comparison, see {@link JexlArithmetic}
  • - *
  • Error reporting
  • - *
  • Logging
  • - *
-- *

- *

The setSilent and setLenient methods allow to fine-tune an engine instance behavior - * according to various error control needs. The lenient/strict flag tells the engine when and if null as operand is - * considered an error, the silent/verbose flag tells the engine what to do with the error -@@ -68,7 +68,7 @@ import org.apache.commons.jexl2.parser.A - *

- *
    - *
  • When "silent" & "lenient": -- *

    0 & null should be indicators of "default" values so that even in an case of error, -+ *

    0 & null should be indicators of "default" values so that even in an case of error, - * something meaningfull can still be inferred; may be convenient for configurations. - *

    - *
  • -@@ -84,7 +84,7 @@ import org.apache.commons.jexl2.parser.A - * - *
  • When "verbose" & "strict": - *

    The finest error control grain is obtained; it is the closest to Java code - -- * still augmented by "script" capabilities regarding automated conversions & type matching. -+ * still augmented by "script" capabilities regarding automated conversions & type matching. - *

    - *
  • - *
-@@ -872,7 +872,7 @@ public class JexlEngine { - * Creates a cache. - * @param the key type - * @param the value type -- * @param cacheSize the cache size, must be > 0 -+ * @param cacheSize the cache size, must be > 0 - * @return a Map usable as a cache bounded to the given size - */ - protected Map createCache(final int cacheSize) { -@@ -1312,7 +1312,7 @@ public class JexlEngine { - } - - /** -- * Trims the expression from front & ending spaces. -+ * Trims the expression from front & ending spaces. - * @param str expression to clean - * @return trimmed expression ending in a semi-colon - */ -diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/parser/Parser.jjt.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/parser/Parser.jjt ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/parser/Parser.jjt.javadoc 2011-12-19 06:14:59.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/parser/Parser.jjt 2015-04-15 19:06:23.342339942 -0600 -@@ -62,7 +62,7 @@ PARSER_END(Parser) - - - /*************************************** -- * Skip & Number literal tokens -+ * Skip & Number literal tokens - ***************************************/ - - <*> SKIP : /* WHITE SPACE */ -@@ -145,7 +145,7 @@ PARSER_END(Parser) - } - - /*************************************** -- * Identifier & String tokens -+ * Identifier & String tokens - ***************************************/ - - <*> TOKEN : /* IDENTIFIERS */ -@@ -275,7 +275,7 @@ void LValueVar() #Reference : {} - } - - /*************************************** -- * Conditional & relational -+ * Conditional & relational - ***************************************/ - - void ConditionalExpression() #void : {} -@@ -398,7 +398,7 @@ void UnaryExpression() #void : {} - - - /*************************************** -- * Identifier & Literals -+ * Identifier & Literals - ***************************************/ - - void Identifier(boolean top) : -@@ -501,7 +501,7 @@ void MapEntry() : {} - - - /*************************************** -- * Functions & Methods -+ * Functions & Methods - ***************************************/ - - void EmptyFunction() : {} -diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngineFactory.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngineFactory.java ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngineFactory.java.javadoc 2011-12-19 06:15:00.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngineFactory.java 2015-04-15 19:05:24.058352644 -0600 -@@ -29,9 +29,9 @@ import org.apache.commons.jexl2.parser.S - /** - * Implements the Jexl ScriptEngineFactory for JSF-223. - *

-- * Supports the following: -- * Language short names: "JEXL", "Jexl", "jexl", "JEXL2", "Jexl2", "jexl2"
-- * File Extensions: ".jexl", ".jexl2"
-+ * Supports the following:
-+ * Language short names: "JEXL", "Jexl", "jexl", "JEXL2", "Jexl2", "jexl2"
-+ * File Extensions: ".jexl", ".jexl2"
- * "jexl2" etc. were added for engineVersion="2.0". - *

- *

-diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngine.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngine.java ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngine.java.javadoc 2011-12-19 06:15:00.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngine.java 2015-04-15 19:33:18.303497441 -0600 -@@ -95,6 +95,7 @@ public class JexlScriptEngine extends Ab - * Those properties are allways bound to the default engine scope context. - *

- * The following properties are defined: -+ *

- *
    - *
  • in - refers to the engine scope reader that defaults to reading System.err
  • - *
  • out - refers the engine scope writer that defaults to writing in System.out
  • -@@ -102,7 +103,6 @@ public class JexlScriptEngine extends Ab - *
  • logger - the JexlScriptEngine logger
  • - *
  • System - the System.class
  • - *
-- *

- * @since 2.0 - */ - public class JexlScriptObject { -diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/UnifiedJEXL.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/UnifiedJEXL.java ---- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/UnifiedJEXL.java.javadoc 2011-12-19 06:14:58.000000000 -0700 -+++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/UnifiedJEXL.java 2015-04-15 19:51:40.950152677 -0600 -@@ -38,21 +38,21 @@ import org.apache.commons.jexl2.parser.S - * and facilitate the implementation of expression evaluation. - *

- * An expression can mix immediate, deferred and nested sub-expressions as well as string constants; -+ *

- *
    - *
  • The "immediate" syntax is of the form "...${jexl-expr}..."
  • - *
  • The "deferred" syntax is of the form "...#{jexl-expr}..."
  • - *
  • The "nested" syntax is of the form "...#{...${jexl-expr0}...}..."
  • - *
  • The "composite" syntax is of the form "...${jexl-expr0}... #{jexl-expr1}..."
  • - *
-- *

- *

-- * Deferred & immediate expression carry different intentions: -+ * Deferred & immediate expression carry different intentions: -+ *

- *
    - *
  • An immediate expression indicate that evaluation is intended to be performed close to - * the definition/parsing point.
  • - *
  • A deferred expression indicate that evaluation is intended to occur at a later stage.
  • - *
-- *

- *

- * For instance: "Hello ${name}, now is #{time}" is a composite "deferred" expression since one - * of its subexpressions is deferred. Furthermore, this (composite) expression intent is -@@ -62,14 +62,14 @@ import org.apache.commons.jexl2.parser.S - *

- * The API reflects this feature in 2 methods, prepare and evaluate. The prepare method - * will evaluate the immediate subexpression and return an expression that contains only -- * the deferred subexpressions (& constants), a prepared expression. Such a prepared expression -+ * the deferred subexpressions (& constants), a prepared expression. Such a prepared expression - * is suitable for a later phase evaluation that may occur with a different JexlContext. - * Note that it is valid to call evaluate without prepare in which case the same JexlContext - * is used for the 2 evaluation phases. - *

- *

- * In the most common use-case where deferred expressions are to be kept around as properties of objects, -- * one should parse & prepare an expression before storing it and evaluate it each time -+ * one should parse & prepare an expression before storing it and evaluate it each time - * the property storing it is accessed. - *

- *

-@@ -339,7 +339,7 @@ public final class UnifiedJEXL { - *

- * In effect, this binds the result of the immediate sub-expressions evaluation in the - * context, allowing to differ evaluation of the remaining (deferred) expression within another context. -- * This only has an effect to nested & composite expressions that contain differed & immediate sub-expressions. -+ * This only has an effect to nested & composite expressions that contain differed & immediate sub-expressions. - *

- *

- * If the underlying JEXL engine is silent, errors will be logged through its logger as warning. -@@ -409,7 +409,7 @@ public final class UnifiedJEXL { - * Prepares a sub-expression for interpretation. - * @param interpreter a JEXL interpreter - * @return a prepared expression -- * @throws JexlException (only for nested & composite) -+ * @throws JexlException (only for nested & composite) - */ - protected Expression prepare(Interpreter interpreter) { - return this; -@@ -419,7 +419,7 @@ public final class UnifiedJEXL { - * Intreprets a sub-expression. - * @param interpreter a JEXL interpreter - * @return the result of interpretation -- * @throws JexlException (only for nested & composite) -+ * @throws JexlException (only for nested & composite) - */ - protected abstract Object evaluate(Interpreter interpreter); - } -@@ -734,7 +734,7 @@ public final class UnifiedJEXL { - } - - /** Creates a a {@link UnifiedJEXL.Expression} from an expression string. -- * Uses & fills up the expression cache if any. -+ * Uses & fills up the expression cache if any. - *

- * If the underlying JEXL engine is silent, errors will be logged through its logger as warnings. - *

-@@ -1010,20 +1010,23 @@ public final class UnifiedJEXL { - * evaluation and their output gathered through a writer. - * It is thus possible to use looping or conditional construct "around" expressions generating output. - *

-- * For instance: -- *

-+     * 

For instance: -+ *

-+ *
-      * $$ for(var x : [1, 3, 5, 42, 169]) {
-      * $$   if (x == 42) {
-      * Life, the universe, and everything
--     * $$   } else if (x > 42) {
-+     * $$   } else if (x > 42) {
-      * The value $(x} is over fourty-two
-      * $$   } else {
-      * The value ${x} is under fourty-two
-      * $$   }
-      * $$ }
-      * 
-+ *

- * Will evaluate as: -- *

-+     * 

-+ *
-      * The value 1 is under fourty-two
-      * The value 3 is under fourty-two
-      * The value 5 is under fourty-two
-@@ -1033,10 +1036,10 @@ public final class UnifiedJEXL {
-      * 

- * During evaluation, the template context exposes its writer as '$jexl' which is safe to use in this case. - * This allows writing directly through the writer without adding new-lines as in: -- *

-+     * 

-+ *
-      * $$ for(var cell : cells) { $jexl.print(cell); $jexl.print(';') }
-      * 
-- *

- *

- * A template is expanded as one JEXL script and a list of UnifiedJEXL expressions; each UnifiedJEXL expression - * being replace in the script by a call to jexl:print(expr) (the expr is in fact the expr number in the template). -@@ -1461,4 +1464,4 @@ public final class UnifiedJEXL { - public Template createTemplate(String source) { - return new Template("$$", new StringReader(source), (String[]) null); - } --} -\ No newline at end of file -+} +--- commons-jexl3-3.4.0-src/src/main/java/org/apache/commons/jexl3/internal/Closure.java.orig 2024-06-02 07:52:21.000000000 -0600 ++++ commons-jexl3-3.4.0-src/src/main/java/org/apache/commons/jexl3/internal/Closure.java 2024-06-06 10:17:46.723573140 -0600 +@@ -78,7 +78,7 @@ public class Closure extends Script { + *

Assign this lambda in its own frame if the symbol it is assigned to in its definition scope + * is captured in its body.

+ *

This done allow a locally defined function to "see" and call itself as a local (captured) variable.

+- * Typical case is: const f = (x)->x <= 0? 1 : x*f(x-1). Since assignment of f occurs after ++ * Typical case is: const f = (x)->x <= 0? 1 : x*f(x-1). Since assignment of f occurs after + * the lambda creation, we need to patch the lambda frame to expose itself through the captured symbol. + * @param parentFrame the parent calling frame + * @param symbol the symbol index (in the caller of this closure) +--- commons-jexl3-3.4.0-src/src/main/java/org/apache/commons/jexl3/JexlArithmetic.java.orig 2024-06-02 07:52:21.000000000 -0600 ++++ commons-jexl3-3.4.0-src/src/main/java/org/apache/commons/jexl3/JexlArithmetic.java 2024-06-06 10:18:40.081854677 -0600 +@@ -1631,7 +1631,7 @@ public class JexlArithmetic { + + /** + * Convert a string to a BigDecimal. +- * <>Empty string is considered as 0. ++ * Empty string is considered as 0. + * @param arg the arg + * @return a BigDecimal + * @throws CoercionException if the string can not be coerced into a BigDecimal +@@ -1648,7 +1648,7 @@ public class JexlArithmetic { + + /** + * Converts a string to a big integer. +- * <>Empty string is considered as 0. ++ * Empty string is considered as 0. + * @param arg the arg + * @return a big integer + * @throws ArithmeticException if the string can not be coerced into a big integer +@@ -1665,7 +1665,7 @@ public class JexlArithmetic { + + /** + * Convert a string to a double. +- * <>Empty string is considered as NaN. ++ * Empty string is considered as NaN. + * @param arg the arg + * @return a double + * @throws ArithmeticException if the string can not be coerced into a double +--- commons-jexl3-3.4.0-src/src/main/java/org/apache/commons/jexl3/parser/ASTTryStatement.java.orig 2024-06-02 07:52:21.000000000 -0600 ++++ commons-jexl3-3.4.0-src/src/main/java/org/apache/commons/jexl3/parser/ASTTryStatement.java 2024-06-06 10:16:33.276562087 -0600 +@@ -21,7 +21,7 @@ package org.apache.commons.jexl3.parser; + */ + public class ASTTryStatement extends JexlNode { + private static final long serialVersionUID = 1L; +- /** catch() &= 1, finally &= 2. */ ++ /** catch() &= 1, finally &= 2. */ + private int tryForm; + + public ASTTryStatement(final int id) { +--- commons-jexl3-3.4.0-src/src/main/java/org/apache/commons/jexl3/parser/Parser.jjt.orig 2024-06-02 07:52:21.000000000 -0600 ++++ commons-jexl3-3.4.0-src/src/main/java/org/apache/commons/jexl3/parser/Parser.jjt 2024-06-06 10:19:46.408961574 -0600 +@@ -659,7 +659,7 @@ void AssignmentExpression() #void : {} + } + + /*************************************** +- * Conditional & relational ++ * Conditional & relational + ***************************************/ + + void ConditionalExpression() #void : {} +@@ -821,7 +821,7 @@ void PostfixExpression() #void : {} + } + + /*************************************** +- * Identifier & Literals ++ * Identifier & Literals + ***************************************/ + + void Identifier(boolean top) : +@@ -979,7 +979,7 @@ void SetLiteral() : {} + + + /*************************************** +- * Functions & Methods ++ * Functions & Methods + ***************************************/ + + void Arguments() #Arguments : {} diff --git a/apache-commons-jexl.spec b/apache-commons-jexl.spec index ce75a570e0edb2560b1f3d26a53632f62838562c..f3164149df19179a1bd1244f6ba92c80855569ab 100644 --- a/apache-commons-jexl.spec +++ b/apache-commons-jexl.spec @@ -1,18 +1,22 @@ %global jarname commons-jexl -%global compatver 2.1.0 Name: apache-%{jarname} -Version: 2.1.1 +Version: 3.4.0 Release: 1 Summary: Java Expression Language (JEXL) -License: ASL 2.0 +License: Apache-2.0 URL: http://commons.apache.org/jexl Source0: http://www.apache.org/dist/commons/jexl/source/%{jarname}-%{version}-src.tar.gz -Patch0: 001-Fix-tests.patch -Patch1: apache-commons-jexl-javadoc.patch -Patch2: 0001-Port-to-current-javacc.patch +Patch0: apache-commons-jexl-javadoc.patch +Patch1: apache-commons-jexl-javacc.patch BuildRequires: maven-local mvn(commons-logging:commons-logging) mvn(junit:junit) BuildRequires: mvn(org.apache.commons:commons-parent:pom:) BuildRequires: mvn(org.codehaus.mojo:javacc-maven-plugin) +BuildRequires: mvn(org.jacoco:jacoco-maven-plugin) +BuildRequires: mvn(com.google.code.gson:gson) +BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin) +BuildRequires: mvn(org.apache.maven.plugins:maven-compiler-plugin) +BuildRequires: mvn(org.apache.maven.plugins:maven-jar-plugin) +BuildRequires: mvn(org.apiguardian:apiguardian-api) Provides: %{jarname} = %{version}-%{release} BuildArch: noarch @@ -37,42 +41,47 @@ Provides: %{jarname}-javadoc = %{version}-%{release} This package contains the API documentation for %{name}. %prep -%setup -q -n %{jarname}-%{version}-src -%patch0 -p1 -b .test -%patch1 -p1 -b .javadoc -%patch2 -p1 -%pom_remove_dep org.apache.bsf:bsf-api -find \( -name '*.jar' -o -name '*.class' \) -delete -find -name '*.txt' -exec sed -i 's/\r//' '{}' + -%pom_xpath_set "pom:project/pom:version" %{compatver} jexl2-compat -%pom_xpath_set "pom:dependency[pom:artifactId='commons-jexl']/pom:version" %{version} jexl2-compat -echo " - - 4.0.0 - org.fedoraproject - commons-jexl-aggegator - %{version} - pom - - . - jexl2-compat - -" >>aggregator-pom.xml -%mvn_package :commons-jexl-aggegator __noinstall +%autosetup -n commons-jexl3-%{version}-src -p1 + +%pom_xpath_remove //pom:argLine + +%pom_xpath_remove //pom:reporting +%pom_remove_plugin :maven-antrun-plugin +%pom_remove_plugin :animal-sniffer-maven-plugin +%pom_remove_plugin :apache-rat-plugin +%pom_remove_plugin :japicmp-maven-plugin +%pom_remove_plugin :maven-checkstyle-plugin +%pom_remove_plugin :maven-javadoc-plugin +%pom_remove_plugin :maven-pmd-plugin +%pom_remove_plugin :maven-scm-publish-plugin +%pom_remove_plugin :spotbugs-maven-plugin %build -%mvn_build -- -f aggregator-pom.xml +%mvn_build -f %install %mvn_install %files -f .mfiles %doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt -%{_javadir}/%{name} %files javadoc -f .mfiles-javadoc %doc LICENSE.txt NOTICE.txt %changelog +* Thu Oct 16 2025 wangkai <13474090681@163.com> - 3.4.0-1 +- Update to 3.4.0: + * JEXL-420: Error while comparing float and string value + * JEXL-417: JexlArithmetic looses precision during arithmetic operator execution + * JEXL-416: Null-valued pragma throws NPE in 3.3 + * JEXL-415: Incorrect template eval result + * JEXL-414: SoftCache may suffer from race conditions + * JEXL-412: Ambiguous syntax between namespace function call and map object definition + * JEXL-410: JexlFeatures: ctor does not enable all features + * JEXL-409: Disable LEXICAL should disable LEXICAL_SHADE + * JEXL-405: Recursive functions corrupt evaluation frame if reassigned + * JEXL-403: Exception while evaluating template literal used in array assignment in loop + * JEXL-402: Parse failed with empty return value + * Mon Jul 27 2020 chengzihan - 2.1.1-1 - Package init diff --git a/commons-jexl-2.1.1-src.tar.gz b/commons-jexl-2.1.1-src.tar.gz deleted file mode 100644 index ab8d31ff3bc652943a8979763f2d3ae8d3f2c093..0000000000000000000000000000000000000000 Binary files a/commons-jexl-2.1.1-src.tar.gz and /dev/null differ diff --git a/commons-jexl-3.4.0-src.tar.gz b/commons-jexl-3.4.0-src.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c3788ef1f1693425a480297f59e44f52e38ec314 Binary files /dev/null and b/commons-jexl-3.4.0-src.tar.gz differ