This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jexl.git
commit 5a7702edf5078170bbf46da458b202f697b52f5d Author: Gary Gregory <[email protected]> AuthorDate: Mon Nov 10 06:09:14 2025 -0500 Use final --- .../commons/jexl3/internal/SourceCacheTest.java | 22 +++++++++++----------- .../org/apache/commons/jexl3/internal/Util.java | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/test/java/org/apache/commons/jexl3/internal/SourceCacheTest.java b/src/test/java/org/apache/commons/jexl3/internal/SourceCacheTest.java index 6c379e89..a800fc4c 100644 --- a/src/test/java/org/apache/commons/jexl3/internal/SourceCacheTest.java +++ b/src/test/java/org/apache/commons/jexl3/internal/SourceCacheTest.java @@ -56,27 +56,27 @@ public class SourceCacheTest { void testSourceCache() { final JexlFeatures features = JexlFeatures.createDefault(); // source objects differ when symbol maps differ - Map<String, Integer> symbols0 = new HashMap<>(); + final Map<String, Integer> symbols0 = new HashMap<>(); symbols0.put("x", 0); symbols0.put("y", 1); - Source src0 = new Source(features, symbols0,"x + y"); + final Source src0 = new Source(features, symbols0,"x + y"); assertFalse(src0.equals(null)); assertFalse(src0.equals("x + y")); - Map<String, Integer> symbols1 = new HashMap<>(); + final Map<String, Integer> symbols1 = new HashMap<>(); symbols0.put("x", 0); symbols0.put("y", 2); - Source src1 = new Source(features, symbols1,"x + y"); + final Source src1 = new Source(features, symbols1,"x + y"); assertNotEquals(src0, src1); assertNotEquals(0, src0.compareTo(src1)); - Source src2 = new Source(features, null,"x + y"); + final Source src2 = new Source(features, null,"x + y"); assertNotEquals(src0, src2); assertNotEquals(0, src0.compareTo(src2)); - Source src3 = new Source(JexlFeatures.createNone(), symbols1,"x + y"); + final Source src3 = new Source(JexlFeatures.createNone(), symbols1,"x + y"); assertNotEquals(src0, src3); assertNotEquals(0, src0.compareTo(src3)); - JexlEngine jexl = new JexlBuilder().cache(4).create(); - JexlCache<Source, Object> cache = ((Engine) jexl).getCache(); + final JexlEngine jexl = new JexlBuilder().cache(4).create(); + final JexlCache<Source, Object> cache = ((Engine) jexl).getCache(); // order of declaration of variables matters JexlScript script0 = jexl.createScript("x + y", "x", "y"); assertNotNull(script0); @@ -93,14 +93,14 @@ public class SourceCacheTest { @Test void testInterpolationCache() { - JexlEngine jexl = new JexlBuilder().strictInterpolation(true).cache(4).create(); - JexlCache<Source, Object> cache = ((Engine) jexl).getCache(); + final JexlEngine jexl = new JexlBuilder().strictInterpolation(true).cache(4).create(); + final JexlCache<Source, Object> cache = ((Engine) jexl).getCache(); // order of declaration of variables matters JexlScript script0; for (int i = 0; i < 2; ++i) { script0 = jexl.createScript("`${x}` + `${x}`", "x"); assertNotNull(script0); - Object result = script0.execute(null, 42); + final Object result = script0.execute(null, 42); assertEquals("4242", result); // the '+' and the two '`${x}`' should lead to only 2 cached sources assertEquals(2, cache.size()); diff --git a/src/test/java/org/apache/commons/jexl3/internal/Util.java b/src/test/java/org/apache/commons/jexl3/internal/Util.java index cfc67582..52744c03 100644 --- a/src/test/java/org/apache/commons/jexl3/internal/Util.java +++ b/src/test/java/org/apache/commons/jexl3/internal/Util.java @@ -89,7 +89,7 @@ public class Util { final Debugger dbg = new Debugger(); // iterate over all expression in for (final Map.Entry<Source, Object> entry : jexl.cache.entries()) { - Object c = entry.getValue(); + final Object c = entry.getValue(); // we may have cached Jxlt expressions due to interpolation strings, skip them if (!(c instanceof ASTJexlScript)) { continue;
