# | Line 161 | Line 161 | public class FutureTask<V> implements Ru | |
---|---|---|
161 | */ | |
162 | public V get(long timeout, TimeUnit unit) | |
163 | throws InterruptedException, ExecutionException, TimeoutException { | |
164 | < | long nanos = unit.toNanos(timeout); |
164 | > | if (unit == null) |
165 | > | throw new NullPointerException(); |
166 | int s = state; | |
167 | if (s <= COMPLETING && | |
168 | < | (s = awaitDone(true, nanos)) <= COMPLETING) |
168 | > | (s = awaitDone(true, unit.toNanos(timeout))) <= COMPLETING) |
169 | throw new TimeoutException(); | |
170 | return report(s); | |
171 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |