You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2021/06/29 07:00:03 UTC

[jira] [Closed] (JEXL-52) Implicit evaluation of misspelled EL and ways to detect such occurrences

     [ https://issues.apache.org/jira/browse/JEXL-52?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro closed JEXL-52.
-----------------------------

> Implicit evaluation of misspelled EL and ways to detect such occurrences
> ------------------------------------------------------------------------
>
>                 Key: JEXL-52
>                 URL: https://issues.apache.org/jira/browse/JEXL-52
>             Project: Commons JEXL
>          Issue Type: Improvement
>    Affects Versions: 2.0.1
>         Environment: commons jexl 1.1.1
>            Reporter: madhav
>            Assignee: Henri Biestro
>            Priority: Major
>             Fix For: Later
>
>
> I have a class called Athlete that has three boolean variables: ready, started and stopped.
> I created an instance of it with the name "obj" and created a JexlContext using it. I also registered a post JexlExprResolver with the Expression before calling evaluate() method on it.
> When I evaluate an incorrect EL "obj.statred" (method name is misspelled), evaluation calls my JexlExprResolver's evaluate() method. However when I change the EL to "!obj.statred", evaluation returns true.
> There are two issues here.
> 1. Returning true for an expression that cant be evaluated
> 2. Not calling any post resolvers.
> I'm using the above post resolver as a way of detecting misspelled ELs. 
> But the support for such post resolver may go away in future versions. Can anybody suggest a better way?
> {code:title=Athlete.java|borderStyle=solid}
> public class Athlete {
>     private boolean ready;
>     private boolean started;
>     public Athlete(boolean ready) {
>         this.ready = ready;
>     }
>     public boolean isStarted() {
>         return started;
>     }
>     public void setStarted(boolean started) {
>         this.started = started;
>     }
>     public boolean isReady() {
>         return ready;
>     }
>     public void setReady(boolean ready) {
>         this.ready = ready;
>     }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)