1031 |
|
Object r, s; Throwable x; |
1032 |
|
if ((r = result) == null) |
1033 |
|
unipush(new UniComposeExceptionally<T>(e, d, this, f)); |
1034 |
< |
else if (e == null) { |
1035 |
< |
if ((r instanceof AltResult) && (x = ((AltResult)r).ex) != null) { |
1036 |
< |
try { |
1034 |
> |
else if (!(r instanceof AltResult) || (x = ((AltResult)r).ex) == null) |
1035 |
> |
d.internalComplete(r); |
1036 |
> |
else |
1037 |
> |
try { |
1038 |
> |
if (e != null) |
1039 |
> |
e.execute(new UniComposeExceptionally<T>(null, d, this, f)); |
1040 |
> |
else { |
1041 |
|
CompletableFuture<T> g = f.apply(x).toCompletableFuture(); |
1042 |
|
if ((s = g.result) != null) |
1043 |
|
d.result = encodeRelay(s); |
1044 |
< |
else { |
1044 |
> |
else |
1045 |
|
g.unipush(new UniRelay<T,T>(d, g)); |
1042 |
– |
} |
1043 |
– |
} catch (Throwable ex) { |
1044 |
– |
d.result = encodeThrowable(ex); |
1046 |
|
} |
1046 |
– |
} |
1047 |
– |
else |
1048 |
– |
d.internalComplete(r); |
1049 |
– |
} |
1050 |
– |
else |
1051 |
– |
try { |
1052 |
– |
e.execute(new UniComposeExceptionally<T>(null, d, this, f)); |
1047 |
|
} catch (Throwable ex) { |
1048 |
|
d.result = encodeThrowable(ex); |
1049 |
|
} |
1138 |
|
Object r, s; Throwable x; |
1139 |
|
if ((r = result) == null) |
1140 |
|
unipush(new UniCompose<T,V>(e, d, this, f)); |
1141 |
< |
else if (e == null) { |
1141 |
> |
else { |
1142 |
|
if (r instanceof AltResult) { |
1143 |
|
if ((x = ((AltResult)r).ex) != null) { |
1144 |
|
d.result = encodeThrowable(x, r); |
1147 |
|
r = null; |
1148 |
|
} |
1149 |
|
try { |
1150 |
< |
@SuppressWarnings("unchecked") T t = (T) r; |
1151 |
< |
CompletableFuture<V> g = f.apply(t).toCompletableFuture(); |
1158 |
< |
if ((s = g.result) != null) |
1159 |
< |
d.result = encodeRelay(s); |
1150 |
> |
if (e != null) |
1151 |
> |
e.execute(new UniCompose<T,V>(null, d, this, f)); |
1152 |
|
else { |
1153 |
< |
g.unipush(new UniRelay<V,V>(d, g)); |
1153 |
> |
@SuppressWarnings("unchecked") T t = (T) r; |
1154 |
> |
CompletableFuture<V> g = f.apply(t).toCompletableFuture(); |
1155 |
> |
if ((s = g.result) != null) |
1156 |
> |
d.result = encodeRelay(s); |
1157 |
> |
else |
1158 |
> |
g.unipush(new UniRelay<V,V>(d, g)); |
1159 |
|
} |
1160 |
|
} catch (Throwable ex) { |
1161 |
|
d.result = encodeThrowable(ex); |
1162 |
|
} |
1163 |
|
} |
1167 |
– |
else |
1168 |
– |
try { |
1169 |
– |
e.execute(new UniCompose<T,V>(null, d, this, f)); |
1170 |
– |
} catch (Throwable ex) { |
1171 |
– |
d.result = encodeThrowable(ex); |
1172 |
– |
} |
1164 |
|
return d; |
1165 |
|
} |
1166 |
|
|