RFR: 8361606 : ConsumeNextMnemonicKeyTypedTest.java fails on Windows: character typed with VK_A: a [v3]

Alexey Ivanov aivanov at openjdk.org
Thu Sep 25 16:41:56 UTC 2025


On Mon, 25 Aug 2025 10:43:51 GMT, Anass Baya <abaya at openjdk.org> wrote:

>> **Analysis :**
>> When the problem occurrs, the key press event related to the mnemonic triggers the item selection. However, as we returned to the menu, the subsequent key typed event arrived and was treated as a normal key press instead of being recognized as part of the mnemonic sequence.
>> 
>> **Proposed Fix:**
>> As a fix, we are tagging the next key typed event to be consumed by the Keyboard Focus Manager
>> 
>> 
>>     public void processKeyEvent(Component focusedComponent, KeyEvent e) {
>>         // consume processed event if needed
>>         if (consumeProcessedKeyEvent(e)) { <--- consumed here
>>             return;
>>         }
>> ...
>
> Anass Baya has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add Linux bug ID 8321303

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java line 1:

> 1: /*

Update the copyright year.

And in the test too.

test/jdk/ProblemList.txt line 494:

> 492: java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest.java 8257529 windows-x64
> 493: java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeForModalDialogTest/ConsumeForModalDialogTest.java 8302787 windows-all
> 494: java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedTest.java 8302787 windows-all

You have to add 8321303 to the list of resolved issues.

Otherwise, [JDK-8321303](https://bugs.openjdk.org/browse/JDK-8321303) will remain open. Alternatively, you can close JDK-8321303 as duplicate of [JDK-8361606](https://bugs.openjdk.org/browse/JDK-8361606) (the currently resolved issue).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26790#discussion_r2379740153
PR Review Comment: https://git.openjdk.org/jdk/pull/26790#discussion_r2379737958


More information about the client-libs-dev mailing list