Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8166

Repeated operations in AnnotationCollectorTransform and Traits

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.12
    • Component/s: None
    • Labels:
      None

      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.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user jwagenleitner opened a pull request:

          https://github.com/apache/groovy/pull/543

          GROOVY-8166: Repeated operations in AnnotationCollectorTransform and …

          …Traits

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/jwagenleitner/groovy 8166

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/groovy/pull/543.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #543


          commit 72c01601d4cdd00622e6215b2a8d8dcac2ca4a89
          Author: John Wagenleitner <jwagenleitner@apache.org>
          Date: 2017-05-19T19:48:53Z

          GROOVY-8166: Repeated operations in AnnotationCollectorTransform and Traits


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user jwagenleitner opened a pull request: https://github.com/apache/groovy/pull/543 GROOVY-8166 : Repeated operations in AnnotationCollectorTransform and … …Traits You can merge this pull request into a Git repository by running: $ git pull https://github.com/jwagenleitner/groovy 8166 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/543.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #543 commit 72c01601d4cdd00622e6215b2a8d8dcac2ca4a89 Author: John Wagenleitner <jwagenleitner@apache.org> Date: 2017-05-19T19:48:53Z GROOVY-8166 : Repeated operations in AnnotationCollectorTransform and Traits
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/groovy/pull/543

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/543
          Hide
          jwagenleitner John Wagenleitner added a comment -

          Thanks for pointing out the duplicate ops.

          Show
          jwagenleitner John Wagenleitner added a comment - Thanks for pointing out the duplicate ops.

            People

            • Assignee:
              jwagenleitner John Wagenleitner
              Reporter:
              emilles Eric Milles
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development