changeset 6644:3511cfe8925d

Remove unused stream related methods on node.
author psandoz
date Thu, 29 Nov 2012 11:58:15 +0100
parents b4107f9b4330
children 2f52eeca15e5
files src/share/classes/java/util/stream/op/Nodes.java src/share/classes/java/util/stream/primitive/IntNodes.java test-ng/tests/org/openjdk/tests/java/util/stream/op/NodeTest.java
diffstat 3 files changed, 0 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/stream/op/Nodes.java	Thu Nov 29 00:26:53 2012 -0800
+++ b/src/share/classes/java/util/stream/op/Nodes.java	Thu Nov 29 11:58:15 2012 +0100
@@ -238,34 +238,6 @@
         }
     }
 
-    public static<T> Node<T> node(Streamable<Stream<T>> s) {
-        return node(s.parallel());
-    }
-
-    public static<T> Node<T> node(Stream<? extends T> stream) {
-        if (stream instanceof AbstractPipeline) {
-            // @@@ Yuk! the cast sucks, but it avoids uncessary wrapping
-            return ((AbstractPipeline<T, T>) stream).pipeline(CollectorOps.<T>terminalCollector());
-        }
-        else {
-            // @@@ This path can occur if there are other implementations of Stream
-            //     e.g. if the a Stream instance is a proxy
-            final NodeBuilder<T> nb = Nodes.makeVariableSizeBuilder();
-
-            // @@@ stream.into(sb) fails because the NodeBuilder does not implement the full contract
-            // of Collection
-            // @@@ NodeBuilder could implement Stream.Destination
-
-            nb.begin(-1);
-            Iterator<? extends T> i = stream.iterator();
-            while (i.hasNext())
-                nb.accept(i.next());
-            nb.end();
-
-            return nb.build();
-        }
-    }
-
     @SafeVarargs
     public static<T> Node<T> node(Node<T>... nodes) {
         Objects.requireNonNull(nodes);
--- a/src/share/classes/java/util/stream/primitive/IntNodes.java	Thu Nov 29 00:26:53 2012 -0800
+++ b/src/share/classes/java/util/stream/primitive/IntNodes.java	Thu Nov 29 11:58:15 2012 +0100
@@ -117,31 +117,6 @@
         }
     }
 
-    public static IntNode node(Streamable<IntStream> s) {
-        return node(s.parallel());
-    }
-
-    public static IntNode node(IntStream stream) {
-        if (stream instanceof AbstractPipeline) {
-            // @@@ Yuk! the cast sucks, but it avoids unnecessary wrapping
-            return (IntNode) ((AbstractPipeline<Integer, Integer>) stream).pipeline(IntCollectorOps.terminalCollector());
-        }
-        else {
-            // @@@ This path can occur if there are other implementations of Stream
-            //     e.g. if the a Stream instance is a proxy
-            final IntNodeBuilder nb = makeVariableSizeBuilder();
-
-            // @@@ stream.into(sb) fails because the NodeBuilder does not implement the full contract
-            // of Collection
-            // @@@ NodeBuilder could implement Stream.Destination
-
-            nb.begin(-1);
-            stream.iterator().forEach(nb);
-
-            return nb.build();
-        }
-    }
-
     @SafeVarargs
     public static IntNode node(IntNode... nodes) {
         Objects.requireNonNull(nodes);
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/op/NodeTest.java	Thu Nov 29 00:26:53 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/op/NodeTest.java	Thu Nov 29 11:58:15 2012 +0100
@@ -56,9 +56,6 @@
             List<Node<Integer>> nodes = new ArrayList<>();
             nodes.add(Nodes.node(array));
             nodes.add(Nodes.node(Arrays.asList(array)));
-            nodes.add(Nodes.node((Streamable<Stream<Integer>>) Arrays.asList(array)));
-            nodes.add(Nodes.node(Arrays.asList(array).stream()));
-            nodes.add(Nodes.node(Arrays.asList(array).parallel()));
             nodes.add(degenerateTree(Arrays.asList(array).iterator()));
             nodes.add(tree(Arrays.asList(array), l -> Nodes.node(l.toArray(new Integer[l.size()]))));
             nodes.add(tree(Arrays.asList(array), l -> Nodes.node(l)));