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 11:51:06 UTC
(commons-jexl) branch master updated (325dd0e1 -> 8d5edccb)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git
from 325dd0e1 Prepare for the next release candidate
new 59569683 Add @SuppressWarnings
new 47cf6ff6 Remove unused import
new 961c7b80 Javadoc
new da9bebf1 Javadoc
new 115caaab Use diamond
new 5990a3d6 Remove unused exception from test signature
new 00a35eb7 Use try-with-resources
new 8d5edccb Remove unused exception from test signature
The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../apache/commons/jexl3/parser/JexlParser.java | 4 +--
.../apache/commons/jexl3/parser/SimpleNode.java | 23 ++++++++----
.../commons/jexl3/parser/TokenMgrException.java | 2 +-
.../org/apache/commons/jexl3/ClassCreator.java | 41 +++++++++++-----------
.../apache/commons/jexl3/ScriptCallableTest.java | 2 +-
.../org/apache/commons/jexl3/SideEffectTest.java | 2 +-
src/test/java/org/example/SomeTest.java | 2 +-
7 files changed, 43 insertions(+), 33 deletions(-)
(commons-jexl) 05/08: Use diamond
Posted by gg...@apache.org.
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 115caaab4ebbe62ae07714ed923588fecab5955c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri May 31 23:20:46 2024 -0400
Use diamond
---
src/test/java/org/example/SomeTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/org/example/SomeTest.java b/src/test/java/org/example/SomeTest.java
index 359ff9e3..bc8affbe 100644
--- a/src/test/java/org/example/SomeTest.java
+++ b/src/test/java/org/example/SomeTest.java
@@ -89,7 +89,7 @@ public class SomeTest {
*/
@Test
public void testCustomFunctionPermissions() {
- Map<String, Object> funcs = new HashMap<String, Object>();
+ Map<String, Object> funcs = new HashMap<>();
funcs.put("math", new MyMath());
JexlPermissions permissions = JexlPermissions.parse("org.example.*");
JexlEngine jexl = new JexlBuilder().permissions(permissions).namespaces(funcs).create();
(commons-jexl) 03/08: Javadoc
Posted by gg...@apache.org.
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 961c7b80faa804e12c47b68947601a59c87b8432
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri May 31 23:18:42 2024 -0400
Javadoc
---
.../apache/commons/jexl3/parser/SimpleNode.java | 23 ++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/commons/jexl3/parser/SimpleNode.java b/src/main/java/org/apache/commons/jexl3/parser/SimpleNode.java
index 9f2f1fe1..13cd5e0d 100644
--- a/src/main/java/org/apache/commons/jexl3/parser/SimpleNode.java
+++ b/src/main/java/org/apache/commons/jexl3/parser/SimpleNode.java
@@ -83,6 +83,7 @@ public class SimpleNode implements Node {
/**
* Gets this node's parent.
+ *
* @return the parent node
*/
@Override
@@ -90,7 +91,9 @@ public class SimpleNode implements Node {
return parent;
}
- /** Adds a child node.
+ /**
+ * Adds a child node.
+ *
* @param n the child node
* @param i the child offset
*/
@@ -113,6 +116,7 @@ public class SimpleNode implements Node {
/**
* Gets a child of this node.
+ *
* @param i the child offset
* @return the child node
*/
@@ -123,6 +127,7 @@ public class SimpleNode implements Node {
/**
* Gets this node number of children.
+ *
* @return the number of children
*/
@Override
@@ -130,14 +135,18 @@ public class SimpleNode implements Node {
return children == null ? 0 : children.length;
}
- /** Sets this node value.
- * @param value
+ /**
+ * Sets this node value.
+ *
+ * @param value this node value.
*/
public void jjtSetValue(final Object value) {
this.value = value;
}
- /** Gets this node value.
+ /**
+ * Gets this node value.
+ *
* @return value
*/
public Object jjtGetValue() {
@@ -145,7 +154,8 @@ public class SimpleNode implements Node {
}
/**
- * Accept the visitor.
+ * Accepts the visitor.
+ *
* @param visitor the visitor
* @param data contextual data
* @return result of visit
@@ -156,7 +166,8 @@ public class SimpleNode implements Node {
}
/**
- * Accept the visitor on all this node's children.
+ * Accepts the visitor on all this node's children.
+ *
* @param visitor the visitor
* @param data contextual data
* @return result of visit
(commons-jexl) 01/08: Add @SuppressWarnings
Posted by gg...@apache.org.
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 59569683f68fa077ef0a176518f8070dd47fe00c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri May 31 23:13:32 2024 -0400
Add @SuppressWarnings
Javadoc
---
src/main/java/org/apache/commons/jexl3/parser/JexlParser.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java b/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java
index 21f8e84b..bbb4ed18 100644
--- a/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java
+++ b/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java
@@ -632,8 +632,9 @@ public abstract class JexlParser extends StringParser {
/**
* Default implementation does nothing but is overridden by generated code.
* @param top whether the identifier is beginning an l/r value
- * @throws ParseException subclasses may throw this
+ * @throws ParseException subclasses may throw ParseException
*/
+ @SuppressWarnings("unused") // subclasses may throw ParseException
protected void Identifier(final boolean top) throws ParseException {
// Overridden by generated code
}
(commons-jexl) 02/08: Remove unused import
Posted by gg...@apache.org.
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 47cf6ff6cf64aab7eef1c80cc34805065037688e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri May 31 23:13:52 2024 -0400
Remove unused import
---
src/main/java/org/apache/commons/jexl3/parser/JexlParser.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java b/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java
index bbb4ed18..4a8d241e 100644
--- a/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java
+++ b/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java
@@ -29,7 +29,6 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
-import org.apache.commons.jexl3.JexlContext;
import org.apache.commons.jexl3.JexlEngine;
import org.apache.commons.jexl3.JexlException;
import org.apache.commons.jexl3.JexlFeatures;
(commons-jexl) 08/08: Remove unused exception from test signature
Posted by gg...@apache.org.
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 8d5edccba5363ab92b1f603467e0b84d49d78efa
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri May 31 23:25:25 2024 -0400
Remove unused exception from test signature
---
src/test/java/org/apache/commons/jexl3/SideEffectTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/org/apache/commons/jexl3/SideEffectTest.java b/src/test/java/org/apache/commons/jexl3/SideEffectTest.java
index 0b8301f7..527f619c 100644
--- a/src/test/java/org/apache/commons/jexl3/SideEffectTest.java
+++ b/src/test/java/org/apache/commons/jexl3/SideEffectTest.java
@@ -57,7 +57,7 @@ public class SideEffectTest extends JexlTestCase {
return c;
}
- public Object selfAdd(final Collection<String> c, final String item) throws IOException {
+ public Object selfAdd(final Collection<String> c, final String item) {
c.add(item);
return c;
}
(commons-jexl) 04/08: Javadoc
Posted by gg...@apache.org.
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 da9bebf15f71ce5ca7c0e0ffd9ad63b8c014f335
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri May 31 23:18:46 2024 -0400
Javadoc
---
src/main/java/org/apache/commons/jexl3/parser/TokenMgrException.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/jexl3/parser/TokenMgrException.java b/src/main/java/org/apache/commons/jexl3/parser/TokenMgrException.java
index 34df8a66..a4dc6f30 100644
--- a/src/main/java/org/apache/commons/jexl3/parser/TokenMgrException.java
+++ b/src/main/java/org/apache/commons/jexl3/parser/TokenMgrException.java
@@ -132,7 +132,7 @@ public class TokenMgrException extends RuntimeException implements JavaccError {
return after;
}
- /***
+ /**
* Replaces unprintable characters by their espaced (or unicode escaped)
* equivalents in the given string
*/
(commons-jexl) 07/08: Use try-with-resources
Posted by gg...@apache.org.
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 00a35eb74e840da6dd5219dc30fbe566d04421dc
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri May 31 23:24:37 2024 -0400
Use try-with-resources
Fix typo in comment
---
.../org/apache/commons/jexl3/ClassCreator.java | 41 +++++++++++-----------
1 file changed, 20 insertions(+), 21 deletions(-)
diff --git a/src/test/java/org/apache/commons/jexl3/ClassCreator.java b/src/test/java/org/apache/commons/jexl3/ClassCreator.java
index 566b08c1..a3cfcb35 100644
--- a/src/test/java/org/apache/commons/jexl3/ClassCreator.java
+++ b/src/test/java/org/apache/commons/jexl3/ClassCreator.java
@@ -87,32 +87,31 @@ public class ClassCreator {
final String source = packageDir.getPath() + "/" + sourceName;
final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
final DiagnosticCollector<JavaFileObject> diagnosticsCollector = new DiagnosticCollector<>();
- final StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnosticsCollector, null, null);
- final Iterable<? extends JavaFileObject> compilationUnits = fileManager
- .getJavaFileObjectsFromStrings(Collections.singletonList(source));
-
- final List<String> options = new ArrayList<>();
- options.add("-classpath");
- // only add hbase classes to classpath. This is a little bit tricky: assume
- // the classpath is {hbaseSrc}/target/classes.
- final String currentDir = new File(".").getAbsolutePath();
- final String classpath = currentDir + File.separator + "target" + File.separator + "classes"
- //+ File.pathSeparator + System.getProperty("java.class.path")
- + File.pathSeparator + System.getProperty("surefire.test.class.path");
-
- options.add(classpath);
- //LOG.debug("Setting classpath to: " + classpath);
-
- final JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, diagnosticsCollector, options,
- null, compilationUnits);
- final boolean success = task.call();
- fileManager.close();
+ final boolean success;
+ try (StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnosticsCollector, null, null)) {
+ final Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromStrings(Collections.singletonList(source));
+
+ final List<String> options = new ArrayList<>();
+ options.add("-classpath");
+ // only add hbase classes to classpath. This is a little bit tricky: assume
+ // the classpath is {hbaseSrc}/target/classes.
+ final String currentDir = new File(".").getAbsolutePath();
+ final String classpath = currentDir + File.separator + "target" + File.separator + "classes"
+ // + File.pathSeparator + System.getProperty("java.class.path")
+ + File.pathSeparator + System.getProperty("surefire.test.class.path");
+
+ options.add(classpath);
+ // LOG.debug("Setting classpath to: " + classpath);
+
+ final JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, diagnosticsCollector, options, null, compilationUnits);
+ success = task.call();
+ }
if (success) {
return getClassLoader().loadClass(GEN_CLASS + className);
}
final List<Diagnostic<? extends JavaFileObject>> diagnostics = diagnosticsCollector.getDiagnostics();
for (final Diagnostic<? extends JavaFileObject> diagnostic : diagnostics) {
- // read error dertails from the diagnostic object
+ // read error details from the diagnostic object
System.out.println(diagnostic.getMessage(null));
}
(commons-jexl) 06/08: Remove unused exception from test signature
Posted by gg...@apache.org.
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 5990a3d68b7feebb9d2c8829fbf439d08cb0a1ec
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri May 31 23:21:40 2024 -0400
Remove unused exception from test signature
---
src/test/java/org/apache/commons/jexl3/ScriptCallableTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/org/apache/commons/jexl3/ScriptCallableTest.java b/src/test/java/org/apache/commons/jexl3/ScriptCallableTest.java
index 38e34625..d965a279 100644
--- a/src/test/java/org/apache/commons/jexl3/ScriptCallableTest.java
+++ b/src/test/java/org/apache/commons/jexl3/ScriptCallableTest.java
@@ -89,7 +89,7 @@ public class ScriptCallableTest extends JexlTestCase {
return 1;
}
- public int interrupt() throws InterruptedException {
+ public int interrupt() {
Thread.currentThread().interrupt();
return 42;
}