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,11 +25,10 @@
 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;
 

@@ -112,11 +111,11 @@
         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();
+            this.comparator = (Comparator<? super T>) Comparator.naturalOrder();
         }
 
         /**
          * Sort using the provided comparator.
          *