[
https://issues.apache.org/jira/browse/JEXL-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18008235#comment-18008235
]
Henri Biestro commented on JEXL-443:
------------------------------------
This is likely caused by the permissions defaults that changed in 3.3 (see
https://commons.apache.org/proper/commons-jexl/relnotes35.html ) and more to
the point
https://commons.apache.org/proper/commons-jexl/apidocs/org/apache/commons/jexl3/introspection/JexlPermissions.html
.
A remediation example in
https://stackoverflow.com/questions/77842177/errors-upon-apache-jexl-upgrade-from-3-2-1-to-3-3
.
> ObjectContext can't find fields with jexl3 >= 3.3
> -------------------------------------------------
>
> Key: JEXL-443
> URL: https://issues.apache.org/jira/browse/JEXL-443
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 3.3, 3.4.0, 3.5.0
> Environment: Linux / JDK 21
> Windows / JDK 17
> Reporter: Andriy Rysin
> Assignee: Henri Biestro
> Priority: Major
>
> I'm creating simple ObjectContext and with jexl3 >= 3.3 I am getting
> "variable 'param1' is undefined". This example works on jexl3 3.2.1.
> Surprisingly neither version can find "param0" even though getParam0() works.
>
> {code:java}
> public class JexlTest {
> @Test
> public void testJexlFields() throws Exception {
> JexlEngine jexl = new JexlBuilder()
> .cache(0)
> .strict(true)
> .silent(false)
> .create();
>
> Parameters object = new Parameters();
> object.setParam1(Enum1.VALUE1);
> JexlContext context = new ObjectContext<>(jexl, object);
> jexl.createExpression("param1").evaluate(context);
> // jexl.createExpression("param0").evaluate(context);
> jexl.createExpression("getParam0()").evaluate(context);
> }
>
> public static class Parameters {
> private String param0;
> private Enum1 param1;
>
> public String getParam0() {
> return param0;
> }
> public void setParam0(String param0) {
> this.param0 = param0;
> }
> public Enum1 getParam1() {
> return param1;
> }
> public void setParam1(Enum1 param1) {
> this.param1 = param1;
> }
>
> }
> public enum Enum1 {
> VALUE1
> }
> }
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)