groovy-core icon indicating copy to clipboard operation
groovy-core copied to clipboard

GROOVY-7319: Add primitive array min() and max()

Open yukoba opened this issue 10 years ago • 2 comments

Please see http://jira.codehaus.org/browse/GROOVY-7319 for the detail.

yukoba avatar Feb 23 '15 14:02 yukoba

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

blackdrag avatar Feb 23 '15 16:02 blackdrag

OK, I did three things.

  1. Wrote an email to dev mailing list.
  2. Checked the return type in ArrayTest.
  3. Renamed min(IntComparator) to minComapre(IntComparator).

yukoba avatar Feb 24 '15 01:02 yukoba

Functionality now mostly merged in Groovy 5.

paulk-asert avatar Jul 24 '23 02:07 paulk-asert