On 12/15/2016 01:17 PM, Stefan Zobel wrote:

I recently noticed that javac creates a synthetic class and a bridge constructor
for SubmissionPublisher.ThreadPerTaskExecutor because its generated constructor
is private. I don't know if it really matters but that could be avoided by
declaring a package-private constructor that does nothing.

Or, more simply remove the unnecessary "private" qualifier for the
nested ThreadPerTaskExecutor class, as we did in the similar usage in
CompletableFuture, and should have remembered to do here.
Done; thanks.

-Doug




   /** Fallback if ForkJoinPool.commonPool() cannot support parallelism */
   private static final class ThreadPerTaskExecutor implements Executor {
       // avoid creation of synthetic class and bridge constructor
       ThreadPerTaskExecutor() {}
       public void execute(Runnable r) { new Thread(r).start(); }
   }


Regards,
Stefan


Reply via email to