Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78F0377A8 for ; Thu, 1 Dec 2011 09:02:15 +0000 (UTC) Received: (qmail 12824 invoked by uid 500); 1 Dec 2011 09:02:15 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 11464 invoked by uid 500); 1 Dec 2011 09:02:08 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 11446 invoked by uid 99); 1 Dec 2011 09:02:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 09:02:04 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 09:02:02 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 87F12AB1F0 for ; Thu, 1 Dec 2011 09:01:41 +0000 (UTC) Date: Thu, 1 Dec 2011 09:01:41 +0000 (UTC) From: "Sebb (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <1710953774.30204.1322730101558.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (JEXL-83) Make JexlArithmetic immutable (and threadsafe) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JEXL-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160757#comment-13160757 ] Sebb commented on JEXL-83: -------------------------- An alternative solution is to make the boolean variables (strict/debug/silent) volatile. If one thread changes the value, then at least all other threads would see the updated value (which is currently not the case). As far as I can tell the code does not rely on the values remaining unchanged; it checks the values on demand. So the worst that could happen would be minor changes in behaviour during an evaluation. > 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: 3.0 > > 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. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira