groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Milles (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8726) Parameter lacks a reference to the MethodNode it belongs to
Date Fri, 03 Aug 2018 16:31:00 GMT

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

Eric Milles commented on GROOVY-8726:
-------------------------------------

Here is a case that will be affected by cloning the parameter array:

{code:java}
public class NamedArgsMethodNode extends MethodNode {

    private final Parameter[] params, namedParams, optionalParams;

    public NamedArgsMethodNode(String name, int modifiers, ClassNode returnType, Parameter[]
params, Parameter[] namedParams, Parameter[] optionalParams, ClassNode[] exceptions, Statement
code) {
        super(name, modifiers, returnType, concatParams(params, namedParams, optionalParams),
exceptions, code);
        this.params = params;
        this.namedParams = namedParams;
        this.optionalParams = optionalParams;
    }
{code}


Also, in {{copy}} there is probably no need to create a new array for null or 0 length array.

> Parameter lacks a reference to the MethodNode it belongs to
> -----------------------------------------------------------
>
>                 Key: GROOVY-8726
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8726
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Compiler
>    Affects Versions: 2.5.1
>            Reporter: James Kleeh
>            Priority: Major
>
> The Parameter class lacks a reference to it's method node. This is important to find
arguments that have been "overridden".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message