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

wasted work in "ClassNode.addMixin"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.5
    • 2.0.6, 2.1.0-beta-1, 1.8.9
    • None
    • None
    • Patch

    Description

      The problem appears in Groovy 2.0.5 and in revision 9c9cd23.. I
      attached a one-line patch (addMixin.diff) that fixes it.

      In method "ClassNode.addMixin", the loop over "mixins" should call
      "break" immediately after "skip" is set to "true". All the iterations
      after "skip" is set to "true" do not perform any useful work, at best
      they just set "skip" again to "true".

      "ClassNode.addInterface" has a similar problem. I attached a second
      patch for it (addInterface.diff).

      Attachments

        1. addInterface.diff
          0.5 kB
        2. addMixin.diff
          0.5 kB

        Activity

          People

            paulk Paul King
            adriannistor Adrian Nistor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: