Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.5
-
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.