RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]
Michael Strauß
mstrauss at openjdk.org
Wed Oct 19 22:24:00 UTC 2022
On Wed, 19 Oct 2022 20:37:34 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
> Thank you. You do bring a good point - clearing the map. There is some mild language warning about clearing the map in javadoc already, but perhaps `Node.getProperties().clear()` should be forbidden (throw an IOE?).
A map can also be cleared with `Map.keySet().clear()`, or by enumerating its keys and removing each mapping one by one.
I don't think we can make the `getProperties()` map mutable, but at the same time safe to store final objects, while still respecting the `Map` contract.
Maybe we could have something like "hidden" keys, which are not enumerable and are never cleared by bulk operations.
-------------
PR: https://git.openjdk.org/jfx/pull/830
More information about the openjfx-dev
mailing list