Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This noncompliant code example consists of the PoolService class that encapsulates a thread pool and a runnable Task class. The Task.run() method can throw runtime exceptions, such as NullPointerException.

...

Wiki Markup
The {{ExecutorService.submit()}} method can be used to submit a task to a thread pool instead of the {{execute()}} method to obtain a {{Future}} object.  Note that the uncaught exception handler is not called if {{ExecutorService.submit()}} is invoked. This is because the thrown exception is considered to be part of the return status and is consequently wrapped in an {{ExecutionException}} and re-thrown by {{Future.get()}} \[[Goetz 2006|AA. Bibliography#Goetz 06]\].

...