On Fri, 14 Aug 2026 07:31:59 GMT, Prasanta Sadhukhan <[email protected]> wrote:
> Calling `UIManager.getDefaults().keySet().contains(key)` and > `UIManager.getDefaults().containsKey(key)` produce different results. > This is a regression from > [JDK-8146330](https://github.com/openjdk/jdk/commit/1e217e7b8bc9bea5e1214c93e5ccb198418a4aa3), > > where it fixed keys() vs keySet() size mismatch by overriding only` > MultiUIDefaults.keySet()` > but MultiUIDefaults combines defaults from several places: > > - its own local defaults > > - defaults supplied by the active Look and Feel > > After JDK-8146330, `keySet() `was changed to list keys from all those places. > So it can see a key such as "TabbedPane.isTabRollover" supplied by the Look > and Feel. > But `containsKey()` was not changed. It still only looks in the object’s own > local defaults, not the Look-and-Feel defaults > > Adding containsKey() to MultiUIDefaults makes it search the same combined set > of defaults as keySet() > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). This pull request has now been integrated. Changeset: 3ef007ac Author: Prasanta Sadhukhan <[email protected]> URL: https://git.openjdk.org/jdk/commit/3ef007ac237627d08631a582713751b1accd72e4 Stats: 106 lines in 2 files changed: 105 ins; 0 del; 1 mod 8390296: Swing MultiUIDefaults#containsKey inconsistancy Reviewed-by: azvegint, kizune ------------- PR: https://git.openjdk.org/jdk/pull/32368
