ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/CompletableFuture.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/CompletableFuture.java (file contents):
Revision 1.65 by jsr166, Mon Mar 18 01:10:16 2013 UTC vs.
Revision 1.66 by jsr166, Mon Mar 18 05:37:20 2013 UTC

# Line 1339 | Line 1339 | public class CompletableFuture<T> implem
1339      }
1340  
1341      /**
1342 <     * Asynchronously executes in the {@link
1343 <     * ForkJoinPool#commonPool()}, a task that completes the returned
1344 <     * CompletableFuture with the result of the given Supplier.
1342 >     * Returns a new CompletableFuture that is asynchronously completed
1343 >     * by a task running in the {@link ForkJoinPool#commonPool()} with
1344 >     * the value obtained by calling the given Supplier.
1345       *
1346       * @param supplier a function returning the value to be used
1347       * to complete the returned CompletableFuture
# Line 1356 | Line 1356 | public class CompletableFuture<T> implem
1356      }
1357  
1358      /**
1359 <     * Asynchronously executes using the given executor, a task that
1360 <     * completes the returned CompletableFuture with the result of the
1361 <     * given Supplier.
1359 >     * Returns a new CompletableFuture that is asynchronously completed
1360 >     * by a task running in the given executor with the value obtained
1361 >     * by calling the given Supplier.
1362       *
1363       * @param supplier a function returning the value to be used
1364       * to complete the returned CompletableFuture
# Line 1375 | Line 1375 | public class CompletableFuture<T> implem
1375      }
1376  
1377      /**
1378 <     * Asynchronously executes in the {@link
1379 <     * ForkJoinPool#commonPool()} a task that runs the given action,
1380 <     * and then completes the returned CompletableFuture.
1378 >     * Returns a new CompletableFuture that is asynchronously completed
1379 >     * by a task running in the {@link ForkJoinPool#commonPool()} after
1380 >     * it runs the given action.
1381       *
1382       * @param runnable the action to run before completing the
1383       * returned CompletableFuture
# Line 1392 | Line 1392 | public class CompletableFuture<T> implem
1392      }
1393  
1394      /**
1395 <     * Asynchronously executes using the given executor, a task that
1396 <     * runs the given action, and then completes the returned
1397 <     * CompletableFuture.
1395 >     * Returns a new CompletableFuture that is asynchronously completed
1396 >     * by a task running in the given executor after it runs the given
1397 >     * action.
1398       *
1399       * @param runnable the action to run before completing the
1400       * returned CompletableFuture
# Line 1574 | Line 1574 | public class CompletableFuture<T> implem
1574      }
1575  
1576      /**
1577 <     * Returns a new CompletableFuture that is completed with
1578 <     * the result of the given function of this CompletableFuture.
1579 <     * If this CompletableFuture completes exceptionally,
1580 <     * then the returned CompletableFuture also does so,
1581 <     * with a CompletionException holding this exception as
1582 <     * its cause.
1577 >     * Returns a new CompletableFuture that is completed
1578 >     * when this CompletableFuture completes, with the result of the
1579 >     * given function of this CompletableFuture's result.
1580 >     *
1581 >     * <p>If this CompletableFuture completes exceptionally,
1582 >     * then the returned CompletableFuture also does so, with a
1583 >     * CompletionException holding this exception as its cause.
1584       *
1585       * @param fn the function to use to compute the value of
1586       * the returned CompletableFuture
# Line 1590 | Line 1591 | public class CompletableFuture<T> implem
1591      }
1592  
1593      /**
1594 <     * Returns a new CompletableFuture that is asynchronously
1595 <     * completed using the {@link ForkJoinPool#commonPool()} with the
1596 <     * result of the given function of this CompletableFuture.  If
1597 <     * this CompletableFuture completes exceptionally, then the
1598 <     * returned CompletableFuture also does so, with a
1594 >     * Returns a new CompletableFuture that is asynchronously completed
1595 >     * when this CompletableFuture completes, with the result of the
1596 >     * given function of this CompletableFuture's result, called from a
1597 >     * task running in the {@link ForkJoinPool#commonPool()}.
1598 >     *
1599 >     * <p>If this CompletableFuture completes exceptionally,
1600 >     * then the returned CompletableFuture also does so, with a
1601       * CompletionException holding this exception as its cause.
1602       *
1603       * @param fn the function to use to compute the value of
# Line 1607 | Line 1610 | public class CompletableFuture<T> implem
1610      }
1611  
1612      /**
1613 <     * Returns a new CompletableFuture that is asynchronously
1614 <     * completed using the given executor with the result of the given
1615 <     * function of this CompletableFuture.  If this CompletableFuture
1616 <     * completes exceptionally, then the returned CompletableFuture
1617 <     * also does so, with a CompletionException holding this exception as
1618 <     * its cause.
1613 >     * Returns a new CompletableFuture that is asynchronously completed
1614 >     * when this CompletableFuture completes, with the result of the
1615 >     * given function of this CompletableFuture's result, called from a
1616 >     * task running in the given executor.
1617 >     *
1618 >     * <p>If this CompletableFuture completes exceptionally,
1619 >     * then the returned CompletableFuture also does so, with a
1620 >     * CompletionException holding this exception as its cause.
1621       *
1622       * @param fn the function to use to compute the value of
1623       * the returned CompletableFuture
# Line 1672 | Line 1677 | public class CompletableFuture<T> implem
1677      }
1678  
1679      /**
1680 <     * Returns a new CompletableFuture that is completed after
1681 <     * performing the given action with this CompletableFuture's
1682 <     * result when it completes.  If this CompletableFuture
1683 <     * completes exceptionally, then the returned CompletableFuture
1684 <     * also does so, with a CompletionException holding this exception as
1685 <     * its cause.
1680 >     * Returns a new CompletableFuture that is completed
1681 >     * when this CompletableFuture completes, after performing the given
1682 >     * action with this CompletableFuture's result.
1683 >     *
1684 >     * <p>If this CompletableFuture completes exceptionally,
1685 >     * then the returned CompletableFuture also does so, with a
1686 >     * CompletionException holding this exception as its cause.
1687       *
1688       * @param block the action to perform before completing the
1689       * returned CompletableFuture
# Line 1688 | Line 1694 | public class CompletableFuture<T> implem
1694      }
1695  
1696      /**
1697 <     * Returns a new CompletableFuture that is asynchronously
1698 <     * completed using the {@link ForkJoinPool#commonPool()} with this
1699 <     * CompletableFuture's result when it completes.  If this
1700 <     * CompletableFuture completes exceptionally, then the returned
1701 <     * CompletableFuture also does so, with a CompletionException holding
1702 <     * this exception as its cause.
1697 >     * Returns a new CompletableFuture that is asynchronously completed
1698 >     * when this CompletableFuture completes, after performing the given
1699 >     * action with this CompletableFuture's result from a task running
1700 >     * in the {@link ForkJoinPool#commonPool()}.
1701 >     *
1702 >     * <p>If this CompletableFuture completes exceptionally,
1703 >     * then the returned CompletableFuture also does so, with a
1704 >     * CompletionException holding this exception as its cause.
1705       *
1706       * @param block the action to perform before completing the
1707       * returned CompletableFuture
# Line 1704 | Line 1712 | public class CompletableFuture<T> implem
1712      }
1713  
1714      /**
1715 <     * Returns a new CompletableFuture that is asynchronously
1716 <     * completed using the given executor with this
1717 <     * CompletableFuture's result when it completes.  If this
1718 <     * CompletableFuture completes exceptionally, then the returned
1719 <     * CompletableFuture also does so, with a CompletionException holding
1720 <     * this exception as its cause.
1715 >     * Returns a new CompletableFuture that is asynchronously completed
1716 >     * when this CompletableFuture completes, after performing the given
1717 >     * action with this CompletableFuture's result from a task running
1718 >     * in the given executor.
1719 >     *
1720 >     * <p>If this CompletableFuture completes exceptionally,
1721 >     * then the returned CompletableFuture also does so, with a
1722 >     * CompletionException holding this exception as its cause.
1723       *
1724       * @param block the action to perform before completing the
1725       * returned CompletableFuture
# Line 1766 | Line 1776 | public class CompletableFuture<T> implem
1776      }
1777  
1778      /**
1779 <     * Returns a new CompletableFuture that is completed after
1780 <     * performing the given action when this CompletableFuture
1781 <     * completes.  If this CompletableFuture completes exceptionally,
1779 >     * Returns a new CompletableFuture that is completed
1780 >     * when this CompletableFuture completes, after performing the given
1781 >     * action.
1782 >     *
1783 >     * <p>If this CompletableFuture completes exceptionally,
1784       * then the returned CompletableFuture also does so, with a
1785       * CompletionException holding this exception as its cause.
1786       *
# Line 1781 | Line 1793 | public class CompletableFuture<T> implem
1793      }
1794  
1795      /**
1796 <     * Returns a new CompletableFuture that is asynchronously
1797 <     * completed using the {@link ForkJoinPool#commonPool()} after
1798 <     * performing the given action when this CompletableFuture
1799 <     * completes.  If this CompletableFuture completes exceptionally,
1796 >     * Returns a new CompletableFuture that is asynchronously completed
1797 >     * when this CompletableFuture completes, after performing the given
1798 >     * action from a task running in the {@link ForkJoinPool#commonPool()}.
1799 >     *
1800 >     * <p>If this CompletableFuture completes exceptionally,
1801       * then the returned CompletableFuture also does so, with a
1802       * CompletionException holding this exception as its cause.
1803       *
# Line 1797 | Line 1810 | public class CompletableFuture<T> implem
1810      }
1811  
1812      /**
1813 <     * Returns a new CompletableFuture that is asynchronously
1814 <     * completed using the given executor after performing the given
1815 <     * action when this CompletableFuture completes.  If this
1816 <     * CompletableFuture completes exceptionally, then the returned
1817 <     * CompletableFuture also does so, with a CompletionException holding
1818 <     * this exception as its cause.
1813 >     * Returns a new CompletableFuture that is asynchronously completed
1814 >     * when this CompletableFuture completes, after performing the given
1815 >     * action from a task running in the given executor.
1816 >     *
1817 >     * <p>If this CompletableFuture completes exceptionally,
1818 >     * then the returned CompletableFuture also does so, with a
1819 >     * CompletionException holding this exception as its cause.
1820       *
1821       * @param action the action to perform before completing the
1822       * returned CompletableFuture
# Line 1854 | Line 1868 | public class CompletableFuture<T> implem
1868      }
1869  
1870      /**
1871 <     * Returns a new CompletableFuture that is completed with
1872 <     * the result of the given function of this and the other given
1873 <     * CompletableFuture's results when both complete.  If this or
1874 <     * the other CompletableFuture complete exceptionally, then the
1875 <     * returned CompletableFuture also does so, with a
1871 >     * Returns a new CompletableFuture that is completed
1872 >     * when both this and the other given CompletableFuture complete,
1873 >     * with the result of the given function of the results of the two
1874 >     * CompletableFutures.
1875 >     *
1876 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
1877 >     * then the returned CompletableFuture also does so, with a
1878       * CompletionException holding the exception as its cause.
1879       *
1880       * @param other the other CompletableFuture
# Line 1873 | Line 1889 | public class CompletableFuture<T> implem
1889      }
1890  
1891      /**
1892 <     * Returns a new CompletableFuture that is asynchronously
1893 <     * completed using the {@link ForkJoinPool#commonPool()} with
1894 <     * the result of the given function of this and the other given
1895 <     * CompletableFuture's results when both complete.  If this or
1896 <     * the other CompletableFuture complete exceptionally, then the
1897 <     * returned CompletableFuture also does so, with a
1892 >     * Returns a new CompletableFuture that is asynchronously completed
1893 >     * when both this and the other given CompletableFuture complete,
1894 >     * with the result of the given function of the results of the two
1895 >     * CompletableFutures, called from a task running in the
1896 >     * {@link ForkJoinPool#commonPool()}.
1897 >     *
1898 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
1899 >     * then the returned CompletableFuture also does so, with a
1900       * CompletionException holding the exception as its cause.
1901       *
1902       * @param other the other CompletableFuture
# Line 1893 | Line 1911 | public class CompletableFuture<T> implem
1911      }
1912  
1913      /**
1914 <     * Returns a new CompletableFuture that is
1915 <     * asynchronously completed using the given executor with the
1916 <     * result of the given function of this and the other given
1917 <     * CompletableFuture's results when both complete.  If this or
1918 <     * the other CompletableFuture complete exceptionally, then the
1919 <     * returned CompletableFuture also does so, with a
1914 >     * Returns a new CompletableFuture that is asynchronously completed
1915 >     * when both this and the other given CompletableFuture complete,
1916 >     * with the result of the given function of the results of the two
1917 >     * CompletableFutures, called from a task running in the
1918 >     * given executor.
1919 >     *
1920 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
1921 >     * then the returned CompletableFuture also does so, with a
1922       * CompletionException holding the exception as its cause.
1923       *
1924       * @param other the other CompletableFuture
# Line 1984 | Line 2004 | public class CompletableFuture<T> implem
2004      }
2005  
2006      /**
2007 <     * Returns a new CompletableFuture that is completed with
2008 <     * the results of this and the other given CompletableFuture if
2009 <     * both complete.  If this and/or the other CompletableFuture
2010 <     * complete exceptionally, then the returned CompletableFuture
2011 <     * also does so, with a CompletionException holding one of these
2012 <     * exceptions as its cause.
2007 >     * Returns a new CompletableFuture that is completed
2008 >     * when both this and the other given CompletableFuture complete,
2009 >     * after performing the given action with the results of the two
2010 >     * CompletableFutures.
2011 >     *
2012 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2013 >     * then the returned CompletableFuture also does so, with a
2014 >     * CompletionException holding one of these exceptions as its cause.
2015       *
2016       * @param other the other CompletableFuture
2017       * @param block the action to perform before completing the
# Line 2003 | Line 2025 | public class CompletableFuture<T> implem
2025      }
2026  
2027      /**
2028 <     * Returns a new CompletableFuture that is completed
2029 <     * asynchronously using the {@link ForkJoinPool#commonPool()} with
2030 <     * the results of this and the other given CompletableFuture when
2031 <     * both complete.  If this and/or the other CompletableFuture
2032 <     * complete exceptionally, then the returned CompletableFuture
2033 <     * also does so, with a CompletionException holding one of these
2034 <     * exceptions as its cause.
2028 >     * Returns a new CompletableFuture that is asynchronously completed
2029 >     * when both this and the other given CompletableFuture complete,
2030 >     * after performing the given action with the results of the two
2031 >     * CompletableFutures from a task running in the {@link
2032 >     * ForkJoinPool#commonPool()}.
2033 >     *
2034 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2035 >     * then the returned CompletableFuture also does so, with a
2036 >     * CompletionException holding one of these exceptions as its cause.
2037       *
2038       * @param other the other CompletableFuture
2039       * @param block the action to perform before completing the
# Line 2023 | Line 2047 | public class CompletableFuture<T> implem
2047      }
2048  
2049      /**
2050 <     * Returns a new CompletableFuture that is completed
2051 <     * asynchronously using the given executor with the results of
2052 <     * this and the other given CompletableFuture when both complete.
2053 <     * If this and/or the other CompletableFuture complete exceptionally,
2050 >     * Returns a new CompletableFuture that is asynchronously completed
2051 >     * when both this and the other given CompletableFuture complete,
2052 >     * after performing the given action with the results of the two
2053 >     * CompletableFutures from a task running in the given executor.
2054 >     *
2055 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2056       * then the returned CompletableFuture also does so, with a
2057       * CompletionException holding one of these exceptions as its cause.
2058       *
# Line 2112 | Line 2138 | public class CompletableFuture<T> implem
2138      }
2139  
2140      /**
2141 <     * Returns a new CompletableFuture that is completed when
2142 <     * this and the other given CompletableFuture both complete.
2143 <     * If this and/or the other CompletableFuture complete exceptionally,
2141 >     * Returns a new CompletableFuture that is completed
2142 >     * when both this and the other given CompletableFuture complete,
2143 >     * after performing the given action.
2144 >     *
2145 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2146       * then the returned CompletableFuture also does so, with a
2147       * CompletionException holding one of these exceptions as its cause.
2148       *
# Line 2129 | Line 2157 | public class CompletableFuture<T> implem
2157      }
2158  
2159      /**
2160 <     * Returns a new CompletableFuture that is completed
2161 <     * asynchronously using the {@link ForkJoinPool#commonPool()}
2162 <     * when this and the other given CompletableFuture both complete.
2163 <     * If this and/or the other CompletableFuture complete exceptionally,
2160 >     * Returns a new CompletableFuture that is asynchronously completed
2161 >     * when both this and the other given CompletableFuture complete,
2162 >     * after performing the given action from a task running in the
2163 >     * {@link ForkJoinPool#commonPool()}.
2164 >     *
2165 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2166       * then the returned CompletableFuture also does so, with a
2167       * CompletionException holding one of these exceptions as its cause.
2168       *
# Line 2147 | Line 2177 | public class CompletableFuture<T> implem
2177      }
2178  
2179      /**
2180 <     * Returns a new CompletableFuture that is completed
2181 <     * asynchronously using the given executor when this and the
2182 <     * other given CompletableFuture both complete.
2183 <     * If this and/or the other CompletableFuture complete exceptionally,
2180 >     * Returns a new CompletableFuture that is asynchronously completed
2181 >     * when both this and the other given CompletableFuture complete,
2182 >     * after performing the given action from a task running in the
2183 >     * given executor.
2184 >     *
2185 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2186       * then the returned CompletableFuture also does so, with a
2187       * CompletionException holding one of these exceptions as its cause.
2188       *
# Line 2221 | Line 2253 | public class CompletableFuture<T> implem
2253      }
2254  
2255      /**
2256 <     * Returns a new CompletableFuture that is completed with
2257 <     * the result of the given function of either this or the other
2258 <     * given CompletableFuture's results when either complete.
2259 <     * If this and/or the other CompletableFuture complete exceptionally,
2256 >     * Returns a new CompletableFuture that is completed
2257 >     * when either this or the other given CompletableFuture completes,
2258 >     * with the result of the given function of either this or the other
2259 >     * CompletableFuture's result.
2260 >     *
2261 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2262       * then the returned CompletableFuture may also do so, with a
2263       * CompletionException holding one of these exceptions as its cause.
2264 <     * No guarantees are made about which result or exception is used
2265 <     * in the returned CompletableFuture.
2264 >     * No guarantees are made about which result or exception is used in
2265 >     * the returned CompletableFuture.
2266       *
2267       * @param other the other CompletableFuture
2268       * @param fn the function to use to compute the value of
# Line 2242 | Line 2276 | public class CompletableFuture<T> implem
2276      }
2277  
2278      /**
2279 <     * Returns a new CompletableFuture that is completed
2280 <     * asynchronously using the {@link ForkJoinPool#commonPool()} with
2281 <     * the result of the given function of either this or the other
2282 <     * given CompletableFuture's results when either complete.
2283 <     * If this and/or the other CompletableFuture complete exceptionally,
2279 >     * Returns a new CompletableFuture that is asynchronously completed
2280 >     * when either this or the other given CompletableFuture completes,
2281 >     * with the result of the given function of either this or the other
2282 >     * CompletableFuture's result, called from a task running in the
2283 >     * {@link ForkJoinPool#commonPool()}.
2284 >     *
2285 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2286       * then the returned CompletableFuture may also do so, with a
2287       * CompletionException holding one of these exceptions as its cause.
2288 <     * No guarantees are made about which result or exception is used
2289 <     * in the returned CompletableFuture.
2288 >     * No guarantees are made about which result or exception is used in
2289 >     * the returned CompletableFuture.
2290       *
2291       * @param other the other CompletableFuture
2292       * @param fn the function to use to compute the value of
# Line 2264 | Line 2300 | public class CompletableFuture<T> implem
2300      }
2301  
2302      /**
2303 <     * Returns a new CompletableFuture that is completed
2304 <     * asynchronously using the given executor with the result of the
2305 <     * given function of either this or the other given
2306 <     * CompletableFuture's results when either complete.  If this
2307 <     * and/or the other CompletableFuture complete exceptionally, then
2308 <     * the returned CompletableFuture may also do so, with a
2303 >     * Returns a new CompletableFuture that is asynchronously completed
2304 >     * when either this or the other given CompletableFuture completes,
2305 >     * with the result of the given function of either this or the other
2306 >     * CompletableFuture's result, called from a task running in the
2307 >     * given executor.
2308 >     *
2309 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2310 >     * then the returned CompletableFuture may also do so, with a
2311       * CompletionException holding one of these exceptions as its cause.
2312 <     * No guarantees are made about which result or exception is used
2313 <     * in the returned CompletableFuture.
2312 >     * No guarantees are made about which result or exception is used in
2313 >     * the returned CompletableFuture.
2314       *
2315       * @param other the other CompletableFuture
2316       * @param fn the function to use to compute the value of
# Line 2341 | Line 2379 | public class CompletableFuture<T> implem
2379      }
2380  
2381      /**
2382 <     * Returns a new CompletableFuture that is completed after
2383 <     * performing the given action with the result of either this or the
2384 <     * other given CompletableFuture's result, when either complete.
2385 <     * If this and/or the other CompletableFuture complete exceptionally,
2382 >     * Returns a new CompletableFuture that is completed
2383 >     * when either this or the other given CompletableFuture completes,
2384 >     * after performing the given action with the result of either this
2385 >     * or the other CompletableFuture's result.
2386 >     *
2387 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2388       * then the returned CompletableFuture may also do so, with a
2389       * CompletionException holding one of these exceptions as its cause.
2390 <     * No guarantees are made about which exception is used in the
2391 <     * returned CompletableFuture.
2390 >     * No guarantees are made about which result or exception is used in
2391 >     * the returned CompletableFuture.
2392       *
2393       * @param other the other CompletableFuture
2394       * @param block the action to perform before completing the
# Line 2362 | Line 2402 | public class CompletableFuture<T> implem
2402      }
2403  
2404      /**
2405 <     * Returns a new CompletableFuture that is completed
2406 <     * asynchronously using the {@link ForkJoinPool#commonPool()},
2407 <     * performing the given action with the result of either this or
2408 <     * the other given CompletableFuture's result, when either complete.
2409 <     * If this and/or the other CompletableFuture complete exceptionally,
2405 >     * Returns a new CompletableFuture that is asynchronously completed
2406 >     * when either this or the other given CompletableFuture completes,
2407 >     * after performing the given action with the result of either this
2408 >     * or the other CompletableFuture's result from a task running in
2409 >     * the {@link ForkJoinPool#commonPool()}.
2410 >     *
2411 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2412       * then the returned CompletableFuture may also do so, with a
2413       * CompletionException holding one of these exceptions as its cause.
2414 <     * No guarantees are made about which exception is used in the
2415 <     * returned CompletableFuture.
2414 >     * No guarantees are made about which result or exception is used in
2415 >     * the returned CompletableFuture.
2416       *
2417       * @param other the other CompletableFuture
2418       * @param block the action to perform before completing the
# Line 2384 | Line 2426 | public class CompletableFuture<T> implem
2426      }
2427  
2428      /**
2429 <     * Returns a new CompletableFuture that is completed
2430 <     * asynchronously using the given executor, performing the given
2431 <     * action with the result of either this or the other given
2432 <     * CompletableFuture's result, when either complete.
2433 <     * If this and/or the other CompletableFuture complete exceptionally,
2429 >     * Returns a new CompletableFuture that is asynchronously completed
2430 >     * when either this or the other given CompletableFuture completes,
2431 >     * after performing the given action with the result of either this
2432 >     * or the other CompletableFuture's result from a task running in
2433 >     * the given executor.
2434 >     *
2435 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2436       * then the returned CompletableFuture may also do so, with a
2437       * CompletionException holding one of these exceptions as its cause.
2438 <     * No guarantees are made about which exception is used in the
2439 <     * returned CompletableFuture.
2438 >     * No guarantees are made about which result or exception is used in
2439 >     * the returned CompletableFuture.
2440       *
2441       * @param other the other CompletableFuture
2442       * @param block the action to perform before completing the
# Line 2461 | Line 2505 | public class CompletableFuture<T> implem
2505  
2506      /**
2507       * Returns a new CompletableFuture that is completed
2508 <     * after this or the other given CompletableFuture complete.
2509 <     * If this and/or the other CompletableFuture complete exceptionally,
2508 >     * when either this or the other given CompletableFuture completes,
2509 >     * after performing the given action.
2510 >     *
2511 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2512       * then the returned CompletableFuture may also do so, with a
2513       * CompletionException holding one of these exceptions as its cause.
2514 <     * No guarantees are made about which exception is used in the
2515 <     * returned CompletableFuture.
2514 >     * No guarantees are made about which result or exception is used in
2515 >     * the returned CompletableFuture.
2516       *
2517       * @param other the other CompletableFuture
2518       * @param action the action to perform before completing the
# Line 2479 | Line 2525 | public class CompletableFuture<T> implem
2525      }
2526  
2527      /**
2528 <     * Returns a new CompletableFuture that is completed
2529 <     * asynchronously using the {@link ForkJoinPool#commonPool()}
2530 <     * after this or the other given CompletableFuture complete.
2531 <     * If this and/or the other CompletableFuture complete exceptionally,
2528 >     * Returns a new CompletableFuture that is asynchronously completed
2529 >     * when either this or the other given CompletableFuture completes,
2530 >     * after performing the given action from a task running in the
2531 >     * {@link ForkJoinPool#commonPool()}.
2532 >     *
2533 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2534       * then the returned CompletableFuture may also do so, with a
2535       * CompletionException holding one of these exceptions as its cause.
2536 <     * No guarantees are made about which exception is used in the
2537 <     * returned CompletableFuture.
2536 >     * No guarantees are made about which result or exception is used in
2537 >     * the returned CompletableFuture.
2538       *
2539       * @param other the other CompletableFuture
2540       * @param action the action to perform before completing the
# Line 2500 | Line 2548 | public class CompletableFuture<T> implem
2548      }
2549  
2550      /**
2551 <     * Returns a new CompletableFuture that is completed
2552 <     * asynchronously using the given executor after this or the other
2553 <     * given CompletableFuture complete.
2554 <     * If this and/or the other CompletableFuture complete exceptionally,
2551 >     * Returns a new CompletableFuture that is asynchronously completed
2552 >     * when either this or the other given CompletableFuture completes,
2553 >     * after performing the given action from a task running in the
2554 >     * given executor.
2555 >     *
2556 >     * <p>If this and/or the other CompletableFuture complete exceptionally,
2557       * then the returned CompletableFuture may also do so, with a
2558       * CompletionException holding one of these exceptions as its cause.
2559 <     * No guarantees are made about which exception is used in the
2560 <     * returned CompletableFuture.
2559 >     * No guarantees are made about which result or exception is used in
2560 >     * the returned CompletableFuture.
2561       *
2562       * @param other the other CompletableFuture
2563       * @param action the action to perform before completing the
# Line 2569 | Line 2619 | public class CompletableFuture<T> implem
2619      }
2620  
2621      /**
2622 <     * Returns a CompletableFuture (or an equivalent one) produced by
2623 <     * the given function of the result of this CompletableFuture when
2624 <     * completed.  If this CompletableFuture completes exceptionally,
2622 >     * Returns a CompletableFuture (or an equivalent one) produced by the
2623 >     * given function of the result of this CompletableFuture when completed.
2624 >     *
2625 >     * <p>If this CompletableFuture completes exceptionally,
2626       * then the returned CompletableFuture also does so, with a
2627       * CompletionException holding this exception as its cause.
2628       *
# Line 2589 | Line 2640 | public class CompletableFuture<T> implem
2640       * Returns a CompletableFuture (or an equivalent one) produced
2641       * asynchronously using the {@link ForkJoinPool#commonPool()} by
2642       * the given function of the result of this CompletableFuture when
2643 <     * completed.  If this CompletableFuture completes exceptionally,
2643 >     * completed.
2644 >     *
2645 >     * <p>If this CompletableFuture completes exceptionally,
2646       * then the returned CompletableFuture also does so, with a
2647       * CompletionException holding this exception as its cause.
2648       *
# Line 2607 | Line 2660 | public class CompletableFuture<T> implem
2660       * Returns a CompletableFuture (or an equivalent one) produced
2661       * asynchronously using the given executor by the given function
2662       * of the result of this CompletableFuture when completed.
2663 <     * If this CompletableFuture completes exceptionally, then the
2664 <     * returned CompletableFuture also does so, with a
2663 >     *
2664 >     * <p>If this CompletableFuture completes exceptionally,
2665 >     * then the returned CompletableFuture also does so, with a
2666       * CompletionException holding this exception as its cause.
2667       *
2668       * @param fn the function returning a new CompletableFuture
# Line 2678 | Line 2732 | public class CompletableFuture<T> implem
2732      }
2733  
2734      /**
2735 <     * Returns a new CompletableFuture that is completed with
2736 <     * the result of the given function of the exception triggering
2737 <     * this CompletableFuture's completion when it completes
2738 <     * exceptionally; Otherwise, if this CompletableFuture completes
2739 <     * normally, then the returned CompletableFuture also completes
2740 <     * normally with the same value.
2735 >     * Returns a new CompletableFuture that is completed when this
2736 >     * CompletableFuture completes, with the result of the given
2737 >     * function of the exception triggering this CompletableFuture's
2738 >     * completion when it completes exceptionally; otherwise, if this
2739 >     * CompletableFuture completes normally, then the returned
2740 >     * CompletableFuture also completes normally with the same value.
2741       *
2742       * @param fn the function to use to compute the value of the
2743       * returned CompletableFuture if this CompletableFuture completed
# Line 2727 | Line 2781 | public class CompletableFuture<T> implem
2781      }
2782  
2783      /**
2784 <     * Returns a new CompletableFuture that is completed with
2785 <     * the result of the given function of the result and exception of
2786 <     * this CompletableFuture's completion when it completes.  The
2787 <     * given function is invoked with the result (or {@code null} if
2788 <     * none) and the exception (or {@code null} if none) of this
2789 <     * CompletableFuture when complete.
2784 >     * Returns a new CompletableFuture that is completed when this
2785 >     * CompletableFuture completes, with the result of the given
2786 >     * function of the result and exception of this CompletableFuture's
2787 >     * completion.  The given function is invoked with the result (or
2788 >     * {@code null} if none) and the exception (or {@code null} if none)
2789 >     * of this CompletableFuture when complete.
2790       *
2791       * @param fn the function to use to compute the value of the
2792       * returned CompletableFuture
# Line 2790 | Line 2844 | public class CompletableFuture<T> implem
2844  
2845      /**
2846       * Returns a new CompletableFuture that is completed when all of
2847 <     * the given CompletableFutures complete.  If any of the component
2847 >     * the given CompletableFutures complete.  If any of the given
2848       * CompletableFutures complete exceptionally, then so does the
2849       * returned CompletableFuture. Otherwise, the results, if any, of
2850 <     * the component CompletableFutures are not reflected in the
2851 <     * returned CompletableFuture, but may be obtained by inspecting
2852 <     * them individually. If the number of components is zero, returns
2853 <     * a CompletableFuture completed with the value {@code null}.
2850 >     * the given CompletableFutures are not reflected in the returned
2851 >     * CompletableFuture, but may be obtained by inspecting them
2852 >     * individually. If no CompletableFutures are provided, returns a
2853 >     * CompletableFuture completed with the value {@code null}.
2854       *
2855       * <p>Among the applications of this method is to await completion
2856       * of a set of independent CompletableFutures before continuing a
# Line 2890 | Line 2944 | public class CompletableFuture<T> implem
2944  
2945      /**
2946       * Returns a new CompletableFuture that is completed when any of
2947 <     * the component CompletableFutures complete; with the same result if
2948 <     * it completed normally, otherwise exceptionally. If the number
2949 <     * of components is zero, returns an incomplete CompletableFuture.
2947 >     * the given CompletableFutures complete; with the same result if
2948 >     * it completed normally, otherwise exceptionally. If no
2949 >     * CompletableFutures are provided, returns an incomplete
2950 >     * CompletableFuture.
2951       *
2952       * @param cfs the CompletableFutures
2953       * @return a new CompletableFuture that is completed when any of the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines