RFR: 6513512: MetalLookAndFeel.initClassDefaults does not install an entry for MetalMenuBarUI [v5]

Prasanta Sadhukhan psadhukhan at openjdk.org
Wed Feb 8 04:03:42 UTC 2023


On Wed, 8 Feb 2023 02:19:52 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> We can initialize it as suggested but then we should somehow exclude the code path in it for the old "basic/DefaultMetalTheme" which do not use this property(like via MetalLookAndFeel.usingOcean())

I guess you are talking about this code but it already checks if it is not null and it will be not null only for OceanTheme as other themes dont have this property so will not trace this code path. If new themes do not want, it will not set this property and if they want, then using `MetalLookAndFeel.usingOcean() `will hamper that, I believe, so I think it's fine as it is

https://github.com/openjdk/jdk/blob/2a579ab8392d30a35f044954178c788d16d4b800/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalMenuBarUI.java#L104

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

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



More information about the client-libs-dev mailing list