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

Reply via email to