-
Enhancement
-
Resolution: Not an Issue
-
P4
-
None
-
5.0
A DESCRIPTION OF THE REQUEST :
It is inconsistent for Java to support taking the extrema of an arbitrary collection through Collections.min(...) and Collections.max(...) but not of an arbitrary array. Particularly, primitive arrays (which cannot be wrapped through Arrays.asList(T[])) require each application to supply its own minimum and maximum loop.
JUSTIFICATION :
- Duplicate code throughout many applications is a waste of developer time.
- Inconsistency between the treatment of arrays and collections is a very visible "wart" on the Java platform.
It is inconsistent for Java to support taking the extrema of an arbitrary collection through Collections.min(...) and Collections.max(...) but not of an arbitrary array. Particularly, primitive arrays (which cannot be wrapped through Arrays.asList(T[])) require each application to supply its own minimum and maximum loop.
JUSTIFICATION :
- Duplicate code throughout many applications is a waste of developer time.
- Inconsistency between the treatment of arrays and collections is a very visible "wart" on the Java platform.
- relates to
-
JDK-6239196 Addition of varargs version of Math.min() and Math.max()
-
- Closed
-
-
JDK-6358350 Math.min and Math.max should be able to accept a variable sized list
-
- Closed
-
-
JDK-4254492 Math.min() and Math.max() extension
-
- Closed
-