You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Daniel Pitts (Created) (JIRA)" <ji...@apache.org> on 2011/10/15 20:33:14 UTC

[jira] [Created] (OGNL-27) Move "toString" implementations into visitor pattern.

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


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

        

[jira] [Commented] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Daniel Pitts (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128270#comment-13128270 ] 

Daniel Pitts commented on OGNL-27:
----------------------------------

Okay, I'll make those changes next time I have a free block of time.

Thanks,
Daniel.

Sent from my iPhone

On Oct 15, 2011, at 12:39 PM, "Simone Tripodi (Commented) (JIRA)"


                
> 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
>
>
> 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

        

[jira] [Commented] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Simone Tripodi (Commented) (JIRA)" <ji...@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

        

[jira] [Commented] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Simone Tripodi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128267#comment-13128267 ] 

Simone Tripodi commented on OGNL-27:
------------------------------------

patch is good, I'd like to ask you 2 favors before applying it:

 * add {{@since 4.0}} tags to new methods;
 * respect the original code format - we are using the Maven [code convention|http://maven.apache.org/developers/conventions/code.html]

Many thanks in advance!
                
> 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
>
>
> 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

        

[jira] [Issue Comment Edited] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Daniel Pitts (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128270#comment-13128270 ] 

Daniel Pitts edited comment on OGNL-27 at 10/15/11 9:50 PM:
------------------------------------------------------------

Okay, I'll make those changes next time I have a free block of time.
                
      was (Author: danielpitts):
    Okay, I'll make those changes next time I have a free block of time.

Thanks,
Daniel.

Sent from my iPhone

On Oct 15, 2011, at 12:39 PM, "Simone Tripodi (Commented) (JIRA)"


                  
> 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
>
>
> 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

        

[jira] [Commented] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Simone Tripodi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128459#comment-13128459 ] 

Simone Tripodi commented on OGNL-27:
------------------------------------

Thanks a lot Daniel, I'm processing it right now!
                
> 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_visitor2.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

        

[jira] [Resolved] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Simone Tripodi (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Tripodi resolved OGNL-27.
--------------------------------

    Resolution: Fixed
      Assignee: Simone Tripodi

Patch successfully applied, see [r1184879|https://svn.apache.org/viewvc?view=revision&revision=1184879], thanks a lot for this contribution!
                
> 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
>            Assignee: Simone Tripodi
>         Attachments: to_string_visitor1.patch, to_string_visitor2.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

        

[jira] [Commented] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128471#comment-13128471 ] 

Hudson commented on OGNL-27:
----------------------------

Integrated in ognl #141 (See [https://builds.apache.org/job/ognl/141/])
    added OGNL-27 in the issue list
[OGNL-27] Move toString implementations into visitor pattern. - patch contributed by Daniel Pitts

simonetripodi : http://svn.apache.org/viewvc/?view=rev&rev=1184886
Files : 
* /commons/proper/ognl/trunk/src/changes/changes.xml

simonetripodi : http://svn.apache.org/viewvc/?view=rev&rev=1184879
Files : 
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTAssign.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTBitNegate.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTChain.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTConst.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTCtor.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTEval.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTIn.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTInstanceof.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTKeyValue.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTList.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTMap.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTMethod.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTNegate.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTNotIn.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTProject.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTProperty.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTRootVarRef.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTSelect.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTSelectFirst.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTSelectLast.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTSequence.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTStaticField.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTStaticMethod.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTThisVarRef.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTVarRef.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ExpressionNode.java
* /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/SimpleNode.java

                
> 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
>            Assignee: Simone Tripodi
>         Attachments: to_string_visitor1.patch, to_string_visitor2.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

        

[jira] [Updated] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Daniel Pitts (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Pitts updated OGNL-27:
-----------------------------

    Attachment: to_string_visitor1.patch

This patch replaces the mishmash of toString methods in the AST classes.
                
> 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
>
>
> 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

        

[jira] [Commented] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Simone Tripodi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128262#comment-13128262 ] 

Simone Tripodi commented on OGNL-27:
------------------------------------

sounds a very nice improvement, I'm going to have a look at the patch, thanks once again for your contribution!
                
> 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
>
>
> 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

        

[jira] [Updated] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Daniel Pitts (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Pitts updated OGNL-27:
-----------------------------

    Attachment: to_string_visitor2.patch

Looks like someone committed some conflicts before you applied the patch. I updated and merged. Here is the fixed patch.
                
> 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_visitor2.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

        

[jira] [Updated] (OGNL-27) Move "toString" implementations into visitor pattern.

Posted by "Daniel Pitts (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OGNL-27?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Pitts updated OGNL-27:
-----------------------------

    Attachment: to_string_visitor_with_style_recommendations.patch

Attaching new patch including Simone's requests for style/javadoc.
                
> 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