@Override public T get() throws InterruptedException, ExecutionException { return getResolvedValue(); }
@java.lang.SuppressWarnings("all") T getResolvedValue() { java.lang.Object value = this.resolvedValue.get(); if (value == null) { synchronized (this.resolvedValue) { value = this.resolvedValue.get(); if (value == null) { final T actualValue = resolve(); value = actualValue == null ? this.resolvedValue : actualValue; this.resolvedValue.set(value); } } } return (T) (value == this.resolvedValue ? null : value); }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { try { return Timeouts.getWithTimeout((int) timeout, unit, this::get); } catch (org.rnorth.ducttape.TimeoutException e) { throw new TimeoutException(e.getMessage()); } }