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

David Maplesden commented on JEXL-146:
--------------------------------------

The fix for this is fairly straight-forward, it just requires delaying the 
construction of the exception until the moment it is actually going to be 
thrown.  The information required to construct the appropriate exception can be 
passed through to the appropriate point.

I am happy to provide a patch for the change.  What is the best way to do this? 
 I can provide a pull request for the github mirror project or a patch file on 
this ticket?

It would be great to have it available in a stable release.  Doesn't look like 
there has been one of those in some time, is there any chance of one in the 
near future?  If so, should I provide a patch for 3.0 or 2.1?


> Performance problem in Interpreter.unknownVariable mechanism
> ------------------------------------------------------------
>
>                 Key: JEXL-146
>                 URL: https://issues.apache.org/jira/browse/JEXL-146
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 2.1.1, 3.0
>            Reporter: David Maplesden
>
> When JEXL is used in non-strict mode it silently ignores unknown variables.  
> However it still constructs a {{JexlException.Variable}} exception, even 
> though it doesn't throw it.
> Constructing exceptions in Java is expensive.  If you happen to have a 
> situation where unknown variables are common then this becomes a performance 
> problem.  It is showing up as an issue in our application.
> Inspecting the source of {{Interpreter}} it looks like a similar issue could 
> also occur with a number of the other exceptions.  They are always created, 
> even if they are not going to be thrown.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to