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).

Marked as reviewed by azvegint (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/32368#pullrequestreview-4936078153

Reply via email to