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 2023/03/16 20:34:22 UTC

[commons-jexl] branch master updated (ce52f3f9 -> ff63b74d)

This is an automated email from the ASF dual-hosted git repository.

henrib pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git


    from ce52f3f9 Merge pull request #167 from apache/release
     new b40bbc02 JEXL-394: let classmap/permmissions see synthetic/bridge methods (as long as they are public);
     new 398f5cdf JEXL-394: let classmap/permmissions see synthetic/bridge methods (as long as they are public);
     new ff63b74d Merge remote-tracking branch 'origin/master'

The 3 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:
 pom.xml                                                       |  3 +++
 .../apache/commons/jexl3/internal/introspection/ClassMap.java |  2 +-
 .../apache/commons/jexl3/introspection/JexlPermissions.java   |  2 +-
 src/test/java/org/apache/commons/jexl3/Issues300Test.java     | 11 +++++++++++
 4 files changed, 16 insertions(+), 2 deletions(-)


[commons-jexl] 01/03: JEXL-394: let classmap/permmissions see synthetic/bridge methods (as long as they are public);

Posted by he...@apache.org.
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

commit b40bbc023bad5be5a7b37ff9fe4dbe0ecb576377
Author: henrib <he...@apache.org>
AuthorDate: Thu Mar 16 21:32:15 2023 +0100

    JEXL-394: let classmap/permmissions see synthetic/bridge methods (as long as they are public);
---
 pom.xml                                                     |  3 +++
 .../commons/jexl3/internal/introspection/ClassMap.java      |  2 +-
 .../apache/commons/jexl3/introspection/JexlPermissions.java |  2 +-
 src/test/java/org/apache/commons/jexl3/Issues300Test.java   | 13 +++++++++++++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index bbd437a1..4e9e07a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,6 +62,9 @@
         <commons.jacoco.lineRatio>0.85</commons.jacoco.lineRatio>
         <commons.jacoco.haltOnFailure>false</commons.jacoco.haltOnFailure>
 
+        <!-- Cyclone -->
+        <commons.cyclonedx.version>2.7.5</commons.cyclonedx.version>
+
         <!--
           Encoding of Java source files: ensures that the compiler and
           the javadoc generator use the right encoding. Subprojects may
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 0fabac30..ca8bee6f 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
@@ -322,7 +322,7 @@ final class ClassMap {
             final Method[] methods = clazz.getDeclaredMethods();
             for (final Method mi : methods) {
                 // method must be public, not a bridge, not synthetic
-                if (!Modifier.isPublic(mi.getModifiers()) || mi.isBridge() || mi.isSynthetic()) {
+                if (!Modifier.isPublic(mi.getModifiers())) {
                     continue;
                 }
                 // add method to byKey cache; do not override
diff --git a/src/main/java/org/apache/commons/jexl3/introspection/JexlPermissions.java b/src/main/java/org/apache/commons/jexl3/introspection/JexlPermissions.java
index 3af353ed..8fde342b 100644
--- a/src/main/java/org/apache/commons/jexl3/introspection/JexlPermissions.java
+++ b/src/main/java/org/apache/commons/jexl3/introspection/JexlPermissions.java
@@ -313,7 +313,7 @@ public interface JexlPermissions {
             return false;
         }
         // method must be public
-        if (!Modifier.isPublic(method.getModifiers()) || method.isBridge() || method.isSynthetic()) {
+        if (!Modifier.isPublic(method.getModifiers())) {
             return false;
         }
         return true;
diff --git a/src/test/java/org/apache/commons/jexl3/Issues300Test.java b/src/test/java/org/apache/commons/jexl3/Issues300Test.java
index e83dfa01..7e98bddc 100644
--- a/src/test/java/org/apache/commons/jexl3/Issues300Test.java
+++ b/src/test/java/org/apache/commons/jexl3/Issues300Test.java
@@ -24,6 +24,8 @@ import org.junit.Test;
 
 import java.io.StringReader;
 import java.io.StringWriter;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.math.MathContext;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -1274,4 +1276,15 @@ public class Issues300Test {
         Assert.assertEquals(0, dow.intValue());
     }
 
+    @Test public void testIssue394() {
+        StringBuilder x = new StringBuilder("foobar");
+        Assert.assertEquals("foobar", x.toString());
+        String src = "x -> x.setLength(3)";
+        JexlEngine jexl = new JexlBuilder().create();
+        JexlScript script = jexl.createScript(src);
+        Object result = script.execute(null, x);
+        Assert.assertEquals("foo", x.toString());
+    }
+
+
 }


[commons-jexl] 03/03: Merge remote-tracking branch 'origin/master'

Posted by he...@apache.org.
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

commit ff63b74d7639516f8a7a33e8153b0cab051be76c
Merge: 398f5cdf ce52f3f9
Author: henrib <he...@apache.org>
AuthorDate: Thu Mar 16 21:34:18 2023 +0100

    Merge remote-tracking branch 'origin/master'



[commons-jexl] 02/03: JEXL-394: let classmap/permmissions see synthetic/bridge methods (as long as they are public);

Posted by he...@apache.org.
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

commit 398f5cdf121801cc7a0479827ce8e0c8f014491a
Author: henrib <he...@apache.org>
AuthorDate: Thu Mar 16 21:34:06 2023 +0100

    JEXL-394: let classmap/permmissions see synthetic/bridge methods (as long as they are public);
---
 src/test/java/org/apache/commons/jexl3/Issues300Test.java | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/test/java/org/apache/commons/jexl3/Issues300Test.java b/src/test/java/org/apache/commons/jexl3/Issues300Test.java
index 7e98bddc..f3d087ba 100644
--- a/src/test/java/org/apache/commons/jexl3/Issues300Test.java
+++ b/src/test/java/org/apache/commons/jexl3/Issues300Test.java
@@ -24,8 +24,6 @@ import org.junit.Test;
 
 import java.io.StringReader;
 import java.io.StringWriter;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
 import java.math.MathContext;
 import java.util.ArrayList;
 import java.util.Arrays;