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 2011/02/18 15:04:38 UTC

[jira] Commented: (JEXL-83) Make JexlArithmetic immutable (and threadsafe)

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

Henri Biestro commented on JEXL-83:
-----------------------------------

After several months of usage, the only use-case where the leniency has a useful reason to change (besides tests) can not be an engine wide setting.
In the encountered cases, the engine was used both for configuration (in strict mode at startup) and during runtime evaluations (lenient). To avoid multiple Jexl engine instances - heavy -, the easy route was to derive JexlArithmetic so it could allow a thread-local behavior wrt leniency. This will be incorporated in the trunk.

> Make JexlArithmetic immutable (and threadsafe)
> ----------------------------------------------
>
>                 Key: JEXL-83
>                 URL: https://issues.apache.org/jira/browse/JEXL-83
>             Project: Commons JEXL
>          Issue Type: Improvement
>            Reporter: Sebb
>            Assignee: Henri Biestro
>             Fix For: Later
>
>         Attachments: JEXL-83.patch
>
>
> The JexlArithmetic class is currently not thread-safe because of the single field:
>     /** Whether this JexlArithmetic instance behaves in strict or lenient mode. */
>     protected boolean strict;
> If this field were made final, and the setLenient() method removed, then the class would be immutable and therefore thread-safe.
> This would mean that JexlEngine would also have to change.
> The class is new to 2.0, so this is the best time to fix this.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira