changeset 7364:9c462579b624

8015792: Rename Spliterators.spliteratorFromIterator to Spliterators.iterator Reviewed-by: chegar
author psandoz
date Mon, 10 Jun 2013 12:26:20 +0200
parents 7322e8ad7c01
children d790064850a7
files src/share/classes/java/util/Spliterators.java src/share/classes/java/util/stream/DoublePipeline.java src/share/classes/java/util/stream/IntPipeline.java src/share/classes/java/util/stream/LongPipeline.java src/share/classes/java/util/stream/ReferencePipeline.java src/share/classes/java/util/stream/SpinedBuffer.java test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java test/java/util/stream/bootlib/java/util/stream/TestData.java test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java test/java/util/stream/boottest/java/util/stream/IntNodeTest.java test/java/util/stream/boottest/java/util/stream/LongNodeTest.java test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java
diffstat 12 files changed, 29 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/Spliterators.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/src/share/classes/java/util/stream/DoublePipeline.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/src/share/classes/java/util/stream/IntPipeline.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/src/share/classes/java/util/stream/LongPipeline.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/src/share/classes/java/util/stream/ReferencePipeline.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/src/share/classes/java/util/stream/SpinedBuffer.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/test/java/util/stream/bootlib/java/util/stream/TestData.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java	Mon Jun 10 12:20:34 2013 +0200
+++ b/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)