Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-374

No exception if dereferencing null object using safe(false) and antish(false)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2.1
    • 3.3
    • None

    Description

      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 'nested.name' and nested is null, that an exception similar to an NPE will be thrown, instead it returns null, the behaviour I would expected if safe were true.  I also noticed that I can put anything like 'foo.name' and it also returns null.  I am including the workaround from JEXL-370.

       

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

       

       

       

      Attachments

        Activity

          People

            henrib Henri Biestro
            alex24 Alex
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: