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-8535) FieldNode constructor appears to call setType incorrectly
Date Tue, 29 Jan 2019 19:07:00 GMT

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

Eric Milles commented on GROOVY-8535:
-------------------------------------

Also, there is only one constructor in FieldNode and it sets originType, so {{private ClassNode
originType = ClassHelper.DYNAMIC_TYPE;}} could be more efficient without the initializer.

> FieldNode constructor appears to call setType incorrectly
> ---------------------------------------------------------
>
>                 Key: GROOVY-8535
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8535
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.4.15
>            Reporter: Eric Milles
>            Priority: Major
>
> If initial value expression is non-null, the first call to {{setType}} appears to have
no effect.
> {code:java}
>     public FieldNode(String name, int modifiers, ClassNode type, ClassNode owner, Expression
initialValueExpression) {
>         this.name = name;
>         this.modifiers = modifiers;
>         this.type = type;
>         if (this.type == ClassHelper.DYNAMIC_TYPE && initialValueExpression !=
null)
>             this.setType(initialValueExpression.getType());
>         this.setType(type);
>         this.originType = type;
> {code}



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

Mime
View raw message