|
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.
|
@@ -134,11 +134,6 @@ public final Executor getConcurrentExecutor() {
|
134 | 134 | * execution callback (which may be a wrapper around the user-supplied task).
|
135 | 135 | * <p>The primary use case is to set some execution context around the task's
|
136 | 136 | * invocation, or to provide some monitoring/statistics for task execution.
|
137 |
| - * <p><b>NOTE:</b> Exception handling in {@code TaskDecorator} implementations |
138 |
| - * is limited to plain {@code Runnable} execution via {@code execute} calls. |
139 |
| - * In case of {@code #submit} calls, the exposed {@code Runnable} will be a |
140 |
| - * {@code FutureTask} which does not propagate any exceptions; you might |
141 |
| - * have to cast it and call {@code Future#get} to evaluate exceptions. |
142 | 137 | * @since 4.3
|
143 | 138 | */
|
144 | 139 | public final void setTaskDecorator(TaskDecorator taskDecorator) {
|
@@ -179,11 +174,10 @@ public <T> ListenableFuture<T> submitListenable(Callable<T> task) {
|
179 | 174 | }
|
180 | 175 |
|
181 | 176 |
|
182 |
| - private TaskExecutorAdapter getAdaptedExecutor(Executor concurrentExecutor) { |
183 |
| - if (managedExecutorServiceClass != null && managedExecutorServiceClass.isInstance(concurrentExecutor)) { |
184 |
| - return new ManagedTaskExecutorAdapter(concurrentExecutor); |
185 |
| - } |
186 |
| - TaskExecutorAdapter adapter = new TaskExecutorAdapter(concurrentExecutor); |
| 177 | + private TaskExecutorAdapter getAdaptedExecutor(Executor originalExecutor) { |
| 178 | + TaskExecutorAdapter adapter = |
| 179 | + (managedExecutorServiceClass != null && managedExecutorServiceClass.isInstance(originalExecutor) ? |
| 180 | + new ManagedTaskExecutorAdapter(originalExecutor) : new TaskExecutorAdapter(originalExecutor)); |
187 | 181 | if (this.taskDecorator != null) {
|
188 | 182 | adapter.setTaskDecorator(this.taskDecorator);
|
189 | 183 | }
|
|
0 commit comments