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.128 by jsr166, Sun Nov 15 00:37:50 2015 UTC vs.
Revision 1.145 by jsr166, Mon Apr 11 06:23:38 2016 UTC

# Line 876 | Line 876 | public class CompletableFutureTest exten
876          assertEquals(1, a.get());
877      }}
878  
879 +    /**
880 +     * If an "exceptionally action" throws an exception, it completes
881 +     * exceptionally with that exception
882 +     */
883      public void testExceptionally_exceptionalCompletionActionFailed() {
884          for (boolean createIncomplete : new boolean[] { true, false })
885      {
# Line 894 | Line 898 | public class CompletableFutureTest exten
898          if (createIncomplete) f.completeExceptionally(ex1);
899  
900          checkCompletedWithWrappedException(g, ex2);
901 +        checkCompletedExceptionally(f, ex1);
902          assertEquals(1, a.get());
903      }}
904  
# Line 911 | Line 916 | public class CompletableFutureTest exten
916          if (!createIncomplete) assertTrue(f.complete(v1));
917          final CompletableFuture<Integer> g = m.whenComplete
918              (f,
919 <             (Integer x, Throwable t) -> {
919 >             (Integer result, Throwable t) -> {
920                  m.checkExecutionMode();
921 <                threadAssertSame(x, v1);
921 >                threadAssertSame(result, v1);
922                  threadAssertNull(t);
923                  a.getAndIncrement();
924              });
# Line 938 | Line 943 | public class CompletableFutureTest exten
943          if (!createIncomplete) f.completeExceptionally(ex);
944          final CompletableFuture<Integer> g = m.whenComplete
945              (f,
946 <             (Integer x, Throwable t) -> {
946 >             (Integer result, Throwable t) -> {
947                  m.checkExecutionMode();
948 <                threadAssertNull(x);
948 >                threadAssertNull(result);
949                  threadAssertSame(t, ex);
950                  a.getAndIncrement();
951              });
# Line 965 | Line 970 | public class CompletableFutureTest exten
970          if (!createIncomplete) assertTrue(f.cancel(mayInterruptIfRunning));
971          final CompletableFuture<Integer> g = m.whenComplete
972              (f,
973 <             (Integer x, Throwable t) -> {
973 >             (Integer result, Throwable t) -> {
974                  m.checkExecutionMode();
975 <                threadAssertNull(x);
975 >                threadAssertNull(result);
976                  threadAssertTrue(t instanceof CancellationException);
977                  a.getAndIncrement();
978              });
# Line 982 | Line 987 | public class CompletableFutureTest exten
987       * If a whenComplete action throws an exception when triggered by
988       * a normal completion, it completes exceptionally
989       */
990 <    public void testWhenComplete_actionFailed() {
990 >    public void testWhenComplete_sourceCompletedNormallyActionFailed() {
991          for (boolean createIncomplete : new boolean[] { true, false })
992          for (ExecutionMode m : ExecutionMode.values())
993          for (Integer v1 : new Integer[] { 1, null })
# Line 993 | Line 998 | public class CompletableFutureTest exten
998          if (!createIncomplete) assertTrue(f.complete(v1));
999          final CompletableFuture<Integer> g = m.whenComplete
1000              (f,
1001 <             (Integer x, Throwable t) -> {
1001 >             (Integer result, Throwable t) -> {
1002                  m.checkExecutionMode();
1003 <                threadAssertSame(x, v1);
1003 >                threadAssertSame(result, v1);
1004                  threadAssertNull(t);
1005                  a.getAndIncrement();
1006                  throw ex;
# Line 1010 | Line 1015 | public class CompletableFutureTest exten
1015      /**
1016       * If a whenComplete action throws an exception when triggered by
1017       * a source completion that also throws an exception, the source
1018 <     * exception takes precedence.
1018 >     * exception takes precedence (unlike handle)
1019       */
1020 <    public void testWhenComplete_actionFailedSourceFailed() {
1020 >    public void testWhenComplete_sourceFailedActionFailed() {
1021          for (boolean createIncomplete : new boolean[] { true, false })
1022          for (ExecutionMode m : ExecutionMode.values())
1023      {
# Line 1024 | Line 1029 | public class CompletableFutureTest exten
1029          if (!createIncomplete) f.completeExceptionally(ex1);
1030          final CompletableFuture<Integer> g = m.whenComplete
1031              (f,
1032 <             (Integer x, Throwable t) -> {
1032 >             (Integer result, Throwable t) -> {
1033                  m.checkExecutionMode();
1034                  threadAssertSame(t, ex1);
1035 <                threadAssertNull(x);
1035 >                threadAssertNull(result);
1036                  a.getAndIncrement();
1037                  throw ex2;
1038              });
# Line 1035 | Line 1040 | public class CompletableFutureTest exten
1040  
1041          checkCompletedWithWrappedException(g, ex1);
1042          checkCompletedExceptionally(f, ex1);
1043 +        if (testImplementationDetails) {
1044 +            assertEquals(1, ex1.getSuppressed().length);
1045 +            assertSame(ex2, ex1.getSuppressed()[0]);
1046 +        }
1047          assertEquals(1, a.get());
1048      }}
1049  
# Line 1052 | Line 1061 | public class CompletableFutureTest exten
1061          if (!createIncomplete) assertTrue(f.complete(v1));
1062          final CompletableFuture<Integer> g = m.handle
1063              (f,
1064 <             (Integer x, Throwable t) -> {
1064 >             (Integer result, Throwable t) -> {
1065                  m.checkExecutionMode();
1066 <                threadAssertSame(x, v1);
1066 >                threadAssertSame(result, v1);
1067                  threadAssertNull(t);
1068                  a.getAndIncrement();
1069                  return inc(v1);
# Line 1081 | Line 1090 | public class CompletableFutureTest exten
1090          if (!createIncomplete) f.completeExceptionally(ex);
1091          final CompletableFuture<Integer> g = m.handle
1092              (f,
1093 <             (Integer x, Throwable t) -> {
1093 >             (Integer result, Throwable t) -> {
1094                  m.checkExecutionMode();
1095 <                threadAssertNull(x);
1095 >                threadAssertNull(result);
1096                  threadAssertSame(t, ex);
1097                  a.getAndIncrement();
1098                  return v1;
# Line 1110 | Line 1119 | public class CompletableFutureTest exten
1119          if (!createIncomplete) assertTrue(f.cancel(mayInterruptIfRunning));
1120          final CompletableFuture<Integer> g = m.handle
1121              (f,
1122 <             (Integer x, Throwable t) -> {
1122 >             (Integer result, Throwable t) -> {
1123                  m.checkExecutionMode();
1124 <                threadAssertNull(x);
1124 >                threadAssertNull(result);
1125                  threadAssertTrue(t instanceof CancellationException);
1126                  a.getAndIncrement();
1127                  return v1;
# Line 1125 | Line 1134 | public class CompletableFutureTest exten
1134      }}
1135  
1136      /**
1137 <     * handle result completes exceptionally if action does
1137 >     * If a "handle action" throws an exception when triggered by
1138 >     * a normal completion, it completes exceptionally
1139       */
1140 <    public void testHandle_sourceFailedActionFailed() {
1140 >    public void testHandle_sourceCompletedNormallyActionFailed() {
1141          for (ExecutionMode m : ExecutionMode.values())
1142          for (boolean createIncomplete : new boolean[] { true, false })
1143 +        for (Integer v1 : new Integer[] { 1, null })
1144      {
1145          final CompletableFuture<Integer> f = new CompletableFuture<>();
1146          final AtomicInteger a = new AtomicInteger(0);
1147 <        final CFException ex1 = new CFException();
1148 <        final CFException ex2 = new CFException();
1138 <        if (!createIncomplete) f.completeExceptionally(ex1);
1147 >        final CFException ex = new CFException();
1148 >        if (!createIncomplete) assertTrue(f.complete(v1));
1149          final CompletableFuture<Integer> g = m.handle
1150              (f,
1151 <             (Integer x, Throwable t) -> {
1151 >             (Integer result, Throwable t) -> {
1152                  m.checkExecutionMode();
1153 <                threadAssertNull(x);
1154 <                threadAssertSame(ex1, t);
1153 >                threadAssertSame(result, v1);
1154 >                threadAssertNull(t);
1155                  a.getAndIncrement();
1156 <                throw ex2;
1156 >                throw ex;
1157              });
1158 <        if (createIncomplete) f.completeExceptionally(ex1);
1158 >        if (createIncomplete) assertTrue(f.complete(v1));
1159  
1160 <        checkCompletedWithWrappedException(g, ex2);
1161 <        checkCompletedExceptionally(f, ex1);
1160 >        checkCompletedWithWrappedException(g, ex);
1161 >        checkCompletedNormally(f, v1);
1162          assertEquals(1, a.get());
1163      }}
1164  
1165 <    public void testHandle_sourceCompletedNormallyActionFailed() {
1166 <        for (ExecutionMode m : ExecutionMode.values())
1165 >    /**
1166 >     * If a "handle action" throws an exception when triggered by
1167 >     * a source completion that also throws an exception, the action
1168 >     * exception takes precedence (unlike whenComplete)
1169 >     */
1170 >    public void testHandle_sourceFailedActionFailed() {
1171          for (boolean createIncomplete : new boolean[] { true, false })
1172 <        for (Integer v1 : new Integer[] { 1, null })
1172 >        for (ExecutionMode m : ExecutionMode.values())
1173      {
1160        final CompletableFuture<Integer> f = new CompletableFuture<>();
1174          final AtomicInteger a = new AtomicInteger(0);
1175 <        final CFException ex = new CFException();
1176 <        if (!createIncomplete) assertTrue(f.complete(v1));
1175 >        final CFException ex1 = new CFException();
1176 >        final CFException ex2 = new CFException();
1177 >        final CompletableFuture<Integer> f = new CompletableFuture<>();
1178 >
1179 >        if (!createIncomplete) f.completeExceptionally(ex1);
1180          final CompletableFuture<Integer> g = m.handle
1181              (f,
1182 <             (Integer x, Throwable t) -> {
1182 >             (Integer result, Throwable t) -> {
1183                  m.checkExecutionMode();
1184 <                threadAssertSame(x, v1);
1185 <                threadAssertNull(t);
1184 >                threadAssertNull(result);
1185 >                threadAssertSame(ex1, t);
1186                  a.getAndIncrement();
1187 <                throw ex;
1187 >                throw ex2;
1188              });
1189 <        if (createIncomplete) assertTrue(f.complete(v1));
1189 >        if (createIncomplete) f.completeExceptionally(ex1);
1190  
1191 <        checkCompletedWithWrappedException(g, ex);
1192 <        checkCompletedNormally(f, v1);
1191 >        checkCompletedWithWrappedException(g, ex2);
1192 >        checkCompletedExceptionally(f, ex1);
1193          assertEquals(1, a.get());
1194      }}
1195  
# Line 3279 | Line 3295 | public class CompletableFutureTest exten
3295              () -> f.obtrudeException(null),
3296  
3297              () -> CompletableFuture.delayedExecutor(1L, SECONDS, null),
3298 <            () -> CompletableFuture.delayedExecutor(1L, null, new ThreadExecutor()),
3298 >            () -> CompletableFuture.delayedExecutor(1L, null, exec),
3299              () -> CompletableFuture.delayedExecutor(1L, null),
3300  
3301              () -> f.orTimeout(1L, null),
# Line 3509 | Line 3525 | public class CompletableFutureTest exten
3525          long timeoutMillis = timeoutMillis();
3526          CompletableFuture<Integer> f = new CompletableFuture<>();
3527          long startTime = System.nanoTime();
3528 <        f.orTimeout(timeoutMillis, MILLISECONDS);
3528 >        assertSame(f, f.orTimeout(timeoutMillis, MILLISECONDS));
3529          checkCompletedWithTimeoutException(f);
3530          assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
3531      }
# Line 3524 | Line 3540 | public class CompletableFutureTest exten
3540          CompletableFuture<Integer> g = new CompletableFuture<>();
3541          long startTime = System.nanoTime();
3542          f.complete(v1);
3543 <        f.orTimeout(LONG_DELAY_MS, MILLISECONDS);
3544 <        g.orTimeout(LONG_DELAY_MS, MILLISECONDS);
3543 >        assertSame(f, f.orTimeout(LONG_DELAY_MS, MILLISECONDS));
3544 >        assertSame(g, g.orTimeout(LONG_DELAY_MS, MILLISECONDS));
3545          g.complete(v1);
3546          checkCompletedNormally(f, v1);
3547          checkCompletedNormally(g, v1);
# Line 3544 | Line 3560 | public class CompletableFutureTest exten
3560          long timeoutMillis = timeoutMillis();
3561          CompletableFuture<Integer> f = new CompletableFuture<>();
3562          long startTime = System.nanoTime();
3563 <        f.completeOnTimeout(v, timeoutMillis, MILLISECONDS);
3563 >        assertSame(f, f.completeOnTimeout(v, timeoutMillis, MILLISECONDS));
3564          assertSame(v, f.join());
3565          assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
3566          f.complete(99);         // should have no effect
# Line 3561 | Line 3577 | public class CompletableFutureTest exten
3577          CompletableFuture<Integer> g = new CompletableFuture<>();
3578          long startTime = System.nanoTime();
3579          f.complete(v1);
3580 <        f.completeOnTimeout(-1, LONG_DELAY_MS, MILLISECONDS);
3581 <        g.completeOnTimeout(-1, LONG_DELAY_MS, MILLISECONDS);
3580 >        assertSame(f, f.completeOnTimeout(-1, LONG_DELAY_MS, MILLISECONDS));
3581 >        assertSame(g, g.completeOnTimeout(-1, LONG_DELAY_MS, MILLISECONDS));
3582          g.complete(v1);
3583          checkCompletedNormally(f, v1);
3584          checkCompletedNormally(g, v1);
# Line 3644 | Line 3660 | public class CompletableFutureTest exten
3660          funs.add((y) -> m.thenAcceptBoth(y, v42, new SubtractAction(m)));
3661          funs.add((y) -> m.thenCombine(y, v42, new SubtractFunction(m)));
3662  
3663 <        funs.add((y) -> m.whenComplete(y, (Integer x, Throwable t) -> {}));
3663 >        funs.add((y) -> m.whenComplete(y, (Integer r, Throwable t) -> {}));
3664  
3665          funs.add((y) -> m.thenCompose(y, new CompletableFutureInc(m)));
3666  
# Line 3764 | Line 3780 | public class CompletableFutureTest exten
3780      }
3781  
3782      static class Monad {
3783 <        static class MonadError extends Error {
3784 <            public MonadError() { super("monadic zero"); }
3783 >        static class ZeroException extends RuntimeException {
3784 >            public ZeroException() { super("monadic zero"); }
3785          }
3786          // "return", "unit"
3787          static <T> CompletableFuture<T> unit(T value) {
3788              return completedFuture(value);
3789          }
3790          // monadic zero ?
3791 <        static <T> CompletableFuture<T> zero(T value) {
3792 <            return failedFuture(new MonadError());
3791 >        static <T> CompletableFuture<T> zero() {
3792 >            return failedFuture(new ZeroException());
3793          }
3794          // >=>
3795          static <T,U,V> Function<T, CompletableFuture<V>> compose
# Line 3787 | Line 3803 | public class CompletableFutureTest exten
3803                  f.getNow(null);
3804                  throw new AssertionFailedError("should throw");
3805              } catch (CompletionException success) {
3806 <                assertTrue(success.getCause() instanceof MonadError);
3806 >                assertTrue(success.getCause() instanceof ZeroException);
3807              }
3808          }
3809  
# Line 3814 | Line 3830 | public class CompletableFutureTest exten
3830              AtomicReference<Throwable> firstFailure = new AtomicReference<>(null);
3831          }
3832  
3833 <        // Monadic "plus"
3833 >        /** Implements "monadic plus". */
3834          static <T> CompletableFuture<T> plus(CompletableFuture<? extends T> f,
3835                                               CompletableFuture<? extends T> g) {
3836              PlusFuture<T> plus = new PlusFuture<T>();
3837 <            BiConsumer<T, Throwable> action = (T result, Throwable fail) -> {
3838 <                if (result != null) {
3839 <                    if (plus.complete(result))
3840 <                        if (plus.firstFailure.get() != null)
3837 >            BiConsumer<T, Throwable> action = (T result, Throwable ex) -> {
3838 >                try {
3839 >                    if (ex == null) {
3840 >                        if (plus.complete(result))
3841 >                            if (plus.firstFailure.get() != null)
3842 >                                plus.firstFailure.set(null);
3843 >                    }
3844 >                    else if (plus.firstFailure.compareAndSet(null, ex)) {
3845 >                        if (plus.isDone())
3846                              plus.firstFailure.set(null);
3847 <                }
3848 <                else if (plus.firstFailure.compareAndSet(null, fail)) {
3849 <                    if (plus.isDone())
3850 <                        plus.firstFailure.set(null);
3851 <                } else {
3852 <                    if (plus.completeExceptionally(fail))
3853 <                        plus.firstFailure.set(null);
3847 >                    }
3848 >                    else {
3849 >                        // first failure has precedence
3850 >                        Throwable first = plus.firstFailure.getAndSet(null);
3851 >
3852 >                        // may fail with "Self-suppression not permitted"
3853 >                        try { first.addSuppressed(ex); }
3854 >                        catch (Exception ignored) {}
3855 >
3856 >                        plus.completeExceptionally(first);
3857 >                    }
3858 >                } catch (Throwable unexpected) {
3859 >                    plus.completeExceptionally(unexpected);
3860                  }
3861              };
3862              f.whenComplete(action);
# Line 3843 | Line 3870 | public class CompletableFutureTest exten
3870       * https://en.wikipedia.org/wiki/Monad_(functional_programming)#Additive_monads
3871       */
3872      public void testAdditiveMonad() throws Throwable {
3873 +        Function<Long, CompletableFuture<Long>> unit = Monad::unit;
3874 +        CompletableFuture<Long> zero = Monad.zero();
3875 +
3876          // Some mutually non-commutative functions
3877          Function<Long, CompletableFuture<Long>> triple
3878 <            = (x) -> completedFuture(3 * x);
3878 >            = (x) -> Monad.unit(3 * x);
3879          Function<Long, CompletableFuture<Long>> inc
3880 <            = (x) -> completedFuture(x + 1);
3851 <
3852 <        Function<Long, CompletableFuture<Long>> unit = Monad::unit;
3853 <        Function<Long, CompletableFuture<Long>> zero = Monad::zero;
3880 >            = (x) -> Monad.unit(x + 1);
3881  
3882          // unit is a right identity: m >>= unit === m
3883 <        Monad.assertFutureEquals(
3884 <            inc.apply(5L).thenCompose(unit),
3858 <            inc.apply(5L));
3883 >        Monad.assertFutureEquals(inc.apply(5L).thenCompose(unit),
3884 >                                 inc.apply(5L));
3885          // unit is a left identity: (unit x) >>= f === f x
3886 <        Monad.assertFutureEquals(
3887 <            unit.apply(5L).thenCompose(inc),
3888 <            inc.apply(5L));
3886 >        Monad.assertFutureEquals(unit.apply(5L).thenCompose(inc),
3887 >                                 inc.apply(5L));
3888 >
3889          // associativity: (m >>= f) >>= g === m >>= ( \x -> (f x >>= g) )
3890          Monad.assertFutureEquals(
3891              unit.apply(5L).thenCompose(inc).thenCompose(triple),
3892              unit.apply(5L).thenCompose((x) -> inc.apply(x).thenCompose(triple)));
3893  
3894 +        // The case for CompletableFuture as an additive monad is weaker...
3895 +
3896          // zero is a monadic zero
3897 <        Monad.assertZero(zero.apply(5L));
3870 <        // left zero: zero >>= f === zero
3871 <        Monad.assertZero(zero.apply(5L).thenCompose(inc));
3872 <        // right zero: f >>= zero === zero
3873 <        Monad.assertZero(inc.apply(5L).thenCompose(zero));
3897 >        Monad.assertZero(zero);
3898  
3899 <        // inc plus zero === inc
3900 <        Monad.assertFutureEquals(
3901 <            inc.apply(5L),
3902 <            Monad.plus(inc.apply(5L), zero.apply(5L)));
3903 <        // zero plus inc === inc
3904 <        Monad.assertFutureEquals(
3905 <            inc.apply(5L),
3906 <            Monad.plus(zero.apply(5L), inc.apply(5L)));
3899 >        // left zero: zero >>= f === zero
3900 >        Monad.assertZero(zero.thenCompose(inc));
3901 >        // right zero: f >>= (\x -> zero) === zero
3902 >        Monad.assertZero(inc.apply(5L).thenCompose((x) -> zero));
3903 >
3904 >        // f plus zero === f
3905 >        Monad.assertFutureEquals(Monad.unit(5L),
3906 >                                 Monad.plus(Monad.unit(5L), zero));
3907 >        // zero plus f === f
3908 >        Monad.assertFutureEquals(Monad.unit(5L),
3909 >                                 Monad.plus(zero, Monad.unit(5L)));
3910          // zero plus zero === zero
3911 <        Monad.assertZero(Monad.plus(zero.apply(5L), zero.apply(5L)));
3911 >        Monad.assertZero(Monad.plus(zero, zero));
3912          {
3913 <            CompletableFuture<Long> f = Monad.plus(inc.apply(5L), inc.apply(8L));
3914 <            assertTrue(f.get() == 6L || f.get() == 9L);
3913 >            CompletableFuture<Long> f = Monad.plus(Monad.unit(5L),
3914 >                                                   Monad.unit(8L));
3915 >            // non-determinism
3916 >            assertTrue(f.get() == 5L || f.get() == 8L);
3917          }
3918  
3919          CompletableFuture<Long> godot = new CompletableFuture<>();
3920 <        // inc plus godot === inc (doesn't wait for godot)
3921 <        Monad.assertFutureEquals(
3922 <            inc.apply(5L),
3923 <            Monad.plus(inc.apply(5L), godot));
3924 <        // godot plus inc === inc (doesn't wait for godot)
3925 <        Monad.assertFutureEquals(
3926 <            inc.apply(5L),
3927 <            Monad.plus(godot, inc.apply(5L)));
3920 >        // f plus godot === f (doesn't wait for godot)
3921 >        Monad.assertFutureEquals(Monad.unit(5L),
3922 >                                 Monad.plus(Monad.unit(5L), godot));
3923 >        // godot plus f === f (doesn't wait for godot)
3924 >        Monad.assertFutureEquals(Monad.unit(5L),
3925 >                                 Monad.plus(godot, Monad.unit(5L)));
3926 >    }
3927 >
3928 >    /**
3929 >     * A single CompletableFuture with many dependents.
3930 >     * A demo of scalability - runtime is O(n).
3931 >     */
3932 >    public void testManyDependents() throws Throwable {
3933 >        final int n = 1_000;
3934 >        final CompletableFuture<Void> head = new CompletableFuture<>();
3935 >        final CompletableFuture<Void> complete = CompletableFuture.completedFuture((Void)null);
3936 >        final AtomicInteger count = new AtomicInteger(0);
3937 >        for (int i = 0; i < n; i++) {
3938 >            head.thenRun(() -> count.getAndIncrement());
3939 >            head.thenAccept((x) -> count.getAndIncrement());
3940 >            head.thenApply((x) -> count.getAndIncrement());
3941 >
3942 >            head.runAfterBoth(complete, () -> count.getAndIncrement());
3943 >            head.thenAcceptBoth(complete, (x, y) -> count.getAndIncrement());
3944 >            head.thenCombine(complete, (x, y) -> count.getAndIncrement());
3945 >            complete.runAfterBoth(head, () -> count.getAndIncrement());
3946 >            complete.thenAcceptBoth(head, (x, y) -> count.getAndIncrement());
3947 >            complete.thenCombine(head, (x, y) -> count.getAndIncrement());
3948 >
3949 >            head.runAfterEither(new CompletableFuture<Void>(), () -> count.getAndIncrement());
3950 >            head.acceptEither(new CompletableFuture<Void>(), (x) -> count.getAndIncrement());
3951 >            head.applyToEither(new CompletableFuture<Void>(), (x) -> count.getAndIncrement());
3952 >            new CompletableFuture<Void>().runAfterEither(head, () -> count.getAndIncrement());
3953 >            new CompletableFuture<Void>().acceptEither(head, (x) -> count.getAndIncrement());
3954 >            new CompletableFuture<Void>().applyToEither(head, (x) -> count.getAndIncrement());
3955 >        }
3956 >        head.complete(null);
3957 >        assertEquals(5 * 3 * n, count.get());
3958      }
3959  
3960   //     static <U> U join(CompletionStage<U> stage) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines