/** * Submits a task to the executor service without further handling. * The original {@link ExecutorService#submit(java.lang.Runnable)} method actually expects this return value * to be handled, but this method explicitly relies on the external logic to handle the future operation. * Use on your own risk. * @param es Executor service * @param runnable Operation to be executed * @throws ExecutionRejectedException Execution is rejected by the executor service */ @Nonnull @SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE", justification = "User of this API explicitly submits the task in the async mode on his own risk") public static void submitAsync(@Nonnull ExecutorService es, @Nonnull Runnable runnable) throws ExecutionRejectedException { try { es.submit(runnable); } catch (RejectedExecutionException ex) { // Rethrow and make API users handle this. throw new ExecutionRejectedException(runnable, es, ex); } }