groovy-core
groovy-core copied to clipboard
GROOVY-7319: Add primitive array min() and max()
Please see http://jira.codehaus.org/browse/GROOVY-7319 for the detail.
First of all "assert -3 as byte == a1.min()" shows to me the intention to ensure the return value of min() is a byte. But even if it was any other primitive, the assert would not fail. instead you have to use "assert a1.min().class == Byte" or something similar... of course additionally to checking the value.
Then there is of course the course of action regarding those primitive type comparators. Maybe that should be discussed on the mailing list instead of here
OK, I did three things.
- Wrote an email to dev mailing list.
- Checked the return type in ArrayTest.
- Renamed min(IntComparator) to minComapre(IntComparator).
Functionality now mostly merged in Groovy 5.