Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 56328 invoked from network); 11 Jun 2009 16:59:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Jun 2009 16:59:21 -0000 Received: (qmail 95372 invoked by uid 500); 11 Jun 2009 16:59:32 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 95266 invoked by uid 500); 11 Jun 2009 16:59: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 95225 invoked by uid 99); 11 Jun 2009 16:59:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jun 2009 16:59:32 +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, 11 Jun 2009 16:59:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7B07E234C1EB for ; Thu, 11 Jun 2009 09:59:07 -0700 (PDT) Message-ID: <258204055.1244739547503.JavaMail.jira@brutus> Date: Thu, 11 Jun 2009 09:59:07 -0700 (PDT) From: "Henri Biestro (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (JEXL-55) JEXL 2.0 redux, attempting to restart the effort to release 2.0 In-Reply-To: <1228123531.1242926265714.JavaMail.jira@brutus> 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-55?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Biestro updated JEXL-55: ------------------------------ Attachment: (was: JEXL-55.patch) > 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 > > Attachments: JEXL-55.patch > > > 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 > Allows to use generics making the code easier to understand & maintain. > The JEXL-54 patch has been folded in; besides light performance improvement, it makes the code more > readable. > - java.util.logging (replaces dependency on commons-logging) > Controversial, as usual wrt Java logging :-). Added twist is a "local" class that acts as a facade to the LogManager allowing to use anonymous Loggers (necessary for applets, convenient to avoid WAS console output or to override/divert jul towards log4j/slf4j). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.