From e02f15e3acc257d78d1fd55a349fc3ff16d72d44 Mon Sep 17 00:00:00 2001 From: psandoz Date: Mon, 10 Jun 2013 12:26:20 +0200 Subject: [PATCH] 8015792: Rename Spliterators.spliteratorFromIterator to Spliterators.iterator Reviewed-by: chegar --- src/share/classes/java/util/Spliterators.java | 8 ++++---- .../classes/java/util/stream/DoublePipeline.java | 2 +- .../classes/java/util/stream/IntPipeline.java | 2 +- .../classes/java/util/stream/LongPipeline.java | 2 +- .../java/util/stream/ReferencePipeline.java | 2 +- .../classes/java/util/stream/SpinedBuffer.java | 8 ++++---- .../SpliteratorTraversingAndSplittingTest.java | 14 +++++++------- .../stream/bootlib/java/util/stream/TestData.java | 8 ++++---- .../boottest/java/util/stream/DoubleNodeTest.java | 2 +- .../boottest/java/util/stream/IntNodeTest.java | 2 +- .../boottest/java/util/stream/LongNodeTest.java | 2 +- .../tests/java/util/stream/SortedOpTest.java | 6 +++--- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/share/classes/java/util/Spliterators.java b/src/share/classes/java/util/Spliterators.java index 860f37a81..f0d7a4e31 100644 --- a/src/share/classes/java/util/Spliterators.java +++ b/src/share/classes/java/util/Spliterators.java @@ -663,7 +663,7 @@ public final class Spliterators { * @return An iterator * @throws NullPointerException if the given spliterator is {@code null} */ - public static Iterator iteratorFromSpliterator(Spliterator spliterator) { + public static Iterator iterator(Spliterator spliterator) { Objects.requireNonNull(spliterator); class Adapter implements Iterator, Consumer { boolean valueReady = false; @@ -708,7 +708,7 @@ public final class Spliterators { * @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 @@ public final class Spliterators { * @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 @@ public final class Spliterators { * @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; diff --git a/src/share/classes/java/util/stream/DoublePipeline.java b/src/share/classes/java/util/stream/DoublePipeline.java index b403a433f..5b1b4c7b4 100644 --- a/src/share/classes/java/util/stream/DoublePipeline.java +++ b/src/share/classes/java/util/stream/DoublePipeline.java @@ -168,7 +168,7 @@ abstract class DoublePipeline @Override public final PrimitiveIterator.OfDouble iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override diff --git a/src/share/classes/java/util/stream/IntPipeline.java b/src/share/classes/java/util/stream/IntPipeline.java index 324ed43bd..c96588a6a 100644 --- a/src/share/classes/java/util/stream/IntPipeline.java +++ b/src/share/classes/java/util/stream/IntPipeline.java @@ -172,7 +172,7 @@ abstract class IntPipeline @Override public final PrimitiveIterator.OfInt iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override diff --git a/src/share/classes/java/util/stream/LongPipeline.java b/src/share/classes/java/util/stream/LongPipeline.java index f20025709..2c7e2f4a0 100644 --- a/src/share/classes/java/util/stream/LongPipeline.java +++ b/src/share/classes/java/util/stream/LongPipeline.java @@ -169,7 +169,7 @@ abstract class LongPipeline @Override public final PrimitiveIterator.OfLong iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override diff --git a/src/share/classes/java/util/stream/ReferencePipeline.java b/src/share/classes/java/util/stream/ReferencePipeline.java index 6fc4cc0e7..92a139fa6 100644 --- a/src/share/classes/java/util/stream/ReferencePipeline.java +++ b/src/share/classes/java/util/stream/ReferencePipeline.java @@ -137,7 +137,7 @@ abstract class ReferencePipeline @Override public final Iterator iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } diff --git a/src/share/classes/java/util/stream/SpinedBuffer.java b/src/share/classes/java/util/stream/SpinedBuffer.java index 8c051f00c..68625e2dd 100644 --- a/src/share/classes/java/util/stream/SpinedBuffer.java +++ b/src/share/classes/java/util/stream/SpinedBuffer.java @@ -227,7 +227,7 @@ class SpinedBuffer @Override public Iterator iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -712,7 +712,7 @@ class SpinedBuffer @Override public PrimitiveIterator.OfInt iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } public Spliterator.OfInt spliterator() { @@ -815,7 +815,7 @@ class SpinedBuffer @Override public PrimitiveIterator.OfLong iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @@ -919,7 +919,7 @@ class SpinedBuffer @Override public PrimitiveIterator.OfDouble iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } public Spliterator.OfDouble spliterator() { diff --git a/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java b/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java index 5990dde97..d58c2b9d5 100644 --- a/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java +++ b/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java @@ -170,7 +170,7 @@ public class SpliteratorTraversingAndSplittingTest { () -> 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 @@ public class SpliteratorTraversingAndSplittingTest { () -> 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 @@ public class SpliteratorTraversingAndSplittingTest { () -> 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 @@ public class SpliteratorTraversingAndSplittingTest { () -> 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; diff --git a/test/java/util/stream/bootlib/java/util/stream/TestData.java b/test/java/util/stream/bootlib/java/util/stream/TestData.java index e8b65d2bd..c204b318e 100644 --- a/test/java/util/stream/bootlib/java/util/stream/TestData.java +++ b/test/java/util/stream/bootlib/java/util/stream/TestData.java @@ -45,7 +45,7 @@ public interface TestData> @Override default Iterator iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } Spliterator spliterator(); @@ -292,7 +292,7 @@ public interface TestData> @Override public PrimitiveIterator.OfInt iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -317,7 +317,7 @@ public interface TestData> @Override public PrimitiveIterator.OfLong iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -342,7 +342,7 @@ public interface TestData> @Override public PrimitiveIterator.OfDouble iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override diff --git a/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java b/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java index 7ad4801e4..c348102cf 100644 --- a/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java +++ b/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java @@ -48,7 +48,7 @@ public class DoubleNodeTest extends OpTestCase { List> 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())); diff --git a/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java b/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java index 0d345ad45..b9292578d 100644 --- a/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java +++ b/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java @@ -48,7 +48,7 @@ public class IntNodeTest extends OpTestCase { List> 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())); diff --git a/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java b/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java index 0b101a04a..a14bcd0ee 100644 --- a/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java +++ b/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java @@ -48,7 +48,7 @@ public class LongNodeTest extends OpTestCase { List> 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())); diff --git a/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java b/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java index 2d1886b70..93ac4eae3 100644 --- a/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java +++ b/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java @@ -150,7 +150,7 @@ public class SortedOpTest extends OpTestCase { } 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 @@ public class SortedOpTest extends OpTestCase { } 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 @@ public class SortedOpTest extends OpTestCase { } 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) -- GitLab