RFR: 8281988: Create a regression test for JDK-4618767 [v3]

Alexey Ivanov aivanov at openjdk.java.net
Mon Feb 21 20:37:53 UTC 2022


On Sat, 19 Feb 2022 08:09:32 GMT, Manukumar V S <mvs at openjdk.org> wrote:

>> Create a regression test for [JDK-4618767](https://bugs.openjdk.java.net/browse/JDK-4618767)
>> 
>> Issue identified in [JDK-4618767](https://bugs.openjdk.java.net/browse/JDK-4618767):
>> Typing a letter while a JList has focus now makes the selection jump to the first/next node/item whose text starts with that letter even though that letter is accompanied by modifier keys such as ALT or CTRL.
>> 
>> Fix:
>> Only enable JList letter navigation when the user
>> doesn't press any modifier keys such as ALT or CTRL.
>> 
>> Testing:
>> I have verified this test with JDK 1.4.0 and JDK 1.4.1 .
>> The issue is reproducible using the test with JDK 1.4.0 , where the bug was originally reported and the test passed in JDK 1.4.1 where the issue was fixed.
>> I have tested it in Mac and Windows platforms multiple times and it passed everywhere.
>
> Manukumar V S has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review comments fixed: A CountDownLatch used instead of polling loop, hitKeys() introduced for key press/release, variable MENU changed to FILE_MENU, formatting changes, frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)

test/jdk/javax/swing/JList/4618767/JListSelectedElementTest.java line 100:

> 98:                 // Wait until the list gains focus.
> 99:                 if (!listGainedFocusLatch.await(3, TimeUnit.SECONDS)) {
> 100:                     throw new RuntimeException("Waited for long, but can't gain focus for list");

Suggestion:

                    throw new RuntimeException("Waited too long, but can't gain focus for list");

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

PR: https://git.openjdk.java.net/jdk/pull/7496



More information about the client-libs-dev mailing list