|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2023 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -143,11 +143,6 @@ public final Executor getConcurrentExecutor() {
|
143 | 143 | * execution callback (which may be a wrapper around the user-supplied task).
|
144 | 144 | * <p>The primary use case is to set some execution context around the task's
|
145 | 145 | * invocation, or to provide some monitoring/statistics for task execution.
|
146 |
| - * <p><b>NOTE:</b> Exception handling in {@code TaskDecorator} implementations |
147 |
| - * is limited to plain {@code Runnable} execution via {@code execute} calls. |
148 |
| - * In case of {@code #submit} calls, the exposed {@code Runnable} will be a |
149 |
| - * {@code FutureTask} which does not propagate any exceptions; you might |
150 |
| - * have to cast it and call {@code Future#get} to evaluate exceptions. |
151 | 146 | * @since 4.3
|
152 | 147 | */
|
153 | 148 | public final void setTaskDecorator(TaskDecorator taskDecorator) {
|
@@ -188,11 +183,10 @@ public <T> ListenableFuture<T> submitListenable(Callable<T> task) {
|
188 | 183 | }
|
189 | 184 |
|
190 | 185 |
|
191 |
| - private TaskExecutorAdapter getAdaptedExecutor(Executor concurrentExecutor) { |
192 |
| - if (managedExecutorServiceClass != null && managedExecutorServiceClass.isInstance(concurrentExecutor)) { |
193 |
| - return new ManagedTaskExecutorAdapter(concurrentExecutor); |
194 |
| - } |
195 |
| - TaskExecutorAdapter adapter = new TaskExecutorAdapter(concurrentExecutor); |
| 186 | + private TaskExecutorAdapter getAdaptedExecutor(Executor originalExecutor) { |
| 187 | + TaskExecutorAdapter adapter = |
| 188 | + (managedExecutorServiceClass != null && managedExecutorServiceClass.isInstance(originalExecutor) ? |
| 189 | + new ManagedTaskExecutorAdapter(originalExecutor) : new TaskExecutorAdapter(originalExecutor)); |
196 | 190 | if (this.taskDecorator != null) {
|
197 | 191 | adapter.setTaskDecorator(this.taskDecorator);
|
198 | 192 | }
|
|
0 commit comments