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

wasted work in "DomToGroovy.mixedContent"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.5
    • 2.0.6
    • None
    • None
    • Patch

    Description

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

      In method "DomToGroovy.mixedContent", the loop over "list" should
      break immediately after "hasText" and "hasElement" are "true". All
      the iterations after "hasText" and "hasElement" are "true" do not
      perform any useful work, at best they just set "hasText" and
      "hasElement" again to "true".

      Method "addMethods" in class "EnumVisitor" has a similar loop (over
      "methods"), and this loop breaks immediately after both "hasNext" and
      "hasPrevious" are set to "true", just like in the proposed patch.

      Similarly, method "rootLoader" in class "GroovyStarter" has a loop
      that breaks when all three "hadMain" and "hadConf" and "hadCP" are set
      to "true", like in the proposed patch.

      Attachments

        1. patch.diff
          0.6 kB

        Activity

          People

            blackdrag Jochen Theodorou
            adriannistor Adrian Nistor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: