Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 70187 invoked from network); 30 Jul 2009 08:07:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Jul 2009 08:07:40 -0000 Received: (qmail 55094 invoked by uid 500); 30 Jul 2009 08:07:40 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 54973 invoked by uid 500); 30 Jul 2009 08:07:39 -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 54963 invoked by uid 99); 30 Jul 2009 08:07:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jul 2009 08:07:39 +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, 30 Jul 2009 08:07:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C7F66234C044 for ; Thu, 30 Jul 2009 01:07:14 -0700 (PDT) Message-ID: <1301999290.1248941234804.JavaMail.jira@brutus> Date: Thu, 30 Jul 2009 01:07:14 -0700 (PDT) From: "Henri Biestro (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (JEXL-60) Refactor o.a.c.jexl.util and o.a.c.jexl.util.introspection In-Reply-To: <1338787517.1248698775051.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-60?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737033#action_12737033 ] Henri Biestro commented on JEXL-60: ----------------------------------- The JEXL-60.patch is *not* relevant anymore; I can regenerate one if you want but I suspect there will be a lot of rejects to take care of... > Refactor o.a.c.jexl.util and o.a.c.jexl.util.introspection > ---------------------------------------------------------- > > Key: JEXL-60 > URL: https://issues.apache.org/jira/browse/JEXL-60 > Project: Commons JEXL > Issue Type: Improvement > Affects Versions: 2.0 > Reporter: Henri Biestro > Priority: Blocker > Fix For: 2.0 > > Attachments: JEXL-60.patch, jexl60.tar.gz, jexl60.tar.gz, jexl60.tar.gz > > > While working on JEXL-35 and looking at Cobertua reports, it appeared that some classes in jexl.util were not really used. > It seems that the intention in the original code line was to create specialized executors for each type of property getters and setters but was never completed. Thus, the Uberspectimpl was partly in charge of discovering methods which made things harder to follow and maintain. > The patch completes the original o.a.c.jexl.util with specialized executors for {property, map, list, duck} setters and getters as well as methods. Since 2.0 already switched the method cache from using string as keys to using MethodKey(s), their usage has been promoted futher up (a method key is a method name and a set of parameters - not arguments!-) so MethodExecutor(s) benefit from their existence. > Since it seemed natural, IntrospectionUtils code has been displaced to MethodKey since this is where parameters type matching has to occur. > The general method (setter & getter) discovery mechanism is reusing the original algorithm, trying the different types and returning the first alive one (aka the first executor for which a java.lang.method could be found). > The patch is faithfull to the original packages however some code has migrated; most of the Uberspectimpl code has been displaced into o.a.c.jexl.util.Introspector to keep it as simple as possible and still derivable. > There were also some low-hanging fruits in this whole refactoring: > The AST nodes (now JexlNode & SimpleNode) carry a volatile value field that allows to use them as cache for executors; this improves performance and allows no locking concurrency. Since we are creating executors, we might as well reuse when possible. > The Info (debugging info) has been put to use so Jexl can create more meaningfull error message when they occur; putting the JexlEngine in debug mode will make warning/exception messages report their point of creation (file or url for scripts, method for expression). > And a 'new' function/operator has been implemented so Jexl can now instantiate objects as well. > It is a huge and worrysome patch but the Checkstyle & Corbertua reports look pretty good. > The following classes need to be removed *before* applying the patch: > src/java/org/apache/commons/jexl/parser/JEXLNode.java > src/java/org/apache/commons/jexl/Arithmetic.java > src/java/org/apache/commons/jexl/util/PropertyExecutor.java > src/java/org/apache/commons/jexl/util/BooleanPropertyExecutor.java > src/java/org/apache/commons/jexl/util/introspection/IntrospectionUtils.java > src/java/org/apache/commons/jexl/util/introspection/UberspectLoggable.java > src/java/org/apache/commons/jexl/util/GetExecutor.java > The pom.xml has been modified to use a newer version of the javacc plugin. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.