RFR: 8341982: Simplify JButton/bug4323121.java [v5]

Abhishek Kumar abhiscxk at openjdk.org
Mon Oct 21 16:01:41 UTC 2024


On Mon, 21 Oct 2024 15:12:50 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> The test `javax/swing/JButton/bug4323121.java` contains lots of unused methods.
>> 
>> I removed all the unused methods by extending `MouseAdapter`.
>> 
>> I use `CountDownLatch` to synchronise actions in the test.
>> 
>> The test still verifies `button.getModel().isArmed()` doesn't always return `true` for classes which extend `JButton`. I verified the updated test fails in 1.3.0 and passes in 1.4.0, so the test still reproduces the original problem.
>
> Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use JButton directly instead of TestButton subclass

test/jdk/javax/swing/JButton/bug4323121.java line 50:

> 48: 
> 49:     static JFrame frame;
> 50:     static JButton button;

You may move it inside main.

test/jdk/javax/swing/JButton/bug4323121.java line 112:

> 110:             if (modelArmed) {
> 111:                 throw new RuntimeException("getModel().isArmed() returns true "
> 112:                                            + "for a subclass of JButton");

`summary` and `exception` need to update since you have removed the **subclass of JButton**.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21475#discussion_r1809085265
PR Review Comment: https://git.openjdk.org/jdk/pull/21475#discussion_r1809089192


More information about the client-libs-dev mailing list