(final Runnable f)
| 622 | } |
| 623 | |
| 624 | @Override |
| 625 | public final Future<T> ensure(final Runnable f) { |
| 626 | if (getInterruptHandler() != null) |
| 627 | return continuation(new Ensure<T>(f) { |
| 628 | @Override |
| 629 | protected final InterruptHandler getInterruptHandler() { |
| 630 | return Promise.this; |
| 631 | } |
| 632 | }); |
| 633 | else |
| 634 | return continuation(new Ensure<T>(f)); |
| 635 | } |
| 636 | |
| 637 | private static class OnSuccess<T> extends Continuation<T, T> { |
| 638 | private final Consumer<? super T> c; |
no test coverage detected