Are there any circumstances under which ThreadPoolExecutor.CallerRunsPolicy will raise a RejectedExecutionException ?
It seems to me that the policy itself is designed to prevent the release of these Exceptions. The API for its RejectedExecutionHandler.rejectedExecution () interface method claims that it can throw a RejectedExecutionException . The API for CallerRunsPolicy.rejectedExecution () does not work.
RejectedExecutionException
Summary: Do I need to explicitly handle a RejectedExecutionException on execute() if I use CallerRunsPolicy ?
execute()
CallerRunsPolicy
No no. ThreadPoolExecutor.CallerRunsPolicy will never throw a RejectedExecutionException unless you explicitly throw it under Runnable#run
Runnable#run