Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 5011 invoked from network); 21 May 2009 17:21:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 May 2009 17:21:32 -0000 Received: (qmail 36776 invoked by uid 500); 21 May 2009 17:20:34 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 36145 invoked by uid 500); 21 May 2009 17:20:32 -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 35348 invoked by uid 99); 21 May 2009 17:18:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 May 2009 17:18:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 May 2009 17:18:06 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AEB30234C051 for ; Thu, 21 May 2009 10:17:45 -0700 (PDT) Message-ID: <1228123531.1242926265714.JavaMail.jira@brutus> Date: Thu, 21 May 2009 10:17:45 -0700 (PDT) From: "Henri Biestro (JIRA)" To: issues@commons.apache.org Subject: [jira] Created: (JEXL-55) JEXL 2.0 redux, attempting to restart the effort to release 2.0 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 JEXL 2.0 redux, attempting to restart the effort to release 2.0 --------------------------------------------------------------- Key: JEXL-55 URL: https://issues.apache.org/jira/browse/JEXL-55 Project: Commons JEXL Issue Type: Improvement Affects Versions: 2.0 Reporter: Henri Biestro Fix For: 2.0 JEXL 2.0 redux This is an attempt at restarting the JEXL 2.0 release effort based on the 2.0 trunk. There was a lot of effort & good ideas already in the 2.0 branch and JEXL is just too convenient (imho) to be left in this state. The patch keeps the 2.0 structure, most notably using the visitor pattern to implement the interpreter. This allows to modify the grammar much more easily since the javacc generated code does not need to be modified. This patch incorporates a few fixes & enhancements: - Bean & ant-ish like assignment; allows expressions like "foo.bar.quux = 'some value'" If 'foo' is resolved as an object from the JexlContext, and 'foo' can access a 'bar' (either as a map access or a bean property) that itself allows to set a 'quux', that 'quux' will be set with the value. The 'ant-ish' like properties can only be set if no bean can be accessed during the evaluation. That is, in our case, if 'foo' & 'foo.bar' can *not* be solved as beans from the JexlContext, the property 'foo.bar.quux' will be added to the JexlContext. This is to avoid ambiguities that could stem from having both a 'foo.quux' ant property and a 'foo' in the JexlContext. - Ternary operator (+ GNU C extension '?:'); allows expressions like "foo?'true-or-not-null':'false-or-null' and 'foo?:"foo-is-null" The ternary operator is what you expect; the "?:" syntax allows the second operand to be omitted, and the first operand is implicitly used as the second. The expression 'x?:z' is equivalent to 'x?x:z' - Exception handling revisited; silent (aka 1.1 mode) or not The 1.1 code was silent in almost all cases when an exception occurs and usually returns 'null' in that case. The new code also allows to set the engine in a non lenient mode where all exceptions & errors will be reported, wrapped in a o.a.c.jexl.JexlException. This runtime exception carries which node (in the tree) is the point of origin, allowing to better diagnose why the error (the cause) occurs. - ScriptFactory, ExpressionFactory refactored A JexlEngine class is used as the non-static version instance; this should allow easier customization. The pre/post resolvers have been removed from expressions since it is now much easier to just derive from Interpreter to implement something specific. - java 5 based The JEXL-54 patch has been folded in; besides light performance improvement, it makes the code more readable. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.