[
https://issues.apache.org/jira/browse/JEXL-443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18008239#comment-18008239
]
Andriy Rysin commented on JEXL-443:
-----------------------------------
Just to note about release notes: I've never used jexl before and started with
3.4, and when it didn't work, I looked at 3.5 release notes, haven't found
anything related, and tried it anyway, and only as a last resort downgraded to
3.2 (which to my surprise actually worked).
> 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)