changeset 6421:e9b1e2f1094c

Optimize imports and re-format.
author psandoz
date Fri, 16 Nov 2012 11:26:04 +0100
parents 68a734033306
children 9363babb2172
files test-ng/tests/org/openjdk/tests/java/util/stream/OpTestCase.java
diffstat 1 files changed, 20 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/OpTestCase.java	Fri Nov 16 10:49:00 2012 +0100
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/OpTestCase.java	Fri Nov 16 11:26:04 2012 +0100
@@ -27,17 +27,18 @@
 import org.openjdk.tests.java.util.LambdaTestHelpers;
 import org.openjdk.tests.java.util.stream.primitive.IntStreamIntermediateOpTestScenario;
 import org.testng.Assert;
-import org.testng.ITestContext;
-import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 import java.util.*;
 import java.util.function.BiPredicate;
 import java.util.function.Block;
+import java.util.function.Function;
 import java.util.function.Supplier;
-import java.util.function.Function;
 import java.util.stream.*;
-import java.util.stream.op.*;
+import java.util.stream.op.IntermediateOp;
+import java.util.stream.op.Node;
+import java.util.stream.op.NodeBuilder;
+import java.util.stream.op.TerminalOp;
 import java.util.stream.primitive.IntStream;
 
 /**
@@ -113,12 +114,12 @@
         }
 
         public <U, S_OUT extends BaseStream<U>> IntermediateOpTestBuilder<T, U, S_IN, S_OUT> usingOpFactory(Supplier<IntermediateOp> fop) {
-            return usingOpsFactory(() -> new IntermediateOp[] { fop.get() });
+            return usingOpsFactory(() -> new IntermediateOp[]{fop.get()});
         }
 
         @SuppressWarnings("unchecked")
         public <U, S_OUT extends BaseStream<U>> IntermediateOpTestBuilder<T, U, S_IN, S_OUT> usingOpsFactory(Supplier<IntermediateOp[]> fops) {
-            return using((S_IN s) -> (S_OUT) chain((AbstractPipeline<?, T>)s, fops.get()));
+            return using((S_IN s) -> (S_OUT) chain((AbstractPipeline<?, T>) s, fops.get()));
         }
 
         public <U, S_OUT extends BaseStream<U>> IntermediateOpTestBuilder<T, U, S_IN, S_OUT> using(Function<S_OUT, S_IN> m) {
@@ -249,7 +250,8 @@
         Node<U> refResult;
         if (b.refResult != null) {
             refResult = b.refResult;
-        } else {
+        }
+        else {
             // Induce the reference result
             b.before.apply(b.data);
             S_OUT sOut = b.m.apply(b.data.stream());
@@ -284,14 +286,14 @@
 
     @SuppressWarnings("rawtypes")
     protected <T, U, S_IN extends BaseStream<T>> U exerciseOps(TestData<T, S_IN> data, TerminalOp<T, U> terminal, IntermediateOp... ops) {
-        return exerciseOps(data, (u, v) -> Objects.equals(u,v), terminal, ops);
+        return exerciseOps(data, (u, v) -> Objects.equals(u, v), terminal, ops);
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @SuppressWarnings({"rawtypes", "unchecked"})
     protected static <T, U, S_IN extends BaseStream<T>> U exerciseOps(TestData<T, S_IN> data,
-                                          BiPredicate<U, U> equalator,
-                                          TerminalOp<T, U> terminalOp,
-                                          IntermediateOp... ops) {
+                                                                      BiPredicate<U, U> equalator,
+                                                                      TerminalOp<T, U> terminalOp,
+                                                                      IntermediateOp... ops) {
 
         // Sequentially collect the output that will be input to the terminal op
         Node<T> node = (Node<T>) data.seq(ops).collectOutput().flatten();
@@ -326,7 +328,7 @@
 
         // All sequential using pull
         {
-            AbstractPipeline<?, T> ap = (AbstractPipeline<?, T>)data.seq(ops);
+            AbstractPipeline<?, T> ap = (AbstractPipeline<?, T>) data.seq(ops);
             // Force pull by requesting iterator
             // @@@ seems fragile is there a better way?
             ap.iterator();
@@ -342,7 +344,7 @@
 
         // All parallel using pull
         {
-            AbstractPipeline<?, T> ap = (AbstractPipeline<?, T>)data.par(ops);
+            AbstractPipeline<?, T> ap = (AbstractPipeline<?, T>) data.par(ops);
             // Force pull by requesting iterator
             // @@@ seems fragile is there a better way?
             ap.iterator();
@@ -406,12 +408,12 @@
 
         // Source
 
-        @SuppressWarnings({ "rawtypes", "unchecked" })
+        @SuppressWarnings({"rawtypes", "unchecked"})
         default AbstractPipeline<?, T> seq() {
             return (AbstractPipeline<?, T>) stream();
         }
 
-        @SuppressWarnings({ "rawtypes", "unchecked" })
+        @SuppressWarnings({"rawtypes", "unchecked"})
         default AbstractPipeline<?, T> par() {
             return (AbstractPipeline<?, T>) stream();
         }
@@ -436,11 +438,11 @@
 
         // Terminal
 
-        default <U> U seq(TerminalOp<T, U> op)  {
+        default <U> U seq(TerminalOp<T, U> op) {
             return chain(seq(), op);
         }
 
-        default <U> U par(TerminalOp<T, U> op)  {
+        default <U> U par(TerminalOp<T, U> op) {
             return chain(par(), op);
         }