[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Created] (JEXL-374) No exception if dereferencing null object using safe(false) and antish(f
From:       "Alex (Jira)" <jira () apache ! org>
Date:       2022-06-30 11:50:00
Message-ID: JIRA.13469451.1656589742000.1937.1656589800012 () Atlassian ! JIRA
[Download RAW message or body]

Alex created JEXL-374:
-------------------------

             Summary: No exception if dereferencing null object using safe(=
false) and antish(false)
                 Key: JEXL-374
                 URL: https://issues.apache.org/jira/browse/JEXL-374
             Project: Commons JEXL
          Issue Type: Bug
    Affects Versions: 3.2.1
            Reporter: Alex
         Attachments: ObjectContextNullRefTest-1.java

I create a JexlEngine as follows:

new JexlBuilder().cache(512).strict(true).silent(false).safe(false).antish(=
false).create();

with these options, I expected that if I evaluate an expression like 'neste=
d.name' and nested is null, that an exception similar to an NPE will be thr=
own, instead it returns null, the behaviour I would expected if safe were t=
rue.=C2=A0 I also noticed that I can put anything like 'foo.name' and it al=
so returns null.=C2=A0 I am including the workaround from JEXL-370.

=C2=A0

I've attached a test class to demonstrate the example. Please let me know i=
f any extra info is needed, and as always, thanks for all the great work on=
 Jexl.

=C2=A0

=C2=A0

=C2=A0



--
This message was sent by Atlassian Jira
(v8.20.10#820010)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic