[ 
https://issues.apache.org/jira/browse/JEXL-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12732571#action_12732571
 ] 

Henri Biestro commented on JEXL-52:
-----------------------------------

Although reporting mispelled vars & methods is not implemented in 2.0, it is 
possible to derive an Interpreter  & derive JexlEngine.createIntrepreter to 
implement that feature.
Btw, post/pre-resolvers have been removed; equivalent behaviors should be 
implemented deriving JexlEngine/Interpreter .

> 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: 1.1.1
>         Environment: commons jexl 1.1.1
>            Reporter: madhav
>
> 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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to