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] [Updated] (GROOVY-8166) Repeated operations in ClassNode and Traits
Date Tue, 25 Apr 2017 16:22:04 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-8166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Eric Milles updated GROOVY-8166:
--------------------------------
    Description: 
I think there are a couple bits of redundant code that I have run into looking at some stuff
related to traits and type checking.

1) In {{org.codehaus.groovy.transform.trait.Traits.isTrait(ClassNode)}}, the check for the
Trait annotation appears redundant to the call to {{isAnnotatedWithTrait}}.

2) In {{org.codehaus.groovy.transform.AnnotationCollectorTransform.makeListOfAnnotations(Object[][])}},
the recent addition of {{copyMembers}} appears to have missed removing the following line
{{toAdd.getMembers().putAll(generated);}}.  Thus I think the map {{generated}} is being asked
to put the same entries twice.

  was:
I think there are a couple bits of redundant code that I have run into looking at some stuff
related to traits and type checking.

1) In org.codehaus.groovy.transform.trait.Traits.isTrait(ClassNode), the check for the Trait
annotation appears redundant to the call to isAnnotatedWithTrait.

2) In org.codehaus.groovy.transform.AnnotationCollectorTransform.makeListOfAnnotations(Object[][]),
the recent addition of copyMembers appears to have missed removing the following line `toAdd.getMembers().putAll(generated);`.
 Thus I think the map `generated` is being asked to put the same entries twice.


> Repeated operations in ClassNode and Traits
> -------------------------------------------
>
>                 Key: GROOVY-8166
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8166
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Priority: Minor
>
> I think there are a couple bits of redundant code that I have run into looking at some
stuff related to traits and type checking.
> 1) In {{org.codehaus.groovy.transform.trait.Traits.isTrait(ClassNode)}}, the check for
the Trait annotation appears redundant to the call to {{isAnnotatedWithTrait}}.
> 2) In {{org.codehaus.groovy.transform.AnnotationCollectorTransform.makeListOfAnnotations(Object[][])}},
the recent addition of {{copyMembers}} appears to have missed removing the following line
{{toAdd.getMembers().putAll(generated);}}.  Thus I think the map {{generated}} is being asked
to put the same entries twice.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message