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 8545A7B47 for ; Sun, 16 Oct 2011 11:46:37 +0000 (UTC) Received: (qmail 63161 invoked by uid 500); 16 Oct 2011 11:46:37 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 63082 invoked by uid 500); 16 Oct 2011 11:46:36 -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 63074 invoked by uid 99); 16 Oct 2011 11:46:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Oct 2011 11:46:36 +0000 X-ASF-Spam-Status: No, hits=-2000.5 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; Sun, 16 Oct 2011 11:46:33 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 02B0A30AFC3 for ; Sun, 16 Oct 2011 11:46:12 +0000 (UTC) Date: Sun, 16 Oct 2011 11:46:12 +0000 (UTC) From: "Simone Tripodi (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <1624851163.18278.1318765572012.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <829172049.17510.1318703594215.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (OGNL-27) Move "toString" implementations into visitor pattern. 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/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128389#comment-13128389 ] Simone Tripodi commented on OGNL-27: ------------------------------------ Hi Daniel, thanks for your new contribution - and sorry for the delay, due to my local TimeZone. I tried to apply your patch but experienced conflicts: {code} commons-ognl simonetripodi$ patch -p0 < to_string_visitor_with_style_recommendations.patch patching file src/main/java/org/apache/commons/ognl/ASTList.java Hunk #1 succeeded at 63 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTAssign.java Hunk #1 succeeded at 48 (offset 1 line). Hunk #2 FAILED at 140. 1 out of 2 hunks FAILED -- saving rejects to file src/main/java/org/apache/commons/ognl/ASTAssign.java.rej patching file src/main/java/org/apache/commons/ognl/ASTSelectLast.java Hunk #1 succeeded at 63 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTBitNegate.java Hunk #1 succeeded at 43 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTCtor.java Hunk #1 succeeded at 54 (offset 1 line). Hunk #2 succeeded at 152 (offset 1 line). Hunk #3 FAILED at 354. 1 out of 3 hunks FAILED -- saving rejects to file src/main/java/org/apache/commons/ognl/ASTCtor.java.rej patching file src/main/java/org/apache/commons/ognl/ASTStaticMethod.java Hunk #2 FAILED at 243. 1 out of 2 hunks FAILED -- saving rejects to file src/main/java/org/apache/commons/ognl/ASTStaticMethod.java.rej patching file src/main/java/org/apache/commons/ognl/SimpleNode.java patching file src/main/java/org/apache/commons/ognl/ASTRootVarRef.java Hunk #1 succeeded at 51 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTNotIn.java Hunk #1 succeeded at 48 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTKeyValue.java Hunk #1 FAILED at 55. 1 out of 1 hunk FAILED -- saving rejects to file src/main/java/org/apache/commons/ognl/ASTKeyValue.java.rej patching file src/main/java/org/apache/commons/ognl/ToStringVisitor.java patching file src/main/java/org/apache/commons/ognl/ASTMap.java Hunk #1 succeeded at 65 (offset 1 line). Hunk #2 succeeded at 117 (offset 1 line). Hunk #3 FAILED at 126. 1 out of 3 hunks FAILED -- saving rejects to file src/main/java/org/apache/commons/ognl/ASTMap.java.rej patching file src/main/java/org/apache/commons/ognl/ASTVarRef.java Hunk #1 succeeded at 54 (offset 1 line). Hunk #2 succeeded at 97 (offset 1 line). Hunk #3 FAILED at 139. 1 out of 3 hunks FAILED -- saving rejects to file src/main/java/org/apache/commons/ognl/ASTVarRef.java.rej patching file src/main/java/org/apache/commons/ognl/ASTSelect.java Hunk #1 succeeded at 63 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTEval.java Hunk #1 succeeded at 79 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTProperty.java Hunk #1 succeeded at 139 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTSelectFirst.java Hunk #1 succeeded at 63 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTMethod.java Hunk #1 succeeded at 149 (offset 2 lines). patching file src/main/java/org/apache/commons/ognl/ASTSequence.java Hunk #1 succeeded at 95 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTChain.java Hunk #1 succeeded at 277 with fuzz 1 (offset 5 lines). patching file src/main/java/org/apache/commons/ognl/ASTThisVarRef.java Hunk #1 succeeded at 52 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTConst.java Hunk #1 succeeded at 21 with fuzz 2. Hunk #2 succeeded at 86 (offset 6 lines). patching file src/main/java/org/apache/commons/ognl/ASTInstanceof.java Hunk #1 succeeded at 45 (offset 1 line). Hunk #2 succeeded at 56 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ExpressionNode.java patching file src/main/java/org/apache/commons/ognl/ASTNegate.java Hunk #1 succeeded at 43 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTProject.java Hunk #1 succeeded at 61 (offset 1 line). patching file src/main/java/org/apache/commons/ognl/ASTStaticField.java Hunk #1 succeeded at 165 (offset 1 line). Hunk #2 FAILED at 208. 1 out of 2 hunks FAILED -- saving rejects to file src/main/java/org/apache/commons/ognl/ASTStaticField.java.rej patching file src/main/java/org/apache/commons/ognl/ASTIn.java Hunk #1 succeeded at 49 (offset 1 line). {code} I'm using the {{patch}} command line v2.5.8: {code} $ patch --version patch 2.5.8 Copyright (C) 1988 Larry Wall Copyright (C) 2002 Free Software Foundation, Inc. This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. written by Larry Wall and Paul Eggert {code} How did you produce the patch? Maybe my client is not good? TIA! > Move "toString" implementations into visitor pattern. > ----------------------------------------------------- > > Key: OGNL-27 > URL: https://issues.apache.org/jira/browse/OGNL-27 > Project: OGNL > Issue Type: New Feature > Reporter: Daniel Pitts > Attachments: to_string_visitor1.patch, to_string_visitor_with_style_recommendations.patch > > > Using the Visitor pattern allows for a cleaner implementation of toString(). > I have a patch which will remove toString() from all AST classes, and replace it with a single toString() in "SimpleNode" which delegates to a ToStringVisitor to build the String efficiently. > This patch can also be used as an example of how to move other business logic out of the AST classes into their own visitor classes. -- 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