327 |
|
*/ |
328 |
|
static Object encodeRelay(Object r) { |
329 |
|
Throwable x; |
330 |
< |
return (((r instanceof AltResult) && |
331 |
< |
(x = ((AltResult)r).ex) != null && |
332 |
< |
!(x instanceof CompletionException)) ? |
333 |
< |
new AltResult(new CompletionException(x)) : r); |
330 |
> |
if (r instanceof AltResult |
331 |
> |
&& (x = ((AltResult)r).ex) != null |
332 |
> |
&& !(x instanceof CompletionException)) |
333 |
> |
r = new AltResult(new CompletionException(x)); |
334 |
> |
return r; |
335 |
|
} |
336 |
|
|
337 |
|
/** |
2016 |
|
@SuppressWarnings("unchecked") |
2017 |
|
public T get() throws InterruptedException, ExecutionException { |
2018 |
|
Object r; |
2019 |
< |
return (T) reportGet((r = result) == null ? waitingGet(true) : r); |
2019 |
> |
if ((r = result) == null) |
2020 |
> |
r = waitingGet(true); |
2021 |
> |
return (T) reportGet(r); |
2022 |
|
} |
2023 |
|
|
2024 |
|
/** |
2037 |
|
@SuppressWarnings("unchecked") |
2038 |
|
public T get(long timeout, TimeUnit unit) |
2039 |
|
throws InterruptedException, ExecutionException, TimeoutException { |
2037 |
– |
Object r; |
2040 |
|
long nanos = unit.toNanos(timeout); |
2041 |
< |
return (T) reportGet((r = result) == null ? timedGet(nanos) : r); |
2041 |
> |
Object r; |
2042 |
> |
if ((r = result) == null) |
2043 |
> |
r = timedGet(nanos); |
2044 |
> |
return (T) reportGet(r); |
2045 |
|
} |
2046 |
|
|
2047 |
|
/** |
2061 |
|
@SuppressWarnings("unchecked") |
2062 |
|
public T join() { |
2063 |
|
Object r; |
2064 |
< |
return (T) reportJoin((r = result) == null ? waitingGet(false) : r); |
2064 |
> |
if ((r = result) == null) |
2065 |
> |
r = waitingGet(false); |
2066 |
> |
return (T) reportJoin(r); |
2067 |
|
} |
2068 |
|
|
2069 |
|
/** |