On Thu, 8 May 2025 13:53:31 GMT, kabutz <d...@openjdk.org> wrote:

>> src/java.base/share/classes/java/util/concurrent/LinkedBlockingDeque.java 
>> line 860:
>> 
>>> 858:             // As historically specified in AbstractQueue#addAll
>>> 859:             throw new IllegalArgumentException();
>>> 860: 
>> 
>> We could likely check if there's any remaining capacity up front, and 
>> immediately return false?
>
>> We could likely check if there's any remaining capacity up front, and 
>> immediately return false?
> 
> We could if you like. I wanted to make as few changes as possible, to not 
> introduce unexpected changes. This particular bug was to stop a size overflow.

@DougLea What do you think about checking if the target collection is likely 
going to fit into the queue early?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24925#discussion_r2135371406

Reply via email to