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:21:00 GMT

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

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

When creating a clone of any node, be sure that you transfer annotations, node metadata and
source position.

Here is a more complete clone for Parameter:
{code:java}
                    parameter = new Parameter(parameterType, original.getName(), original.getInitialExpression());
                    parameter.addAnnotations(original.getAnnotations());
                    parameter.setClosureSharedVariable(original.isClosureSharedVariable());
                    parameter.setDeclaringClass(original.getDeclaringClass()); // TODO: resolve?
                    parameter.setHasNoRealSourcePosition(original.hasNoRealSourcePosition());
                    parameter.setInStaticContext(original.isInStaticContext());
                    parameter.setModifiers(original.getModifiers());
                    parameter.copyNodeMetaData(original);
                    parameter.setOriginType(original.getOriginType());
                    parameter.setSourcePosition(original);
                    parameter.setSynthetic(original.isSynthetic());
{code}

> 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