commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Tripodi (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OGNL-27) Move "toString" implementations into visitor pattern.
Date Sun, 16 Oct 2011 11:46:12 GMT

    [ 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

        

Mime
View raw message