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] [Created] (GROOVY-7951) MethodCallExpression.transformExpression does not copy generic types
Date Wed, 28 Sep 2016 21:58:20 GMT
Eric Milles created GROOVY-7951:
-----------------------------------

             Summary: MethodCallExpression.transformExpression does not copy generic types
                 Key: GROOVY-7951
                 URL: https://issues.apache.org/jira/browse/GROOVY-7951
             Project: Groovy
          Issue Type: Bug
          Components: ast builder
    Affects Versions: 2.4.7
            Reporter: Eric Milles
            Priority: Minor


org.codehaus.groovy.ast.expr.MethodCallExpression.transformExpression(ExpressionTransformer)
is not copying generics info.  Downstream visitors are unable to check generics on static
calls like Collections.<String>emptyList().


My patched version:
{code:java}
    public Expression transformExpression(ExpressionTransformer transformer) {
        MethodCallExpression answer =
            new MethodCallExpression(transformer.transform(objectExpression), transformer.transform(method),
transformer.transform(arguments));
        answer.setSafe(safe);
        answer.setSpreadSafe(spreadSafe);
        answer.setImplicitThis(implicitThis);
        // GRECLIPSE add
        answer.setGenericsTypes(genericsTypes);
        // GRECLIPSE end
        answer.setMethodTarget(target);
        answer.setSourcePosition(this);
        answer.copyNodeMetaData(this);
        return answer;
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message