< prev index next >

test/jdk/java/util/concurrent/tck/CompletableFutureTest.java

Print this page
8234131: Miscellaneous changes imported from jsr166 CVS 2021-01
Reviewed-by: martin

@@ -3777,20 +3777,10 @@
         CompletableFuture<Integer> f = CompletableFuture.failedFuture(ex);
         checkCompletedExceptionally(f, ex);
     }
 
     /**
-     * failedFuture(null) throws NPE
-     */
-    public void testFailedFuture_null() {
-        try {
-            CompletableFuture<Integer> f = CompletableFuture.failedFuture(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
      * copy returns a CompletableFuture that is completed normally,
      * with the same value, when source is.
      */
     public void testCopy_normalCompletion() {
         for (boolean createIncomplete : new boolean[] { true, false })

@@ -4215,16 +4205,13 @@
             Class<?>[] parameterTypes = method.getParameterTypes();
             Object[] args = new Object[parameterTypes.length];
             // Manufacture boxed primitives for primitive params
             for (int i = 0; i < args.length; i++) {
                 Class<?> type = parameterTypes[i];
-                if (parameterTypes[i] == boolean.class)
-                    args[i] = false;
-                else if (parameterTypes[i] == int.class)
-                    args[i] = 0;
-                else if (parameterTypes[i] == long.class)
-                    args[i] = 0L;
+                if      (type == boolean.class) args[i] = false;
+                else if (type == int.class)     args[i] = 0;
+                else if (type == long.class)    args[i] = 0L;
             }
             for (CompletionStage<Integer> stage : stages) {
                 try {
                     method.invoke(stage, args);
                     bugs.add(method);
< prev index next >