On Thu, 11 Jun 2026 07:15:35 GMT, Viktor Klang <[email protected]> wrote:

>> Liam Miller-Cushon has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Update copyright year, remove author name
>
> src/java.base/share/classes/java/util/PriorityQueue.java line 227:
> 
>> 225:      */
>> 226:     public PriorityQueue(Collection<? extends E> c,
>> 227:                          Comparator<? super E> comparator) {
> 
> What if `c` is a PriorityQueue and `comparator` is its Comparator?

I added fast paths for PriorityQueue and SortedSet if the explicit comparator 
is the same as their comparators

> test/jdk/java/util/concurrent/tck/PriorityQueueTest.java line 201:
> 
>> 199:             mustEqual(q1.poll(), q2.poll());
>> 200:     }
>> 201: 
> 
> No tests to verify behavior or `null` collection or `null` comparator?

I added more tests

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31452#discussion_r3394582302
PR Review Comment: https://git.openjdk.org/jdk/pull/31452#discussion_r3394583327

Reply via email to