RFR: jsr166 jdk9 integration wave 13

Doug Lea dl at cs.oswego.edu
Fri Dec 16 13:14:50 UTC 2016

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.


>>    /** 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

More information about the core-libs-dev mailing list