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

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

Commit messages:
 - 8390296: Swing MultiUIDefaults#containsKey inconsistancy

Changes: https://git.openjdk.org/jdk/pull/32368/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=32368&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8390296
  Stats: 106 lines in 2 files changed: 105 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/32368.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32368/head:pull/32368

PR: https://git.openjdk.org/jdk/pull/32368

Reply via email to