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