You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by he...@apache.org on 2020/11/02 17:26:17 UTC
[commons-jexl] branch master updated: JEXL-337: reverting to code
and version of tools that allow generating the site (as in maven site) Task
#JEXL-337 - Fixing dependencies and lambdas
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 39bebb7 JEXL-337: reverting to code and version of tools that allow generating the site (as in maven site) Task #JEXL-337 - Fixing dependencies and lambdas
39bebb7 is described below
commit 39bebb775fb9371ee8af51dd89359c471c122fac
Author: henrib <he...@apache.org>
AuthorDate: Mon Nov 2 18:25:31 2020 +0100
JEXL-337: reverting to code and version of tools that allow generating the site (as in maven site)
Task #JEXL-337 - Fixing dependencies and lambdas
---
pom.xml | 4 +-
.../jexl3/internal/introspection/ClassMap.java | 8 +++-
.../commons/jexl3/introspection/JexlUberspect.java | 46 ++++++++++++----------
3 files changed, 35 insertions(+), 23 deletions(-)
diff --git a/pom.xml b/pom.xml
index c3c2899..6baa49a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,7 +53,7 @@
<commons.jira.id>JEXL</commons.jira.id>
<commons.jira.pid>12310479</commons.jira.pid>
<checkstyle.plugin.version>3.1.1</checkstyle.plugin.version>
- <checksyle.version>8.37</checksyle.version>
+ <checksyle.version>8.18</checksyle.version>
<!--
Encoding of Java source files: ensures that the compiler and
@@ -299,7 +299,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
- <version>3.13.0</version>
+ <version>3.7</version>
<configuration>
<targetJdk>${maven.compiler.target}</targetJdk>
<excludes>
diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java
index 3d6c659..43b9f02 100644
--- a/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java
+++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java
@@ -24,6 +24,7 @@ import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -223,7 +224,12 @@ final class ClassMap {
List<Method> lm = new ArrayList<Method>(cache.byKey.size());
lm.addAll(cache.byKey.values());
// sort all methods by name
- lm.sort((o1, o2) -> o1.getName().compareTo(o2.getName()));
+ lm.sort(new Comparator<Method>() {
+ @Override
+ public int compare(Method o1, Method o2) {
+ return o1.getName().compareTo(o2.getName());
+ }
+ });
// put all lists of methods with same name in byName cache
int start = 0;
while (start < lm.size()) {
diff --git a/src/main/java/org/apache/commons/jexl3/introspection/JexlUberspect.java b/src/main/java/org/apache/commons/jexl3/introspection/JexlUberspect.java
index f546f1b..41e014c 100644
--- a/src/main/java/org/apache/commons/jexl3/introspection/JexlUberspect.java
+++ b/src/main/java/org/apache/commons/jexl3/introspection/JexlUberspect.java
@@ -159,17 +159,20 @@ public interface JexlUberspect {
* If the operator is '[]' or if the operator is null and the object is a map, use the MAP list of resolvers;
* Other cases use the POJO list of resolvers.
*/
- ResolverStrategy JEXL_STRATEGY = (op, obj) -> {
- if (op == JexlOperator.ARRAY_GET) {
- return MAP;
- }
- if (op == JexlOperator.ARRAY_SET) {
- return MAP;
- }
- if (op == null && obj instanceof Map) {
- return MAP;
+ ResolverStrategy JEXL_STRATEGY = new ResolverStrategy() {
+ @Override
+ public List<PropertyResolver> apply(JexlOperator op, Object obj) {
+ if (op == JexlOperator.ARRAY_GET) {
+ return MAP;
+ }
+ if (op == JexlOperator.ARRAY_SET) {
+ return MAP;
+ }
+ if (op == null && obj instanceof Map) {
+ return MAP;
+ }
+ return POJO;
}
- return POJO;
};
/**
@@ -178,17 +181,20 @@ public interface JexlUberspect {
* <p>If the operator is '[]' or if the object is a map, use the MAP list of resolvers.
* Otherwise, use the POJO list of resolvers.</p>
*/
- ResolverStrategy MAP_STRATEGY = (op, obj) -> {
- if (op == JexlOperator.ARRAY_GET) {
- return MAP;
- }
- if (op == JexlOperator.ARRAY_SET) {
- return MAP;
- }
- if (obj instanceof Map) {
- return MAP;
+ ResolverStrategy MAP_STRATEGY = new ResolverStrategy() {
+ @Override
+ public List<PropertyResolver> apply(JexlOperator op, Object obj) {
+ if (op == JexlOperator.ARRAY_GET) {
+ return MAP;
+ }
+ if (op == JexlOperator.ARRAY_SET) {
+ return MAP;
+ }
+ if (obj instanceof Map) {
+ return MAP;
+ }
+ return POJO;
}
- return POJO;
};
/**