ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/CompletableFutureTest.java
(Generate patch)

Comparing jsr166/src/test/tck/CompletableFutureTest.java (file contents):
Revision 1.5 by dl, Thu Mar 21 16:26:43 2013 UTC vs.
Revision 1.8 by jsr166, Fri Mar 22 22:27:04 2013 UTC

# Line 75 | Line 75 | public class CompletableFutureTest exten
75          try {
76              f.join();
77              shouldThrow();
78 <        } catch (Throwable ex) {
79 <            assertTrue(ex instanceof CompletionException &&
80 <                       ((CompletionException)ex).getCause() instanceof CFException);
78 >        } catch (CompletionException success) {
79 >            assertTrue(success.getCause() instanceof CFException);
80          }
81          try {
82              f.getNow(null);
83              shouldThrow();
84 <        } catch (Throwable ex) {
85 <            assertTrue(ex instanceof CompletionException &&
87 <                       ((CompletionException)ex).getCause() instanceof CFException);
84 >        } catch (CompletionException success) {
85 >            assertTrue(success.getCause() instanceof CFException);
86          }
87          try {
88              f.get();
89              shouldThrow();
90 <        } catch (Throwable ex) {
91 <            assertTrue(ex instanceof ExecutionException &&
92 <                       ((ExecutionException)ex).getCause() instanceof CFException);
95 <        }
90 >        } catch (ExecutionException success) {
91 >            assertTrue(success.getCause() instanceof CFException);
92 >        } catch (Throwable fail) { threadUnexpectedException(fail); }
93          try {
94              f.get(0L, SECONDS);
95              shouldThrow();
96 <        } catch (Throwable ex) {
97 <            assertTrue(ex instanceof ExecutionException &&
98 <                       ((ExecutionException)ex).getCause() instanceof CFException);
102 <        }
96 >        } catch (ExecutionException success) {
97 >            assertTrue(success.getCause() instanceof CFException);
98 >        } catch (Throwable fail) { threadUnexpectedException(fail); }
99          assertTrue(f.isDone());
100          assertFalse(f.isCancelled());
101      }
# Line 108 | Line 104 | public class CompletableFutureTest exten
104          try {
105              f.join();
106              shouldThrow();
107 <        } catch (Throwable ex) {
112 <            assertTrue(ex instanceof CancellationException);
113 <        }
107 >        } catch (CancellationException success) {}
108          try {
109              f.getNow(null);
110              shouldThrow();
111 <        } catch (Throwable ex) {
118 <            assertTrue(ex instanceof CancellationException);
119 <        }
111 >        } catch (CancellationException success) {}
112          try {
113              f.get();
114              shouldThrow();
115 <        } catch (Throwable ex) {
116 <            assertTrue(ex instanceof CancellationException);
125 <        }
115 >        } catch (CancellationException success) {
116 >        } catch (Throwable fail) { threadUnexpectedException(fail); }
117          try {
118              f.get(0L, SECONDS);
119              shouldThrow();
120 <        } catch (Throwable ex) {
121 <            assertTrue(ex instanceof CancellationException);
131 <        }
120 >        } catch (CancellationException success) {
121 >        } catch (Throwable fail) { threadUnexpectedException(fail); }
122          assertTrue(f.isDone());
123          assertTrue(f.isCancelled());
124      }
# Line 137 | Line 127 | public class CompletableFutureTest exten
127          try {
128              f.join();
129              shouldThrow();
130 <        } catch (Throwable ex) {
131 <            assertTrue(ex instanceof CompletionException &&
142 <                       ((CompletionException)ex).getCause() instanceof CancellationException);
130 >        } catch (CompletionException success) {
131 >            assertTrue(success.getCause() instanceof CancellationException);
132          }
133          try {
134              f.getNow(null);
135              shouldThrow();
136 <        } catch (Throwable ex) {
137 <            assertTrue(ex instanceof CompletionException &&
149 <                       ((CompletionException)ex).getCause() instanceof CancellationException);
136 >        } catch (CompletionException success) {
137 >            assertTrue(success.getCause() instanceof CancellationException);
138          }
139          try {
140              f.get();
141              shouldThrow();
142 <        } catch (Throwable ex) {
143 <            assertTrue(ex instanceof ExecutionException &&
144 <                       ((ExecutionException)ex).getCause() instanceof CancellationException);
157 <        }
142 >        } catch (ExecutionException success) {
143 >            assertTrue(success.getCause() instanceof CancellationException);
144 >        } catch (Throwable fail) { threadUnexpectedException(fail); }
145          try {
146              f.get(0L, SECONDS);
147              shouldThrow();
148 <        } catch (Throwable ex) {
149 <            assertTrue(ex instanceof ExecutionException &&
150 <                       ((ExecutionException)ex).getCause() instanceof CancellationException);
164 <        }
148 >        } catch (ExecutionException success) {
149 >            assertTrue(success.getCause() instanceof CancellationException);
150 >        } catch (Throwable fail) { threadUnexpectedException(fail); }
151          assertTrue(f.isDone());
152          assertFalse(f.isCancelled());
153      }
# Line 249 | Line 235 | public class CompletableFutureTest exten
235          f.obtrudeException(new CFException());
236          checkCompletedWithWrappedCFException(f);
237      }
238 <    
238 >
239      /**
240       * getNumberOfDependents returns number of dependent tasks
241       */
# Line 285 | Line 271 | public class CompletableFutureTest exten
271          assertTrue(f.toString().contains("[Completed exceptionally]"));
272      }
273  
274 <    static final Supplier<Integer> supplyOne =
274 >    static final Supplier<Integer> supplyOne =
275          () -> Integer.valueOf(1);
276 <    static final Function<Integer, Integer> inc =
276 >    static final Function<Integer, Integer> inc =
277          (Integer x) -> Integer.valueOf(x.intValue() + 1);
278 <    static final BiFunction<Integer, Integer, Integer> add =
278 >    static final BiFunction<Integer, Integer, Integer> add =
279          (Integer x, Integer y) -> Integer.valueOf(x.intValue() + y.intValue());
280      static final class IncAction implements Consumer<Integer> {
281          int value;
# Line 297 | Line 283 | public class CompletableFutureTest exten
283      }
284      static final class AddAction implements BiConsumer<Integer, Integer> {
285          int value;
286 <        public void accept(Integer x, Integer y) {
287 <            value = x.intValue() + y.intValue();
286 >        public void accept(Integer x, Integer y) {
287 >            value = x.intValue() + y.intValue();
288          }
289      }
290      static final class Noop implements Runnable {
# Line 345 | Line 331 | public class CompletableFutureTest exten
331              ran = true; throw new CFException();
332          }
333      }
334 <    
334 >
335      // Used for explicit executor tests
336      static final class ThreadExecutor implements Executor {
337          public void execute(Runnable r) {
# Line 358 | Line 344 | public class CompletableFutureTest exten
344      }
345  
346      static final class IntegerHandler implements BiFunction<Integer, Throwable, Integer> {
347 <        public Integer apply(Integer x, Throwable t) {
347 >        public Integer apply(Integer x, Throwable t) {
348              return (t == null) ? two : three;
349          }
350      }
# Line 456 | Line 442 | public class CompletableFutureTest exten
442          assertTrue(r.ran);
443      }
444  
445 <    // seq conmpletion methods
446 <    
445 >    // seq completion methods
446 >
447      /**
448       * thenRun result completes normally after normal completion of source
449       */
# Line 1126 | Line 1112 | public class CompletableFutureTest exten
1112          try {
1113              g.join();
1114              shouldThrow();
1115 <        } catch(Exception ok) {
1115 >        } catch (Exception ok) {
1116          }
1117          checkCompletedWithWrappedCFException(g);
1118      }
# Line 1141 | Line 1127 | public class CompletableFutureTest exten
1127          f.complete(null);
1128          checkCompletedWithWrappedCFException(g);
1129      }
1130 <        
1130 >
1131      /**
1132       * thenRunAsync result completes exceptionally if source cancelled
1133       */
# Line 1184 | Line 1170 | public class CompletableFutureTest exten
1170          f.complete(null);
1171          checkCompletedWithWrappedCFException(g);
1172      }
1173 <        
1173 >
1174      /**
1175       * thenApplyAsync result completes exceptionally if source cancelled
1176       */
# Line 1230 | Line 1216 | public class CompletableFutureTest exten
1216          f.complete(null);
1217          checkCompletedWithWrappedCFException(g);
1218      }
1219 <        
1219 >
1220      /**
1221       * thenAcceptAsync result completes exceptionally if source cancelled
1222       */
# Line 1288 | Line 1274 | public class CompletableFutureTest exten
1274          f2.complete(two);
1275          checkCompletedWithWrappedCFException(g);
1276      }
1277 <        
1277 >
1278      /**
1279       * thenCombineAsync result completes exceptionally if either source cancelled
1280       */
# Line 1299 | Line 1285 | public class CompletableFutureTest exten
1285          assertTrue(f.cancel(true));
1286          f2.complete(two);
1287          checkCompletedWithWrappedCancellationException(g);
1288 <        
1288 >
1289          f = new CompletableFuture<Integer>();
1290          f2 = new CompletableFuture<Integer>();
1291          g = f.thenCombineAsync(f2, add);
# Line 1353 | Line 1339 | public class CompletableFutureTest exten
1339          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
1340          CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
1341          FailingBiConsumer r = new FailingBiConsumer();
1342 <        CompletableFuture<Void> g = f.thenAcceptBothAsync(f2, r);      
1342 >        CompletableFuture<Void> g = f.thenAcceptBothAsync(f2, r);
1343          f.complete(one);
1344          checkIncomplete(g);
1345          f2.complete(two);
1346          checkCompletedWithWrappedCFException(g);
1347      }
1348 <        
1348 >
1349      /**
1350       * thenAcceptBothAsync result completes exceptionally if either source cancelled
1351       */
# Line 1371 | Line 1357 | public class CompletableFutureTest exten
1357          assertTrue(f.cancel(true));
1358          f2.complete(two);
1359          checkCompletedWithWrappedCancellationException(g);
1360 <        
1360 >
1361          r = new AddAction();
1362          f = new CompletableFuture<Integer>();
1363          f2 = new CompletableFuture<Integer>();
# Line 1426 | Line 1412 | public class CompletableFutureTest exten
1412          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
1413          CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
1414          FailingNoop r = new FailingNoop();
1415 <        CompletableFuture<Void> g = f.runAfterBothAsync(f2, r);      
1415 >        CompletableFuture<Void> g = f.runAfterBothAsync(f2, r);
1416          f.complete(one);
1417          checkIncomplete(g);
1418          f2.complete(two);
1419          checkCompletedWithWrappedCFException(g);
1420      }
1421 <        
1421 >
1422      /**
1423       * runAfterBothAsync result completes exceptionally if either source cancelled
1424       */
# Line 1444 | Line 1430 | public class CompletableFutureTest exten
1430          assertTrue(f.cancel(true));
1431          f2.complete(two);
1432          checkCompletedWithWrappedCancellationException(g);
1433 <        
1433 >
1434          r = new Noop();
1435          f = new CompletableFuture<Integer>();
1436          f2 = new CompletableFuture<Integer>();
# Line 1498 | Line 1484 | public class CompletableFutureTest exten
1484          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
1485          CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
1486          FailingFunction r = new FailingFunction();
1487 <        CompletableFuture<Integer> g = f.applyToEitherAsync(f2, r);      
1487 >        CompletableFuture<Integer> g = f.applyToEitherAsync(f2, r);
1488          f.complete(one);
1489          checkCompletedWithWrappedCFException(g);
1490      }
1491 <        
1491 >
1492      /**
1493       * applyToEitherAsync result completes exceptionally if either source cancelled
1494       */
# Line 1512 | Line 1498 | public class CompletableFutureTest exten
1498          CompletableFuture<Integer> g = f.applyToEitherAsync(f2, inc);
1499          assertTrue(f.cancel(true));
1500          checkCompletedWithWrappedCancellationException(g);
1501 <        
1501 >
1502          f = new CompletableFuture<Integer>();
1503          f2 = new CompletableFuture<Integer>();
1504          assertTrue(f2.cancel(true));
# Line 1570 | Line 1556 | public class CompletableFutureTest exten
1556          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
1557          CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
1558          FailingConsumer r = new FailingConsumer();
1559 <        CompletableFuture<Void> g = f.acceptEitherAsync(f2, r);      
1559 >        CompletableFuture<Void> g = f.acceptEitherAsync(f2, r);
1560          f.complete(one);
1561          checkCompletedWithWrappedCFException(g);
1562      }
1563 <        
1563 >
1564      /**
1565       * acceptEitherAsync result completes exceptionally if either
1566       * source cancelled
# Line 1586 | Line 1572 | public class CompletableFutureTest exten
1572          CompletableFuture<Void> g = f.acceptEitherAsync(f2, r);
1573          assertTrue(f.cancel(true));
1574          checkCompletedWithWrappedCancellationException(g);
1575 <        
1575 >
1576          r = new IncAction();
1577          f = new CompletableFuture<Integer>();
1578          f2 = new CompletableFuture<Integer>();
# Line 1645 | Line 1631 | public class CompletableFutureTest exten
1631          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
1632          CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
1633          FailingNoop r = new FailingNoop();
1634 <        CompletableFuture<Void> g = f.runAfterEitherAsync(f2, r);      
1634 >        CompletableFuture<Void> g = f.runAfterEitherAsync(f2, r);
1635          f.complete(one);
1636          checkCompletedWithWrappedCFException(g);
1637      }
1638 <        
1638 >
1639      /**
1640       * runAfterEitherAsync result completes exceptionally if either
1641       * source cancelled
# Line 1661 | Line 1647 | public class CompletableFutureTest exten
1647          CompletableFuture<Void> g = f.runAfterEitherAsync(f2, r);
1648          assertTrue(f.cancel(true));
1649          checkCompletedWithWrappedCancellationException(g);
1650 <        
1650 >
1651          r = new Noop();
1652          f = new CompletableFuture<Integer>();
1653          f2 = new CompletableFuture<Integer>();
# Line 1671 | Line 1657 | public class CompletableFutureTest exten
1657      }
1658  
1659      /**
1660 <     * thenCompse result completes normally after normal completion of source
1660 >     * thenComposeAsync result completes normally after normal
1661 >     * completion of source
1662       */
1663      public void testThenComposeAsync() {
1664          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
# Line 1682 | Line 1669 | public class CompletableFutureTest exten
1669      }
1670  
1671      /**
1672 <     * thenComposeAsync result completes exceptionally after exceptional
1673 <     * completion of source
1672 >     * thenComposeAsync result completes exceptionally after
1673 >     * exceptional completion of source
1674       */
1675      public void testThenComposeAsync2() {
1676          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
# Line 1716 | Line 1703 | public class CompletableFutureTest exten
1703      }
1704  
1705  
1706 <    // aaync with explicit executors
1706 >    // async with explicit executors
1707  
1708      /**
1709       * thenRunAsync result completes normally after normal completion of source
# Line 1748 | Line 1735 | public class CompletableFutureTest exten
1735          try {
1736              g.join();
1737              shouldThrow();
1738 <        } catch(Exception ok) {
1738 >        } catch (Exception ok) {
1739          }
1740          checkCompletedWithWrappedCFException(g);
1741      }
# Line 1763 | Line 1750 | public class CompletableFutureTest exten
1750          f.complete(null);
1751          checkCompletedWithWrappedCFException(g);
1752      }
1753 <        
1753 >
1754      /**
1755       * thenRunAsync result completes exceptionally if source cancelled
1756       */
# Line 1806 | Line 1793 | public class CompletableFutureTest exten
1793          f.complete(null);
1794          checkCompletedWithWrappedCFException(g);
1795      }
1796 <        
1796 >
1797      /**
1798       * thenApplyAsync result completes exceptionally if source cancelled
1799       */
# Line 1852 | Line 1839 | public class CompletableFutureTest exten
1839          f.complete(null);
1840          checkCompletedWithWrappedCFException(g);
1841      }
1842 <        
1842 >
1843      /**
1844       * thenAcceptAsync result completes exceptionally if source cancelled
1845       */
# Line 1910 | Line 1897 | public class CompletableFutureTest exten
1897          f2.complete(two);
1898          checkCompletedWithWrappedCFException(g);
1899      }
1900 <        
1900 >
1901      /**
1902       * thenCombineAsync result completes exceptionally if either source cancelled
1903       */
# Line 1921 | Line 1908 | public class CompletableFutureTest exten
1908          assertTrue(f.cancel(true));
1909          f2.complete(two);
1910          checkCompletedWithWrappedCancellationException(g);
1911 <        
1911 >
1912          f = new CompletableFuture<Integer>();
1913          f2 = new CompletableFuture<Integer>();
1914          g = f.thenCombineAsync(f2, add, new ThreadExecutor());
# Line 1975 | Line 1962 | public class CompletableFutureTest exten
1962          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
1963          CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
1964          FailingBiConsumer r = new FailingBiConsumer();
1965 <        CompletableFuture<Void> g = f.thenAcceptBothAsync(f2, r, new ThreadExecutor());      
1965 >        CompletableFuture<Void> g = f.thenAcceptBothAsync(f2, r, new ThreadExecutor());
1966          f.complete(one);
1967          checkIncomplete(g);
1968          f2.complete(two);
1969          checkCompletedWithWrappedCFException(g);
1970      }
1971 <        
1971 >
1972      /**
1973       * thenAcceptBothAsync result completes exceptionally if either source cancelled
1974       */
# Line 1993 | Line 1980 | public class CompletableFutureTest exten
1980          assertTrue(f.cancel(true));
1981          f2.complete(two);
1982          checkCompletedWithWrappedCancellationException(g);
1983 <        
1983 >
1984          r = new AddAction();
1985          f = new CompletableFuture<Integer>();
1986          f2 = new CompletableFuture<Integer>();
# Line 2048 | Line 2035 | public class CompletableFutureTest exten
2035          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
2036          CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
2037          FailingNoop r = new FailingNoop();
2038 <        CompletableFuture<Void> g = f.runAfterBothAsync(f2, r, new ThreadExecutor());      
2038 >        CompletableFuture<Void> g = f.runAfterBothAsync(f2, r, new ThreadExecutor());
2039          f.complete(one);
2040          checkIncomplete(g);
2041          f2.complete(two);
2042          checkCompletedWithWrappedCFException(g);
2043      }
2044 <        
2044 >
2045      /**
2046       * runAfterBothAsync result completes exceptionally if either source cancelled
2047       */
# Line 2066 | Line 2053 | public class CompletableFutureTest exten
2053          assertTrue(f.cancel(true));
2054          f2.complete(two);
2055          checkCompletedWithWrappedCancellationException(g);
2056 <        
2056 >
2057          r = new Noop();
2058          f = new CompletableFuture<Integer>();
2059          f2 = new CompletableFuture<Integer>();
# Line 2120 | Line 2107 | public class CompletableFutureTest exten
2107          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
2108          CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
2109          FailingFunction r = new FailingFunction();
2110 <        CompletableFuture<Integer> g = f.applyToEitherAsync(f2, r, new ThreadExecutor());      
2110 >        CompletableFuture<Integer> g = f.applyToEitherAsync(f2, r, new ThreadExecutor());
2111          f.complete(one);
2112          checkCompletedWithWrappedCFException(g);
2113      }
2114 <        
2114 >
2115      /**
2116       * applyToEitherAsync result completes exceptionally if either source cancelled
2117       */
# Line 2134 | Line 2121 | public class CompletableFutureTest exten
2121          CompletableFuture<Integer> g = f.applyToEitherAsync(f2, inc, new ThreadExecutor());
2122          assertTrue(f.cancel(true));
2123          checkCompletedWithWrappedCancellationException(g);
2124 <        
2124 >
2125          f = new CompletableFuture<Integer>();
2126          f2 = new CompletableFuture<Integer>();
2127          assertTrue(f2.cancel(true));
# Line 2192 | Line 2179 | public class CompletableFutureTest exten
2179          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
2180          CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
2181          FailingConsumer r = new FailingConsumer();
2182 <        CompletableFuture<Void> g = f.acceptEitherAsync(f2, r, new ThreadExecutor());      
2182 >        CompletableFuture<Void> g = f.acceptEitherAsync(f2, r, new ThreadExecutor());
2183          f.complete(one);
2184          checkCompletedWithWrappedCFException(g);
2185      }
2186 <        
2186 >
2187      /**
2188       * acceptEitherAsync result completes exceptionally if either
2189       * source cancelled
# Line 2208 | Line 2195 | public class CompletableFutureTest exten
2195          CompletableFuture<Void> g = f.acceptEitherAsync(f2, r, new ThreadExecutor());
2196          assertTrue(f.cancel(true));
2197          checkCompletedWithWrappedCancellationException(g);
2198 <        
2198 >
2199          r = new IncAction();
2200          f = new CompletableFuture<Integer>();
2201          f2 = new CompletableFuture<Integer>();
# Line 2267 | Line 2254 | public class CompletableFutureTest exten
2254          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
2255          CompletableFuture<Integer> f2 = new CompletableFuture<Integer>();
2256          FailingNoop r = new FailingNoop();
2257 <        CompletableFuture<Void> g = f.runAfterEitherAsync(f2, r, new ThreadExecutor());      
2257 >        CompletableFuture<Void> g = f.runAfterEitherAsync(f2, r, new ThreadExecutor());
2258          f.complete(one);
2259          checkCompletedWithWrappedCFException(g);
2260      }
2261 <        
2261 >
2262      /**
2263       * runAfterEitherAsync result completes exceptionally if either
2264       * source cancelled
# Line 2283 | Line 2270 | public class CompletableFutureTest exten
2270          CompletableFuture<Void> g = f.runAfterEitherAsync(f2, r, new ThreadExecutor());
2271          assertTrue(f.cancel(true));
2272          checkCompletedWithWrappedCancellationException(g);
2273 <        
2273 >
2274          r = new Noop();
2275          f = new CompletableFuture<Integer>();
2276          f2 = new CompletableFuture<Integer>();
# Line 2293 | Line 2280 | public class CompletableFutureTest exten
2280      }
2281  
2282      /**
2283 <     * thenCompse result completes normally after normal completion of source
2283 >     * thenComposeAsync result completes normally after normal
2284 >     * completion of source
2285       */
2286      public void testThenComposeAsyncE() {
2287          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
# Line 2304 | Line 2292 | public class CompletableFutureTest exten
2292      }
2293  
2294      /**
2295 <     * thenComposeAsync result completes exceptionally after exceptional
2296 <     * completion of source
2295 >     * thenComposeAsync result completes exceptionally after
2296 >     * exceptional completion of source
2297       */
2298      public void testThenComposeAsync2E() {
2299          CompletableFuture<Integer> f = new CompletableFuture<Integer>();
# Line 2337 | Line 2325 | public class CompletableFutureTest exten
2325          checkCompletedWithWrappedCancellationException(g);
2326      }
2327  
2328 <    // other static methods    
2328 >    // other static methods
2329  
2330      /**
2331       * allOf(no component futures) returns a future completed normally
# Line 2354 | Line 2342 | public class CompletableFutureTest exten
2342      public void testAllOf() throws Exception {
2343          for (int k = 1; k < 20; ++k) {
2344              CompletableFuture[] fs = new CompletableFuture[k];
2345 <            for (int i = 0; i < k; ++i)
2345 >            for (int i = 0; i < k; ++i)
2346                  fs[i] = new CompletableFuture<Integer>();
2347              CompletableFuture<?> f = CompletableFuture.allOf(fs);
2348              for (int i = 0; i < k; ++i) {
# Line 2380 | Line 2368 | public class CompletableFutureTest exten
2368      public void testAnyOf() throws Exception {
2369          for (int k = 1; k < 20; ++k) {
2370              CompletableFuture[] fs = new CompletableFuture[k];
2371 <            for (int i = 0; i < k; ++i)
2371 >            for (int i = 0; i < k; ++i)
2372                  fs[i] = new CompletableFuture<Integer>();
2373              CompletableFuture<?> f = CompletableFuture.anyOf(fs);
2374              checkIncomplete(f);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines