RFR: 8367376: Bad ButtonUI prevents other components from updating when system changes desktop properties [v2]

Alexey Ivanov aivanov at openjdk.org
Wed Sep 17 20:20:49 UTC 2025


On Thu, 11 Sep 2025 07:06:20 GMT, Jeremy Wood <jwood at openjdk.org> wrote:

>> Previously:
>> 
>> If DesktopProperty#updateAllUIs threw an exception, we would never reset the update-pending property to false. This means any subsequent call to `updateUI()` would not attempt to call `updateAllUIs()`
>> 
>> With this change:
>> Subsequent calls to DesktopProperty#updateUI() can still trigger at least one call to updateAllUIs().
>
> Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8367376: trivial typos in comment

Changes requested by aivanov (Reviewer).

test/jdk/com/sun/java/swing/plaf/Test8367376.java line 29:

> 27:    @modules java.desktop/sun.swing.plaf
> 28:    @run main Test8367376
> 29: */

Suggestion:

/*
 * @test
 * @bug 8367376
 * @summary DesktopProperty never reset pending status to process new updates
 * @modules java.desktop/sun.swing.plaf
 * @run main Test8367376
 */

Follow the common style of prefixing with an asterisk and leaving the first line blank after the block comment opening (`/*`).

test/jdk/com/sun/java/swing/plaf/Test8367376.java line 46:

> 44: import java.util.concurrent.CountDownLatch;
> 45: 
> 46: public class Test8367376 extends JFrame {

Give the test a meaningful name? `UninstallUIThrowsException`?

test/jdk/com/sun/java/swing/plaf/Test8367376.java line 137:

> 135: 
> 136:     static int panelUpdateUIctr;
> 137:     static int observedExpectedExceptionCtr;

Maybe spell `Counter`?

Suggestion:

    static int panelUpdateUICounter;
    static int observedExpectedExceptionCounter;

test/jdk/com/sun/java/swing/plaf/Test8367376.java line 156:

> 154:         getContentPane().add(p);
> 155:     }
> 156: }

A file should end with new line (`\n`) character.

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

PR Review: https://git.openjdk.org/jdk/pull/27205#pullrequestreview-3236098185
PR Review Comment: https://git.openjdk.org/jdk/pull/27205#discussion_r2356653386
PR Review Comment: https://git.openjdk.org/jdk/pull/27205#discussion_r2356674752
PR Review Comment: https://git.openjdk.org/jdk/pull/27205#discussion_r2356664929
PR Review Comment: https://git.openjdk.org/jdk/pull/27205#discussion_r2356666306


More information about the client-libs-dev mailing list