src/share/classes/java/util/stream/SortedOps.java

Print this page
rev 7485 : 8009736: Comparator API cleanup
Reviewed-by:
Contributed-by: henry.jen@oracle.com

*** 25,35 **** package java.util.stream; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; - import java.util.Comparators; import java.util.Objects; import java.util.Spliterator; import java.util.concurrent.ForkJoinTask; import java.util.function.IntFunction; --- 25,34 ----
*** 112,122 **** OfRef(AbstractPipeline<?, T, ?> upstream) { super(upstream, StreamShape.REFERENCE, StreamOpFlag.IS_ORDERED | StreamOpFlag.IS_SORTED); this.isNaturalSort = true; // Will throw CCE when we try to sort if T is not Comparable ! this.comparator = (Comparator<? super T>) Comparators.naturalOrder(); } /** * Sort using the provided comparator. * --- 111,121 ---- OfRef(AbstractPipeline<?, T, ?> upstream) { super(upstream, StreamShape.REFERENCE, StreamOpFlag.IS_ORDERED | StreamOpFlag.IS_SORTED); this.isNaturalSort = true; // Will throw CCE when we try to sort if T is not Comparable ! this.comparator = (Comparator<? super T>) Comparator.naturalOrder(); } /** * Sort using the provided comparator. *