New methods in PriorityQueue

Roger Riggs roger.riggs at oracle.com
Thu Mar 3 18:18:38 UTC 2022


Hi Julian,

Modifying the priorities of elements in the PriorityQueue violates the
invariants of the PriorityQueue established at insertion and maintained
at removal by the Comparator.

To maintain the invariant the element should be removed, its priority 
modified,
and re-inserted.

An API to manually manipulate the order is inconsistent with the design 
of PriorityQueue.

Regards, Roger


On 3/3/22 6:59 AM, Jules W. wrote:
> Hi all,
>
> A new PR that adds methods to PriorityQueue was created some time ago at
> https://github.com/openjdk/jdk/pull/6938 but has no corresponding issue. As
> I'm not too familiar with this part of the JDK I'm querying this mailing
> list for anyone to properly review the PR before I create an issue for it
> in the JBS
>
> best regards,
> Julian Waters



More information about the core-libs-dev mailing list