I want to report a bug.

Michael Kuhlmann jdk at fiolino.de
Tue Feb 13 07:49:32 UTC 2024


Hi unknown submitter,

it's not a bug in JDK, it's a bug in your code.

On 2/13/24 03:53, Freedom Dev wrote:
>                  final Builder<Object> builder = Stream.builder();
> 
>                  list.parallelStream().forEach(builder::accept);

The result of Stream.builder() is not thread safe (as builders in 
general rarely are). You cannot use it in a parallel stream.

-Michael



More information about the jdk-dev mailing list