aboutsummaryrefslogtreecommitdiff
path: root/android/guava/src/com/google/common/util/concurrent/ExecutionList.java
diff options
context:
space:
mode:
Diffstat (limited to 'android/guava/src/com/google/common/util/concurrent/ExecutionList.java')
-rw-r--r--android/guava/src/com/google/common/util/concurrent/ExecutionList.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/android/guava/src/com/google/common/util/concurrent/ExecutionList.java b/android/guava/src/com/google/common/util/concurrent/ExecutionList.java
index 645817c4a..10b933aa1 100644
--- a/android/guava/src/com/google/common/util/concurrent/ExecutionList.java
+++ b/android/guava/src/com/google/common/util/concurrent/ExecutionList.java
@@ -21,7 +21,6 @@ import com.google.common.annotations.J2ktIncompatible;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import java.util.concurrent.Executor;
import java.util.logging.Level;
-import java.util.logging.Logger;
import javax.annotation.CheckForNull;
/**
@@ -45,7 +44,7 @@ import javax.annotation.CheckForNull;
@ElementTypesAreNonnullByDefault
public final class ExecutionList {
/** Logger to log exceptions caught when running runnables. */
- private static final Logger log = Logger.getLogger(ExecutionList.class.getName());
+ private static final LazyLogger log = new LazyLogger(ExecutionList.class);
/**
* The runnable, executor pairs to execute. This acts as a stack threaded through the {@link
@@ -140,17 +139,22 @@ public final class ExecutionList {
* Submits the given runnable to the given {@link Executor} catching and logging all {@linkplain
* RuntimeException runtime exceptions} thrown by the executor.
*/
+ @SuppressWarnings("CatchingUnchecked") // sneaky checked exception
private static void executeListener(Runnable runnable, Executor executor) {
try {
executor.execute(runnable);
- } catch (RuntimeException e) {
+ } catch (Exception e) { // sneaky checked exception
// Log it and keep going -- bad runnable and/or executor. Don't punish the other runnables if
// we're given a bad one. We only catch RuntimeException because we want Errors to propagate
// up.
- log.log(
- Level.SEVERE,
- "RuntimeException while executing runnable " + runnable + " with executor " + executor,
- e);
+ log.get()
+ .log(
+ Level.SEVERE,
+ "RuntimeException while executing runnable "
+ + runnable
+ + " with executor "
+ + executor,
+ e);
}
}