guava/src/com/google/common/util/concurrent/Uninterruptibles.java
@CanIgnoreReturnValue
  public static <V> V getUninterruptibly(Future<V> future) throws ExecutionException {
    boolean interrupted = false;
    try {
      while (true) {
        try {
          return future.get();
        } catch (InterruptedException e) {
          interrupted = true;
        }
      }
    } finally {
      if (interrupted) {
        Thread.currentThread().interrupt();
      }
    }
  }
@CanIgnoreReturnValue
  public static <V> V getUninterruptibly(Future<V> future) throws ExecutionException {
    boolean interrupted = false;
    try {
      while (true) {
        try {
          return future.get();
        } catch (InterruptedException e) {
          interrupted = true;
        }
      }
    } finally {
      if (interrupted) {
        Thread.currentThread().interrupt();
      }
    }
  }
@ CanIgnoreReturnValue public static < V > V getUninterruptibly ( Future < V > future ) throws ExecutionException { boolean interrupted = false ; try { while ( true ) { try { return future . get ( ) ; } catch ( InterruptedException e ) { interrupted = true ; } } } finally { if ( interrupted ) { Thread . currentThread ( ) . interrupt ( ) ; } } }
Invokes {@code future.}{@link Future#get() get()} uninterruptibly.

<p>Similar methods:

<ul>
<li>To retrieve a result from a {@code Future} that is already done, use {@link
Futures#getDone Futures.getDone}.
<li>To treat {@link InterruptedException} uniformly with other exceptions, use {@link
Futures#getChecked(Future, Class) Futures.getChecked}.
<li>To get uninterruptibility and remove checked exceptions, use {@link
Futures#getUnchecked}.
</ul>

@throws ExecutionException if the computation threw an exception
@throws CancellationException if the computation was cancelled
Invokes { @code future . } { @link Future#get () get () } uninterruptibly .