[ 
https://issues.apache.org/jira/browse/OGNL-24?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114461#comment-13114461
 ] 

Adrian Crum commented on OGNL-24:
---------------------------------

If the object doing the visiting isn't going to do anything with the data 
parameter, then there is no need to include it in the accept method's parameter 
list. So, instead of

{code}

public <R,P> R accept(NodeVisitor<? extends R, ? super P> visitor, P data) {
    return visitor.visit(this, data);
}

{code}

use

{code}

public <R,P> R accept(NodeVisitor<? extends R, ? super P> visitor) {
    return visitor.visit(this);
}

{code}

or better

{code}

public <R,P> void accept(NodeVisitor<? extends R, ? super P> visitor) {
    visitor.visit(this);
}

{code}


> Support visitor pattern on AST
> ------------------------------
>
>                 Key: OGNL-24
>                 URL: https://issues.apache.org/jira/browse/OGNL-24
>             Project: OGNL
>          Issue Type: New Feature
>            Reporter: Daniel Pitts
>         Attachments: visitor-pattern.patch
>
>
> Supporting the visitor pattern on the AST tree allows for more modular 
> support of features and easier refactoring in the future.
> Patch to be attached.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to