Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.4.7
-
None
-
Groovy Version: 2.4.7 JVM: 1.8.0_92 Vendor: Oracle Corporation OS: Mac OS X
Description
Fixing infinite loop in Iterable.collate method when step parameter is equals to zero.
Example:
[ 1, 2, 3 ].collate( 2, 0 )
The result is a infinite loop because the step parameter is used directly in the for increment: pos += step
In the fixing I assumed that the step parameter should be equals to size parameter, looks like in the collate(self, size, size, keepRemainder) overloaded method, with absence of step and I considered backward compatibility with negative steps.
PR opened in Github: https://github.com/apache/groovy/pull/378
Thks.
Felipe Mamud
Attachments
Issue Links
- links to