RFR: 8278620: properties installed by javax.swing.LookAndFeel installColors and installColorsAndFont are not uninstalled [v2]

SWinxy duke at openjdk.org
Fri Feb 3 22:33:49 UTC 2023


On Mon, 19 Dec 2022 21:43:26 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>>> This change cause 23 test cases to fail across the platforms:
>> 
>> So I thought we'd got past the testing since a CSR was proposed. The CSR should have waited.
>> 
>>> 
>>> * `sanity/client/SwingSet/src/SwingSet2DemoTest.java`;
>>> * `javax/swing/GraphicsConfigNotifier/StalePreferredSize.java`;
>>> * two closed tests.
>>> 
>>> **One JCK test** fails; from a quick look, it's because the font is now uninstalled where it wasn't previously.
>> 
>> So all the test failures are blocker problem .. @aivanov-jdk, do any of the jtreg test failures characterise the JCK failure ?
>> Meaning something the submitter can use as a proxy to understand the problem
>> Do these failures suggest that there's a good reason why these fonts and colors are not installed ? 
>> Or do we have 23 (!) tests which have an assumption they probably shouldn't have ?
>> Possible, but in that case, would apps have the same assumptions ?
>
>> One JCK test fails; from a quick look, it's because the font is now uninstalled where it wasn't previously.
> 
> I confirmed it's a test problem. The JCK test needs to be updated. Details are in a confidential comment in JBS.
> 
> Do I need to submit a bug against JCK?
> 
> 
>> do any of the jtreg test failures characterise the JCK failure ?
> 
> The failure of `javax/swing/GraphicsConfigNotifier/StalePreferredSize.java` may be related. The test fails for `JLabel`.
> 
> The test calls `SwingUtilities.updateComponentTreeUI(frame)` and expects the preferred size doesn't change. Yet it does change.
> 
> The failure in `sanity/client/SwingSet/src/SwingSet2DemoTest.java` is also related. It fails because of timeout where a font on a component (`JButton` presumably) doesn't change to _bold_ after selecting **Theme** → **Font** → **Bold** in the menu. Selecting this menu item results in `SwingUtilities.updateComponentTreeUI(frame)` being called to update the look and feel properties of all the components.
> 
> 
> As for the closed test failure, it doesn't look related. A component being painted is null. It shouldn't happen.

I'm really not sure how to fix these. I've tried digging into the tests. It looks like uninstalling the fonts from the components screws with other parts of Swing, specifically that delegates are calling `getFont` after they've been uninstalled? At least that's my guess. I'm unsure how to continue. @aivanov-jdk, could you please help me with this?

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

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



More information about the client-libs-dev mailing list