This is an automated email from the ASF dual-hosted git repository.
henrib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git
The following commit(s) were added to refs/heads/master by this push:
new 3bad718d JEXL-452: restore debug behavior; - added specific tests,
amended other; - updated relnotes, release-notes and changes;
3bad718d is described below
commit 3bad718d2882001d62c3aee3a7781faa1fd9a142
Author: Henrib <[email protected]>
AuthorDate: Fri Dec 5 16:36:54 2025 +0100
JEXL-452: restore debug behavior;
- added specific tests, amended other;
- updated relnotes, release-notes and changes;
---
RELEASE-NOTES.txt | 21 ++++-
src/changes/changes.xml | 11 ++-
.../java/org/apache/commons/jexl3/JexlBuilder.java | 6 +-
.../java/org/apache/commons/jexl3/JexlEngine.java | 9 +-
.../org/apache/commons/jexl3/JexlException.java | 4 +-
.../org/apache/commons/jexl3/internal/Engine.java | 10 +-
src/site/xdoc/relnotes35.xml | 103 +++++++++++++++++----
.../java/org/apache/commons/jexl3/CacheTest.java | 2 -
.../java/org/apache/commons/jexl3/CaptureLog.java | 12 +++
.../org/apache/commons/jexl3/ExceptionTest.java | 82 +++++++++++++---
.../org/apache/commons/jexl3/Issues300Test.java | 5 +-
.../apache/commons/jexl3/PropertyAccessTest.java | 18 ++--
.../org/apache/commons/jexl3/SideEffectTest.java | 36 +++----
13 files changed, 242 insertions(+), 77 deletions(-)
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index ad417f70..864c6464 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -1,7 +1,7 @@
Apache Commons JEXL
- Version 3.6.0
+ Version 3.6.1
Release Notes
@@ -30,6 +30,25 @@ Download page:
https://commons.apache.org/proper/commons-jexl/download_jexl.cgi
Have fun!
-Apache Commons Team
+========================================================================================================================
+Release 3.6.1
+========================================================================================================================
+
+Version 3.6.1 is a minor release.
+
+Compatibility with previous releases
+====================================
+Version 3.6.1 is source and binary compatible with 3.6.
+
+
+Bugs Fixed in 3.6.1:
+====================
+* JEXL-452: Debug setting in Engine shows class/method/line even when set
to false.
+* JEXL-451: Restore JexlSandbox permission capabilities on Object.class.
+* JEXL-450: Disable instantiation of internal classes in RESTRICTED mode.
+* JEXL-449: Inconsistency on nature of curly-bracket syntactic elements
regarding annotations.
+
+
========================================================================================================================
Release 3.6.0
========================================================================================================================
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 1c8acf92..e5f6571e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -30,14 +30,17 @@
<release version="3.6.1" date="YYYY-MM-DD"
description="This is a feature and maintenance release. Java
8 or later is required.">
<!-- FIX -->
- <action dev="henrib" type="fix" issue="JEXL-449" due-to="William
Price">Inconsistency on nature of
- curly-bracket syntactic elements regarding annotations.
+ <action dev="henrib" type="fix" issue="JEXL-452" due-to="Gary
Gregory">
+ Debug setting in Engine shows class/method/line even when set
to false.
+ </action>
+ <action dev="henrib" type="fix" issue="JEXL-451" due-to="Xu
Pengcheng">Restore JexlSandbox
+ permission capabilities on Object.class.
</action>
<action dev="henrib" type="fix" issue="JEXL-450">Disable
instantiation of internal classes in RESTRICTED
mode.
</action>
- <action dev="henrib" type="fix" issue="JEXL-451" due-to="Xu
Pengcheng, Henri Biestro">Restore JexlSandbox
- permission capabilities on Object.class.
+ <action dev="henrib" type="fix" issue="JEXL-449" due-to="William
Price">Inconsistency on nature of
+ curly-bracket syntactic elements regarding annotations.
</action>
<!-- ADD -->
<!-- UPDATE -->
diff --git a/src/main/java/org/apache/commons/jexl3/JexlBuilder.java
b/src/main/java/org/apache/commons/jexl3/JexlBuilder.java
index 0dc3e41f..bb821465 100644
--- a/src/main/java/org/apache/commons/jexl3/JexlBuilder.java
+++ b/src/main/java/org/apache/commons/jexl3/JexlBuilder.java
@@ -414,16 +414,16 @@ public class JexlBuilder {
}
/**
- * Gets the debug flag
+ * Gets the debug flag.
* @return the debugging information flag
*/
public Boolean debug() {
return this.debug;
}
- /**
+ /**
* Sets whether the engine will report debugging information when error
occurs.
- *
+ * @see JexlEngine#isDebug()
* @param flag true implies debug is on, false implies debug is off.
* @return this builder
*/
diff --git a/src/main/java/org/apache/commons/jexl3/JexlEngine.java
b/src/main/java/org/apache/commons/jexl3/JexlEngine.java
index 7a938ae2..70e74526 100644
--- a/src/main/java/org/apache/commons/jexl3/JexlEngine.java
+++ b/src/main/java/org/apache/commons/jexl3/JexlEngine.java
@@ -274,7 +274,7 @@ public abstract class JexlEngine {
* @return a JexlInfo instance
*/
public JexlInfo createInfo() {
- return new JexlInfo();
+ return isDebug()? new JexlInfo() : new JexlInfo("jexl", 1, 1);
}
/**
@@ -529,6 +529,13 @@ public abstract class JexlEngine {
/**
* Checks whether this engine is in debug mode.
*
+ * <p>If set to true which is the default, when calling {@link
JexlEngine#newInstance}, {@link JexlEngine#invokeMethod},
+ * {@link JexlEngine#setProperty}, {@link JexlEngine#getProperty} or if no
{@link JexlInfo} instance is provided when
+ * creating a script and an error occurs during execution, the error
message will contain the stack-trace (class/method/line)
+ * location of the caller for the methods, of the creator for the script;
this may not be desirable in rare environments where
+ * vulnerability assessments are strict.</p>
+ * @see JexlBuilder#debug(boolean)
+ *
* @return true if debug is on, false otherwise
*/
public abstract boolean isDebug();
diff --git a/src/main/java/org/apache/commons/jexl3/JexlException.java
b/src/main/java/org/apache/commons/jexl3/JexlException.java
index 8f9f47c2..964c5183 100644
--- a/src/main/java/org/apache/commons/jexl3/JexlException.java
+++ b/src/main/java/org/apache/commons/jexl3/JexlException.java
@@ -1073,12 +1073,12 @@ public class JexlException extends RuntimeException {
* Format is "debug![begin,end]: string \n msg" where:
* </p>
* <ul>
- * <li>debug is the debugging information if it exists (@link
JexlEngine.setDebug)</li>
+ * <li>debug is the debugging information if it exists {@link
JexlBuilder#debug(boolean)}</li>
* <li>begin, end are character offsets in the string for the precise
location of the error</li>
* <li>string is the string representation of the offending expression</li>
* <li>msg is the actual explanation message for this error</li>
* </ul>
- *
+ * @see JexlEngine#isDebug()
* @return this error as a string
*/
@Override
diff --git a/src/main/java/org/apache/commons/jexl3/internal/Engine.java
b/src/main/java/org/apache/commons/jexl3/internal/Engine.java
index 5c8126a1..a5b5bd31 100644
--- a/src/main/java/org/apache/commons/jexl3/internal/Engine.java
+++ b/src/main/java/org/apache/commons/jexl3/internal/Engine.java
@@ -439,7 +439,7 @@ public class Engine extends JexlEngine implements
JexlUberspect.ConstantResolver
protected Object doCreateInstance(final Object clazz, final Object...
args) {
JexlException xjexl = null;
Object result = null;
- final JexlInfo info = debug ? createInfo() : null;
+ final JexlInfo info = createInfo();
try {
JexlMethod ctor = uberspect.getConstructor(clazz, args);
if (ctor == null && arithmetic.narrowArguments(args)) {
@@ -585,7 +585,7 @@ public class Engine extends JexlEngine implements
JexlUberspect.ConstantResolver
src = "#0" + (src.charAt(0) == '[' ? "" : ".") + src;
try {
final Scope scope = new Scope(null, "#0");
- final ASTJexlScript script = parse(null, PROPERTY_FEATURES, src,
scope);
+ final ASTJexlScript script = parse(createInfo(),
PROPERTY_FEATURES, src, scope);
final JexlNode node = script.jjtGetChild(0);
final Frame frame = script.createFrame(bean);
final Interpreter interpreter = createInterpreter(context == null
? EMPTY_CONTEXT : context, frame, options);
@@ -694,7 +694,7 @@ public class Engine extends JexlEngine implements
JexlUberspect.ConstantResolver
public Object invokeMethod(final Object obj, final String meth, final
Object... args) {
JexlException xjexl = null;
Object result = null;
- final JexlInfo info = debug ? createInfo() : null;
+ final JexlInfo info = createInfo();
try {
JexlMethod method = uberspect.getMethod(obj, meth, args);
if (method == null && arithmetic.narrowArguments(args)) {
@@ -790,7 +790,7 @@ public class Engine extends JexlEngine implements
JexlUberspect.ConstantResolver
return (ASTJexlScript) c;
}
}
- final JexlInfo ninfo = info == null && debug ? createInfo() : info;
+ final JexlInfo ninfo = info != null ? info : createInfo();
final JexlEngine se = putThreadEngine(this);
ASTJexlScript script;
try {
@@ -1016,7 +1016,7 @@ public class Engine extends JexlEngine implements
JexlUberspect.ConstantResolver
src = "#0" + (src.charAt(0) == '[' ? "" : ".") + src + "=#1";
try {
final Scope scope = new Scope(null, "#0", "#1");
- final ASTJexlScript script = parse(null, PROPERTY_FEATURES, src,
scope);
+ final ASTJexlScript script = parse(createInfo(),
PROPERTY_FEATURES, src, scope);
final JexlNode node = script.jjtGetChild(0);
final Frame frame = script.createFrame(bean, value);
final Interpreter interpreter = createInterpreter(context != null
? context : EMPTY_CONTEXT, frame, options);
diff --git a/src/site/xdoc/relnotes35.xml b/src/site/xdoc/relnotes35.xml
index 5f646f83..abf064e6 100644
--- a/src/site/xdoc/relnotes35.xml
+++ b/src/site/xdoc/relnotes35.xml
@@ -18,13 +18,13 @@
<document>
<properties>
- <title>Apache Commons JEXL 3.6 Release Notes</title>
+ <title>Apache Commons JEXL 3.6.1 Release Notes</title>
</properties>
<body>
<section name="Compatibility with previous release">
<p>
- Version 3.6 is source and binary compatible with 3.5.
+ Version 3.6.1 is source and binary compatible with 3.6.0.
</p>
</section>
<section name="Compatibility with older releases (< 3.3, 2.x)">
@@ -50,28 +50,99 @@
</p>
</section>
- <section name="What is new in 3.6:">
+ <section name="What is new in 3.6.1:">
<p>
- JEXL 3.6 is a minor release that adds a few features and fixes some
bugs.
+ JEXL 3.6.1 is a minor release that fixes some bugs.
It does not introduce any breaking change.
</p>
</section>
- <section name="New Features in 3.6:">
- <p>
- <table>
- <tr>
- <td><a
href="https://issues.apache.org/jira/browse/JEXL-440">JEXL-440:</a></td>
- <td>Switch statement & expressions.</td>
- </tr>
- </table>
- </p>
+ <section name="Bugs fixed in 3.6.1:">
+ <p>
+ <table>
+ <tr>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-452">JEXL-452:</a>
+ </td>
+ <td>Debug setting in Engine shows class/method/line even when set
to false.</td>
+ </tr>
+ <tr>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-451">JEXL-451:</a>
+ </td>
+ <td>Restore JexlSandbox permission capabilities on
Object.class.</td>
+ </tr>
+ <tr>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-450">JEXL-450:</a>
+ </td>
+ <td>Disable instantiation of internal classes in RESTRICTED
mode.</td>
+ </tr>
+ <tr>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-449">JEXL-449:</a>
+ </td>
+ <td>Inconsistency on nature of curly-bracket syntactic elements
regarding annotations.</td>
+ </tr>
+ </table>
+ </p>
+ </section>
+
+ <section name="What was new in 3.6.0:">
+ <p>
+ JEXL 3.6.0 introduces a switch statement and expressions (JEXL-440).
+ It is a minor release that does not introduce any breaking change.
+ </p>
</section>
- <section name="Bugs fixed in 3.6:">
+ <section name="New Features in 3.6.0:">
<p>
<table>
<tr>
- <td><a
href="https://issues.apache.org/jira/browse/JEXL-437">JEXL-437:</a></td>
- <td>Semicolons not actually optional between function calls on
separate lines</td>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-440">JEXL-440:</a>
+ </td>
+ <td>Switch statement & expressions.</td>
+ </tr>
+ </table>
+ </p>
+ </section>
+ <section name="Bugs fixed in 3.6.0:">
+ <p>
+ <table>
+ <tr>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-437">JEXL-447:</a>
+ </td>
+ <td>Regression in script-defined functions</td>
+ </tr>
+ <tr>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-446">JEXL-446:</a>
+ </td>
+ <td>ClassTool module inspection is too strict</td>
+ </tr>
+ <tr>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-442">JEXL-442:</a>
+ </td>
+ <td>Local variables are not resolved in interpolation string
expression</td>
+ </tr>
+ <tr>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-441">JEXL-441:</a>
+ </td>
+ <td>Tokenization error if "\n" in template expression.</td>
+ </tr>
+ <tr>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-439">JEXL-439:</a>
+ </td>
+ <td>When using reference capture, incorrect scoping when local
variable redefines a captured symbol</td>
+ </tr>
+ <tr>
+ <td>
+ <a
href="https://issues.apache.org/jira/browse/JEXL-437">JEXL-437:</a>
+ </td>
+ <td>Semicolons actually not optional between function calls on
separate lines</td>
</tr>
</table>
</p>
diff --git a/src/test/java/org/apache/commons/jexl3/CacheTest.java
b/src/test/java/org/apache/commons/jexl3/CacheTest.java
index 1d92a75f..22604548 100644
--- a/src/test/java/org/apache/commons/jexl3/CacheTest.java
+++ b/src/test/java/org/apache/commons/jexl3/CacheTest.java
@@ -521,13 +521,11 @@ class CacheTest extends JexlTestCase {
private static final JexlEngine jexlCache = new JexlBuilder()
.cache(1024)
- .debug(true)
.strict(true)
.create();
private static final JexlEngine jexlNoCache = new JexlBuilder()
.cache(0)
- .debug(true)
.strict(true)
.create();
diff --git a/src/test/java/org/apache/commons/jexl3/CaptureLog.java
b/src/test/java/org/apache/commons/jexl3/CaptureLog.java
index 959d188d..1fd370d7 100644
--- a/src/test/java/org/apache/commons/jexl3/CaptureLog.java
+++ b/src/test/java/org/apache/commons/jexl3/CaptureLog.java
@@ -17,6 +17,7 @@ package org.apache.commons.jexl3;
import java.util.ArrayList;
import java.util.List;
+import java.util.stream.Collectors;
import org.apache.commons.logging.Log;
@@ -49,6 +50,17 @@ public class CaptureLog implements Log {
return count;
}
+ public List<String> getCapturedMessages() {
+ return captured.stream()
+ .map(a -> a[2])
+ .filter(o -> o instanceof String)
+ .map(o -> (String) o).collect(Collectors.toList());
+ }
+
+ public void clear() {
+ captured.clear();
+ }
+
@Override
public void debug(final Object o) {
captured.add(new Object[]{"debug", caller(), o});
diff --git a/src/test/java/org/apache/commons/jexl3/ExceptionTest.java
b/src/test/java/org/apache/commons/jexl3/ExceptionTest.java
index f2df4eba..88d033a3 100644
--- a/src/test/java/org/apache/commons/jexl3/ExceptionTest.java
+++ b/src/test/java/org/apache/commons/jexl3/ExceptionTest.java
@@ -23,9 +23,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
-import org.apache.commons.jexl3.internal.Engine;
import org.junit.jupiter.api.Test;
+import java.util.function.Supplier;
+
/**
* Checks various exception handling cases.
*/
@@ -52,12 +53,18 @@ class ExceptionTest extends JexlTestCase {
}
}
+ public static class ConstructNPE {
+ public ConstructNPE() {
+ throw new NullPointerException("ConstructNPE");
+ }
+ }
+
/** Create a named test */
public ExceptionTest() {
super("ExceptionTest");
}
- private void doTest206(final String src, final boolean strict, final
boolean silent) throws Exception {
+ private void doTest206(final String src, final boolean strict, final
boolean silent) {
final CaptureLog l = new CaptureLog();
final JexlContext jc = new MapContext();
final JexlEngine jexl = new
JexlBuilder().logger(l).strict(strict).silent(silent).create();
@@ -108,7 +115,7 @@ class ExceptionTest extends JexlTestCase {
// Unknown vars and properties versus null operands
// JEXL-73
@Test
- void testEx() throws Exception {
+ void testEx() {
final JexlEngine jexl = createEngine(false);
final JexlExpression e = jexl.createExpression("c.e * 6");
final JexlEvalContext ctxt = new JexlEvalContext();
@@ -143,7 +150,7 @@ class ExceptionTest extends JexlTestCase {
// Unknown vars and properties versus null operands
@Test
- void testExMethod() throws Exception {
+ void testExMethod() {
final JexlEngine jexl = createEngine(false);
final JexlExpression e = jexl.createExpression("c.e.foo()");
final JexlEvalContext ctxt = new JexlEvalContext();
@@ -167,7 +174,7 @@ class ExceptionTest extends JexlTestCase {
// null local vars and strict arithmetic effects
@Test
- void testExVar() throws Exception {
+ void testExVar() {
final JexlEngine jexl = createEngine(false);
final JexlScript e = jexl.createScript("(x)->{ x * 6 }");
final JexlEvalContext ctxt = new JexlEvalContext();
@@ -188,18 +195,67 @@ class ExceptionTest extends JexlTestCase {
}
@Test
- void testWrappedEx() throws Exception {
- final JexlEngine jexl = new Engine();
- final JexlExpression e = jexl.createExpression("npe()");
+ void testWrappedEx() {
+ runWrappedEx(true, true);
+ runWrappedEx(false, true);
+ runWrappedEx(true, false);
+ runWrappedEx(false, false);
+ }
+
+ /**
+ * Runs various calls that throw NPE wrapped in JexlExceptions.
+ * @param debug if true/false, debug mode is on/off
+ * @param silent if true/false, silent mode is on/off
+ */
+ private static void runWrappedEx(boolean debug, boolean silent) {
+ final CaptureLog log = new CaptureLog();
+ final JexlBuilder builder = new JexlBuilder().safe(false).strict(true)
+ .logger(log).debug(debug).silent(silent);
+ final JexlEngine jexl = builder.create();
final JexlContext jc = new ObjectContext<>(jexl, new ThrowNPE());
- final JexlException xany = assertThrows(JexlException.class, () ->
e.evaluate(jc));
- final Throwable xth = xany.getCause();
- assertEquals(NullPointerException.class, xth.getClass(), "Should have
thrown NPE");
+ callWrappedEx(debug, silent, log, () ->
jexl.createExpression("npe()").evaluate(jc));
+ callWrappedEx(debug, silent, log, () ->
jexl.newInstance(ConstructNPE.class));
+ ThrowNPE npe = new ThrowNPE();
+ callWrappedEx(debug, silent, log, () -> jexl.invokeMethod(npe, "npe"));
+ // side effect to set failure in getter coming next
+ callWrappedEx(debug, silent, log, () -> {
+ jexl.setProperty(npe, "fail", true);
+ return null;
+ });
+ callWrappedEx(debug, silent, log, () -> jexl.getProperty(npe, "fail"));
+ }
+
+ /**
+ * Calls a NPE throwing call wrapped in JexlException and checks the
outcome.
+ * @param debug if true/false, debug mode is on/off
+ * @param silent if true/false, silent mode is on/off
+ * @param npeCall the NPE throwing call
+ */
+ private static void callWrappedEx(boolean debug, boolean silent,
CaptureLog log, Supplier<Object> npeCall) {
+ try {
+ npeCall.get();
+ if (!silent) {
+ fail("should have thrown");
+ } else {
+ // in silent mode, ensure a log was captured
+ assertEquals(1, log.count("warn"), "should have 1 warn log");
+ String msg = log.getCapturedMessages().get(0);
+ assertEquals(debug, msg.contains("runWrappedEx"),
"class/method/line?");
+ log.clear();
+ }
+ } catch (final JexlException exception) {
+ if (silent) {
+ fail("should not have throw, should be silent");
+ }
+ assertEquals(debug,
exception.getMessage().contains("runWrappedEx"), "class/method/line?");
+ final Throwable xth = exception.getCause();
+ assertEquals(NullPointerException.class, xth.getClass(), "Should
have thrown NPE");
+ }
}
@Test
- void testWrappedExmore() throws Exception {
- final JexlEngine jexl = new Engine();
+ void testWrappedExmore() {
+ final JexlEngine jexl = new
JexlBuilder().debug(true).safe(false).create();
final ThrowNPE npe = new ThrowNPE();
assertNull(assertThrows(JexlException.Property.class, () ->
jexl.getProperty(npe, "foo")).getCause());
assertNull(assertThrows(JexlException.Property.class, () ->
jexl.setProperty(npe, "foo", 42)).getCause());
diff --git a/src/test/java/org/apache/commons/jexl3/Issues300Test.java
b/src/test/java/org/apache/commons/jexl3/Issues300Test.java
index b3868126..df16c3f6 100644
--- a/src/test/java/org/apache/commons/jexl3/Issues300Test.java
+++ b/src/test/java/org/apache/commons/jexl3/Issues300Test.java
@@ -1058,7 +1058,6 @@ class Issues300Test {
final JexlEngine jexl = new JexlBuilder()
.safe(false)
.strict(true)
- .debug(true)
.create();
// @formatter:on
JexlScript script = null;
@@ -1090,7 +1089,7 @@ class Issues300Test {
}
@Test
- void testBackslashes() throws Exception {
+ void testBackslashes() {
final JexlEngine jexl = new JexlBuilder().safe(false).create();
final String src = "\"\b\t\f\"";
JexlScript s = jexl.createScript(src);
@@ -1306,7 +1305,7 @@ class Issues300Test {
}
@Test
- void testUnsolvableMethod() throws Exception {
+ void testUnsolvableMethod() {
final JexlEngine jexl = new JexlBuilder().create();
// @formatter:off
final JexlScript script = jexl.createScript(
diff --git a/src/test/java/org/apache/commons/jexl3/PropertyAccessTest.java
b/src/test/java/org/apache/commons/jexl3/PropertyAccessTest.java
index a1531e25..c976f914 100644
--- a/src/test/java/org/apache/commons/jexl3/PropertyAccessTest.java
+++ b/src/test/java/org/apache/commons/jexl3/PropertyAccessTest.java
@@ -189,7 +189,7 @@ class PropertyAccessTest extends JexlTestCase {
}
@Test
- void test250() throws Exception {
+ void test250() {
final MapContext ctx = new MapContext();
final HashMap<Object, Object> x = new HashMap<>();
x.put(2, "123456789");
@@ -235,7 +235,7 @@ class PropertyAccessTest extends JexlTestCase {
}
@Test
- void test275a() throws Exception {
+ void test275a() {
final JexlEngine jexl = new
JexlBuilder().strict(true).safe(false).create();
final JexlContext ctxt = new MapContext();
Object result = null;
@@ -275,7 +275,7 @@ class PropertyAccessTest extends JexlTestCase {
}
@Test
- void test275b() throws Exception {
+ void test275b() {
final JexlEngine jexl = new
JexlBuilder().strict(true).safe(true).create();
final JexlContext ctxt = new MapContext();
JexlScript script;
@@ -307,7 +307,7 @@ class PropertyAccessTest extends JexlTestCase {
}
@Test
- void testErroneousIdentifier() throws Exception {
+ void testErroneousIdentifier() {
final MapContext ctx = new MapContext();
final JexlEngine engine = new
JexlBuilder().strict(true).silent(false).create();
@@ -370,9 +370,9 @@ class PropertyAccessTest extends JexlTestCase {
}
@Test
- void testInnerProperty() throws Exception {
+ void testInnerProperty() {
final PropertyArithmetic pa = new PropertyArithmetic(true);
- final JexlEngine jexl = new
JexlBuilder().arithmetic(pa).debug(true).strict(true).cache(32).create();
+ final JexlEngine jexl = new
JexlBuilder().arithmetic(pa).strict(true).cache(32).create();
final Container quux = new Container("quux", 42);
final JexlScript get;
Object result;
@@ -426,9 +426,9 @@ class PropertyAccessTest extends JexlTestCase {
}
@Test
- void testInnerViaArithmetic() throws Exception {
+ void testInnerViaArithmetic() {
final PropertyArithmetic pa = new PropertyArithmetic(true);
- final JexlEngine jexl = new
JexlBuilder().arithmetic(pa).debug(true).strict(true).cache(32).create();
+ final JexlEngine jexl = new
JexlBuilder().arithmetic(pa).strict(true).cache(32).create();
final PropertyContainer quux = new PropertyContainer("bar", 169);
Object result;
@@ -520,7 +520,7 @@ class PropertyAccessTest extends JexlTestCase {
}
}
@Test
- void testStringIdentifier() throws Exception {
+ void testStringIdentifier() {
final Map<String, String> foo = new HashMap<>();
final JexlContext jc = new MapContext();
diff --git a/src/test/java/org/apache/commons/jexl3/SideEffectTest.java
b/src/test/java/org/apache/commons/jexl3/SideEffectTest.java
index 5cea9d7c..f619ef89 100644
--- a/src/test/java/org/apache/commons/jexl3/SideEffectTest.java
+++ b/src/test/java/org/apache/commons/jexl3/SideEffectTest.java
@@ -143,12 +143,12 @@ class SideEffectTest extends JexlTestCase {
return new Var(lhs.value & rhs.value);
}
- public Object arrayGet(final Var var, final String property) {
- return "VALUE".equals(property)? var.value : JexlEngine.TRY_FAILED;
+ public Object arrayGet(final Var variable, final String property) {
+ return "VALUE".equals(property)? variable.value :
JexlEngine.TRY_FAILED;
}
- public Object arraySet(final Var var, final String property, final int
v) {
- return "VALUE".equals(property)? var.value = v :
JexlEngine.TRY_FAILED;
+ public Object arraySet(final Var variable, final String property,
final int v) {
+ return "VALUE".equals(property)? variable.value = v :
JexlEngine.TRY_FAILED;
}
public int decrement(final Var lhs) {
@@ -179,12 +179,12 @@ class SideEffectTest extends JexlTestCase {
return n.value;
}
- public Object propertyGet(final Var var, final String property) {
- return "value".equals(property)? var.value : JexlEngine.TRY_FAILED;
+ public Object propertyGet(final Var variable, final String property) {
+ return "value".equals(property)? variable.value :
JexlEngine.TRY_FAILED;
}
- public Object propertySet(final Var var, final String property, final
int v) {
- return "value".equals(property)? var.value = v :
JexlEngine.TRY_FAILED;
+ public Object propertySet(final Var variable, final String property,
final int v) {
+ return "value".equals(property)? variable.value = v :
JexlEngine.TRY_FAILED;
}
public Var selfAdd(final Var lhs, final Var rhs) {
@@ -277,12 +277,12 @@ class SideEffectTest extends JexlTestCase {
super("SideEffectTest");
}
- private void run246(final JexlArithmetic j246) throws Exception {
+ private void run246(final JexlArithmetic j246) {
final Log log246 = LogFactory.getLog(SideEffectTest.class);
// quiesce the logger
final java.util.logging.Logger ll246 =
java.util.logging.LogManager.getLogManager().getLogger(SideEffectTest.class.getName());
// ll246.setLevel(Level.WARNING);
- final JexlEngine jexl = new
JexlBuilder().arithmetic(j246).cache(32).debug(true).logger(log246).create();
+ final JexlEngine jexl = new
JexlBuilder().arithmetic(j246).cache(32).logger(log246).create();
final JexlScript script = jexl.createScript("z += x", "x");
final MapContext ctx = new MapContext();
List<String> z = new ArrayList<>(1);
@@ -462,17 +462,17 @@ class SideEffectTest extends JexlTestCase {
}
@Test
- void test246() throws Exception {
+ void test246() {
run246(new Arithmetic246(true));
}
@Test
- void test246b() throws Exception {
+ void test246b() {
run246(new Arithmetic246b(true));
}
@Test
- void test248() throws Exception {
+ void test248() {
final MapContext ctx = new MapContext();
final List<Object> foo = new ArrayList<>(Arrays.asList(10, 20, 30,
40));
ctx.set("foo", foo);
@@ -489,7 +489,7 @@ class SideEffectTest extends JexlTestCase {
}
@Test
- void testArithmeticSelf() throws Exception {
+ void testArithmeticSelf() {
final JexlEngine jexl = new JexlBuilder().cache(64).arithmetic(new
SelfArithmetic(false)).create();
final JexlContext jc = null;
runSelfOverload(jexl, jc);
@@ -497,14 +497,14 @@ class SideEffectTest extends JexlTestCase {
}
@Test
- void testArithmeticSelfNoCache() throws Exception {
+ void testArithmeticSelfNoCache() {
final JexlEngine jexl = new JexlBuilder().cache(0).arithmetic(new
SelfArithmetic(false)).create();
final JexlContext jc = null;
runSelfOverload(jexl, jc);
}
@Test
- void testIncrementSelf() throws Exception {
+ void testIncrementSelf() {
final JexlEngine jexl = new JexlBuilder().cache(64).arithmetic(new
SelfArithmetic(false)).create();
final JexlContext jc = null;
runSelfIncrement(jexl, jc);
@@ -512,14 +512,14 @@ class SideEffectTest extends JexlTestCase {
}
@Test
- void testIncrementSelfNoCache() throws Exception {
+ void testIncrementSelfNoCache() {
final JexlEngine jexl = new JexlBuilder().cache(0).arithmetic(new
SelfArithmetic(false)).create();
final JexlContext jc = null;
runSelfIncrement(jexl, jc);
}
@Test
- void testOverrideGetSet() throws Exception {
+ void testOverrideGetSet() {
final JexlEngine jexl = new JexlBuilder().cache(64).arithmetic(new
SelfArithmetic(false)).create();
final JexlContext jc = null;