You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/06/01 14:53:14 UTC
(commons-jexl) 13/39: Use final
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 95a59d3453000cb1e19abaf395c060d97c3c997c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jun 1 10:19:32 2024 -0400
Use final
---
.../org/apache/commons/jexl3/FeaturesTest.java | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/test/java/org/apache/commons/jexl3/FeaturesTest.java b/src/test/java/org/apache/commons/jexl3/FeaturesTest.java
index c45d0003..c211d9e3 100644
--- a/src/test/java/org/apache/commons/jexl3/FeaturesTest.java
+++ b/src/test/java/org/apache/commons/jexl3/FeaturesTest.java
@@ -75,20 +75,20 @@ public class FeaturesTest extends JexlTestCase {
@Test
public void test410a() {
- long x = JexlFeatures.createAll().getFlags();
+ final long x = JexlFeatures.createAll().getFlags();
assertEquals(CONST_CAPTURE + 1, Long.bitCount(x));
- assertTrue((x & (1L << CONST_CAPTURE)) != 0);
+ assertTrue((x & 1L << CONST_CAPTURE) != 0);
- JexlFeatures all = JexlFeatures.createAll();
+ final JexlFeatures all = JexlFeatures.createAll();
final JexlEngine jexl = new JexlBuilder().features(all).create();
- JexlScript script = jexl.createScript("#0 * #1", "#0", "#1");
- Object r = script.execute(null, 6, 7);
+ final JexlScript script = jexl.createScript("#0 * #1", "#0", "#1");
+ final Object r = script.execute(null, 6, 7);
assertEquals(42, r);
}
@Test
public void test410b() {
- JexlFeatures features = JexlFeatures.createScript();
+ final JexlFeatures features = JexlFeatures.createScript();
assertTrue(features.isLexical());
assertTrue(features.isLexicalShade());
assertTrue(features.supportsConstCapture());
@@ -98,9 +98,9 @@ public class FeaturesTest extends JexlTestCase {
assertFalse(features.supportsComparatorNames());
final JexlEngine jexl = new JexlBuilder().features(features).create();
- Collection<String> reserved = features.getReservedNames();
- for(String varName : reserved) {
- String src = "var " + varName;
+ final Collection<String> reserved = features.getReservedNames();
+ for(final String varName : reserved) {
+ final String src = "var " + varName;
//JexlScript script = jexl.createScript(src);
assertThrows(JexlException.Feature.class, () -> jexl.createScript(src), src);
}
@@ -112,7 +112,7 @@ public class FeaturesTest extends JexlTestCase {
"4 gt 2",
"3 ge 2"
};
- for(String src : cmpNameScripts) {
+ for(final String src : cmpNameScripts) {
assertThrows(JexlException.Ambiguous.class, () -> jexl.createScript(src));
}
}
@@ -186,7 +186,7 @@ public class FeaturesTest extends JexlTestCase {
assertFalse(f.isLexicalShade());
assertFalse(f.supportsConstCapture());
- JexlEngine jnof = new JexlBuilder().features(f).create();
+ final JexlEngine jnof = new JexlBuilder().features(f).create();
assertThrows(JexlException.Feature.class, ()->jnof.createScript("{ 3 + 4 }"));
assertNotNull(jnof.createExpression("3 + 4"));
}