File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
tracing/src/main/java/com/palantir/tracing Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change 2424import java .util .concurrent .Callable ;
2525import java .util .concurrent .ExecutionException ;
2626import java .util .concurrent .ExecutorService ;
27- import java .util .concurrent .Executors ;
2827import java .util .concurrent .Future ;
2928import java .util .concurrent .TimeUnit ;
3029import java .util .concurrent .TimeoutException ;
@@ -51,27 +50,14 @@ protected WrappingExecutorService(ExecutorService delegate) {
5150 }
5251
5352 /**
54- * Wraps a {@code Callable} for submission to the underlying executor. This method is also applied to any
55- * {@code Runnable} passed to the default implementation of {@link #wrapTask(Runnable)}.
53+ * Wraps a {@code Callable} for submission to the underlying executor.
5654 */
5755 protected abstract <T > Callable <T > wrapTask (Callable <T > callable );
5856
5957 /**
60- * Wraps a {@code Runnable} for submission to the underlying executor. The default implementation delegates to
61- * {@link #wrapTask(Callable)}.
58+ * Wraps a {@code Runnable} for submission to the underlying executor.
6259 */
63- protected Runnable wrapTask (Runnable command ) {
64- final Callable <Object > wrapped = wrapTask (Executors .callable (command , null ));
65- return () -> {
66- try {
67- wrapped .call ();
68- } catch (RuntimeException | Error e ) {
69- throw e ;
70- } catch (Exception e ) {
71- throw new RuntimeException (e );
72- }
73- };
74- }
60+ protected abstract Runnable wrapTask (Runnable command );
7561
7662 /**
7763 * Wraps a collection of tasks.
You can’t perform that action at this time.
0 commit comments