@Test(expected = NullPointerException.class) public void executingNullShouldFail() { executor.execute(null); }
@Override public void execute(Runnable task) { Preconditions.checkNotNull(task, "'task' must not be null."); if (!executing) { executing = true; try { task.run(); } catch (Throwable t) { log.log(Level.SEVERE, "Exception while executing runnable " + task, t); } finally { if (taskQueue != null) { completeQueuedTasks(); } executing = false; } } else { enqueue(task); } }
SerializeReentrantCallsDirectExecutor implements Executor { @Override public void execute(Runnable task) { Preconditions.checkNotNull(task, "'task' must not be null."); if (!executing) { executing = true; try { task.run(); } catch (Throwable t) { log.log(Level.SEVERE, "Exception while executing runnable " + task, t); } finally { if (taskQueue != null) { completeQueuedTasks(); } executing = false; } } else { enqueue(task); } } }
SerializeReentrantCallsDirectExecutor implements Executor { @Override public void execute(Runnable task) { Preconditions.checkNotNull(task, "'task' must not be null."); if (!executing) { executing = true; try { task.run(); } catch (Throwable t) { log.log(Level.SEVERE, "Exception while executing runnable " + task, t); } finally { if (taskQueue != null) { completeQueuedTasks(); } executing = false; } } else { enqueue(task); } }  }
SerializeReentrantCallsDirectExecutor implements Executor { @Override public void execute(Runnable task) { Preconditions.checkNotNull(task, "'task' must not be null."); if (!executing) { executing = true; try { task.run(); } catch (Throwable t) { log.log(Level.SEVERE, "Exception while executing runnable " + task, t); } finally { if (taskQueue != null) { completeQueuedTasks(); } executing = false; } } else { enqueue(task); } }  @Override void execute(Runnable task); }
SerializeReentrantCallsDirectExecutor implements Executor { @Override public void execute(Runnable task) { Preconditions.checkNotNull(task, "'task' must not be null."); if (!executing) { executing = true; try { task.run(); } catch (Throwable t) { log.log(Level.SEVERE, "Exception while executing runnable " + task, t); } finally { if (taskQueue != null) { completeQueuedTasks(); } executing = false; } } else { enqueue(task); } }  @Override void execute(Runnable task);  }