groovy-notifications mailing list archives

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


Eric Milles commented on GROOVY-8726:

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

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;

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

View raw message