8015792: Rename Spliterators.spliteratorFromIterator to Spliterators.iterator
authorpsandoz
Mon, 10 Jun 2013 12:26:20 +0200
changeset 18155 889970e5b728
parent 18154 5ede18269905
child 18156 edb590d448c5
8015792: Rename Spliterators.spliteratorFromIterator to Spliterators.iterator Reviewed-by: chegar
jdk/src/share/classes/java/util/Spliterators.java
jdk/src/share/classes/java/util/stream/DoublePipeline.java
jdk/src/share/classes/java/util/stream/IntPipeline.java
jdk/src/share/classes/java/util/stream/LongPipeline.java
jdk/src/share/classes/java/util/stream/ReferencePipeline.java
jdk/src/share/classes/java/util/stream/SpinedBuffer.java
jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java
jdk/test/java/util/stream/bootlib/java/util/stream/TestData.java
jdk/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java
jdk/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java
jdk/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java
jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java
--- a/jdk/src/share/classes/java/util/Spliterators.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/src/share/classes/java/util/Spliterators.java	Mon Jun 10 12:26:20 2013 +0200
@@ -663,7 +663,7 @@
      * @return An iterator
      * @throws NullPointerException if the given spliterator is {@code null}
      */
-    public static<T> Iterator<T> iteratorFromSpliterator(Spliterator<? extends T> spliterator) {
+    public static<T> Iterator<T> iterator(Spliterator<? extends T> spliterator) {
         Objects.requireNonNull(spliterator);
         class Adapter implements Iterator<T>, Consumer<T> {
             boolean valueReady = false;
@@ -708,7 +708,7 @@
      * @return An iterator
      * @throws NullPointerException if the given spliterator is {@code null}
      */
-    public static PrimitiveIterator.OfInt iteratorFromSpliterator(Spliterator.OfInt spliterator) {
+    public static PrimitiveIterator.OfInt iterator(Spliterator.OfInt spliterator) {
         Objects.requireNonNull(spliterator);
         class Adapter implements PrimitiveIterator.OfInt, IntConsumer {
             boolean valueReady = false;
@@ -753,7 +753,7 @@
      * @return An iterator
      * @throws NullPointerException if the given spliterator is {@code null}
      */
-    public static PrimitiveIterator.OfLong iteratorFromSpliterator(Spliterator.OfLong spliterator) {
+    public static PrimitiveIterator.OfLong iterator(Spliterator.OfLong spliterator) {
         Objects.requireNonNull(spliterator);
         class Adapter implements PrimitiveIterator.OfLong, LongConsumer {
             boolean valueReady = false;
@@ -798,7 +798,7 @@
      * @return An iterator
      * @throws NullPointerException if the given spliterator is {@code null}
      */
-    public static PrimitiveIterator.OfDouble iteratorFromSpliterator(Spliterator.OfDouble spliterator) {
+    public static PrimitiveIterator.OfDouble iterator(Spliterator.OfDouble spliterator) {
         Objects.requireNonNull(spliterator);
         class Adapter implements PrimitiveIterator.OfDouble, DoubleConsumer {
             boolean valueReady = false;
--- a/jdk/src/share/classes/java/util/stream/DoublePipeline.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/src/share/classes/java/util/stream/DoublePipeline.java	Mon Jun 10 12:26:20 2013 +0200
@@ -168,7 +168,7 @@
 
     @Override
     public final PrimitiveIterator.OfDouble iterator() {
-        return Spliterators.iteratorFromSpliterator(spliterator());
+        return Spliterators.iterator(spliterator());
     }
 
     @Override
--- a/jdk/src/share/classes/java/util/stream/IntPipeline.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/src/share/classes/java/util/stream/IntPipeline.java	Mon Jun 10 12:26:20 2013 +0200
@@ -172,7 +172,7 @@
 
     @Override
     public final PrimitiveIterator.OfInt iterator() {
-        return Spliterators.iteratorFromSpliterator(spliterator());
+        return Spliterators.iterator(spliterator());
     }
 
     @Override
--- a/jdk/src/share/classes/java/util/stream/LongPipeline.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/src/share/classes/java/util/stream/LongPipeline.java	Mon Jun 10 12:26:20 2013 +0200
@@ -169,7 +169,7 @@
 
     @Override
     public final PrimitiveIterator.OfLong iterator() {
-        return Spliterators.iteratorFromSpliterator(spliterator());
+        return Spliterators.iterator(spliterator());
     }
 
     @Override
--- a/jdk/src/share/classes/java/util/stream/ReferencePipeline.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/src/share/classes/java/util/stream/ReferencePipeline.java	Mon Jun 10 12:26:20 2013 +0200
@@ -137,7 +137,7 @@
 
     @Override
     public final Iterator<P_OUT> iterator() {
-        return Spliterators.iteratorFromSpliterator(spliterator());
+        return Spliterators.iterator(spliterator());
     }
 
 
--- a/jdk/src/share/classes/java/util/stream/SpinedBuffer.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/src/share/classes/java/util/stream/SpinedBuffer.java	Mon Jun 10 12:26:20 2013 +0200
@@ -227,7 +227,7 @@
 
     @Override
     public Iterator<E> iterator() {
-        return Spliterators.iteratorFromSpliterator(spliterator());
+        return Spliterators.iterator(spliterator());
     }
 
     @Override
@@ -712,7 +712,7 @@
 
         @Override
         public PrimitiveIterator.OfInt iterator() {
-            return Spliterators.iteratorFromSpliterator(spliterator());
+            return Spliterators.iterator(spliterator());
         }
 
         public Spliterator.OfInt spliterator() {
@@ -815,7 +815,7 @@
 
         @Override
         public PrimitiveIterator.OfLong iterator() {
-            return Spliterators.iteratorFromSpliterator(spliterator());
+            return Spliterators.iterator(spliterator());
         }
 
 
@@ -919,7 +919,7 @@
 
         @Override
         public PrimitiveIterator.OfDouble iterator() {
-            return Spliterators.iteratorFromSpliterator(spliterator());
+            return Spliterators.iterator(spliterator());
         }
 
         public Spliterator.OfDouble spliterator() {
--- a/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java	Mon Jun 10 12:26:20 2013 +0200
@@ -170,7 +170,7 @@
                    () -> Spliterators.spliteratorUnknownSize(exp.iterator(), 0));
 
             db.add("Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Spliterator ), ...)",
-                   () -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(exp.spliterator()), exp.size(), 0));
+                   () -> Spliterators.spliterator(Spliterators.iterator(exp.spliterator()), exp.size(), 0));
 
             db.add("Spliterators.spliterator(T[], ...)",
                    () -> Spliterators.spliterator(exp.toArray(new Integer[0]), 0));
@@ -549,10 +549,10 @@
                    () -> Arrays.spliterator(exp));
 
             db.add("Spliterators.spliterator(PrimitiveIterator.OfInt, ...)",
-                   () -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), exp.length, 0));
+                   () -> Spliterators.spliterator(Spliterators.iterator(Arrays.spliterator(exp)), exp.length, 0));
 
             db.add("Spliterators.spliteratorUnknownSize(PrimitiveIterator.OfInt, ...)",
-                   () -> Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), 0));
+                   () -> Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(exp)), 0));
 
             class IntSpliteratorFromArray extends Spliterators.AbstractIntSpliterator {
                 int[] a;
@@ -702,10 +702,10 @@
                    () -> Arrays.spliterator(exp));
 
             db.add("Spliterators.spliterator(PrimitiveIterator.OfLong, ...)",
-                   () -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), exp.length, 0));
+                   () -> Spliterators.spliterator(Spliterators.iterator(Arrays.spliterator(exp)), exp.length, 0));
 
             db.add("Spliterators.spliteratorUnknownSize(PrimitiveIterator.OfLong, ...)",
-                   () -> Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), 0));
+                   () -> Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(exp)), 0));
 
             class LongSpliteratorFromArray extends Spliterators.AbstractLongSpliterator {
                 long[] a;
@@ -862,10 +862,10 @@
                    () -> Arrays.spliterator(exp));
 
             db.add("Spliterators.spliterator(PrimitiveIterator.OfDouble, ...)",
-                   () -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), exp.length, 0));
+                   () -> Spliterators.spliterator(Spliterators.iterator(Arrays.spliterator(exp)), exp.length, 0));
 
             db.add("Spliterators.spliteratorUnknownSize(PrimitiveIterator.OfDouble, ...)",
-                   () -> Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), 0));
+                   () -> Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(exp)), 0));
 
             class DoubleSpliteratorFromArray extends Spliterators.AbstractDoubleSpliterator {
                 double[] a;
--- a/jdk/test/java/util/stream/bootlib/java/util/stream/TestData.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/test/java/util/stream/bootlib/java/util/stream/TestData.java	Mon Jun 10 12:26:20 2013 +0200
@@ -45,7 +45,7 @@
 
     @Override
     default Iterator<T> iterator() {
-        return Spliterators.iteratorFromSpliterator(spliterator());
+        return Spliterators.iterator(spliterator());
     }
 
     Spliterator<T> spliterator();
@@ -292,7 +292,7 @@
 
             @Override
             public PrimitiveIterator.OfInt iterator() {
-                return Spliterators.iteratorFromSpliterator(spliterator());
+                return Spliterators.iterator(spliterator());
             }
 
             @Override
@@ -317,7 +317,7 @@
 
             @Override
             public PrimitiveIterator.OfLong iterator() {
-                return Spliterators.iteratorFromSpliterator(spliterator());
+                return Spliterators.iterator(spliterator());
             }
 
             @Override
@@ -342,7 +342,7 @@
 
             @Override
             public PrimitiveIterator.OfDouble iterator() {
-                return Spliterators.iteratorFromSpliterator(spliterator());
+                return Spliterators.iterator(spliterator());
             }
 
             @Override
--- a/jdk/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java	Mon Jun 10 12:26:20 2013 +0200
@@ -48,7 +48,7 @@
             List<Node<Double>> nodes = new ArrayList<>();
 
             nodes.add(Nodes.node(array));
-            nodes.add(degenerateTree(Spliterators.iteratorFromSpliterator(Arrays.spliterator(array))));
+            nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array))));
             nodes.add(tree(toList(array), l -> Nodes.node(toDoubleArray(l))));
             nodes.add(fill(array, Nodes.doubleBuilder(array.length)));
             nodes.add(fill(array, Nodes.doubleBuilder()));
--- a/jdk/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java	Mon Jun 10 12:26:20 2013 +0200
@@ -48,7 +48,7 @@
             List<Node<Integer>> nodes = new ArrayList<>();
 
             nodes.add(Nodes.node(array));
-            nodes.add(degenerateTree(Spliterators.iteratorFromSpliterator(Arrays.spliterator(array))));
+            nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array))));
             nodes.add(tree(toList(array), l -> Nodes.node(toIntArray(l))));
             nodes.add(fill(array, Nodes.intBuilder(array.length)));
             nodes.add(fill(array, Nodes.intBuilder()));
--- a/jdk/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java	Mon Jun 10 12:26:20 2013 +0200
@@ -48,7 +48,7 @@
             List<Node<Long>> nodes = new ArrayList<>();
 
             nodes.add(Nodes.node(array));
-            nodes.add(degenerateTree(Spliterators.iteratorFromSpliterator(Arrays.spliterator(array))));
+            nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array))));
             nodes.add(tree(toList(array), l -> Nodes.node(toLongArray(l))));
             nodes.add(fill(array, Nodes.longBuilder(array.length)));
             nodes.add(fill(array, Nodes.longBuilder()));
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java	Mon Jun 10 12:26:20 2013 +0200
@@ -150,7 +150,7 @@
     }
 
     private IntStream unknownSizeIntStream(int[] a) {
-        return StreamSupport.intStream(Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(a)), 0));
+        return StreamSupport.intStream(Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(a)), 0));
     }
 
     @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class)
@@ -193,7 +193,7 @@
     }
 
     private LongStream unknownSizeLongStream(long[] a) {
-        return StreamSupport.longStream(Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(a)), 0));
+        return StreamSupport.longStream(Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(a)), 0));
     }
 
     @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
@@ -236,7 +236,7 @@
     }
 
     private DoubleStream unknownSizeDoubleStream(double[] a) {
-        return StreamSupport.doubleStream(Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(a)), 0));
+        return StreamSupport.doubleStream(Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(a)), 0));
     }
 
     @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)