[
https://issues.apache.org/jira/browse/JEXL-52?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rahul Akolkar updated JEXL-52:
------------------------------
Description:
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}
was:
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}
Fix Version/s: Later
Nice idea, but won't get on the immediate roadmap without tested patches.
Hence, setting to "Later".
> 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
> 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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.