RFR: 8358813: JPasswordField identifies spaces in password via delete shortcuts
Alexey Ivanov
aivanov at openjdk.org
Fri Jul 11 09:40:42 UTC 2025
On Mon, 9 Jun 2025 02:36:44 GMT, Jeremy Wood <duke at openjdk.org> wrote:
> There were a few action bindings available in JPasswordFields in Aqua that let you identify the boundaries of words.
>
> This came to my attention while looking at the related work https://github.com/openjdk/jdk/pull/25443 . In that PR we said we should iterate across all available L&Fs, so this PR copies that same approach. (The original complaint only focused on Aqua, though.)
Changes requested by aivanov (Reviewer).
src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java line 1:
> 1: /*
Please, update the copyright year.
test/jdk/javax/swing/JPasswordField/PasswordFieldInputMapWordTest.java line 76:
> 74: JComponent.WHEN_FOCUSED,
> 75: JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
> 76: }) {
The array with input map types could be a static constant just above `runTest` method.
test/jdk/javax/swing/JPasswordField/PasswordFieldInputMapWordTest.java line 93:
> 91: actionBinding == DefaultEditorKit.nextWordAction ||
> 92: actionBinding == DefaultEditorKit.selectionPreviousWordAction ||
> 93: actionBinding == DefaultEditorKit.selectionNextWordAction ) {
Does it make sense to put the actions in a list or array? Then `listOfActions.contains(actionBinding)` instead of this long `if` condition?
-------------
PR Review: https://git.openjdk.org/jdk/pull/25688#pullrequestreview-3009483798
PR Review Comment: https://git.openjdk.org/jdk/pull/25688#discussion_r2200206398
PR Review Comment: https://git.openjdk.org/jdk/pull/25688#discussion_r2200225191
PR Review Comment: https://git.openjdk.org/jdk/pull/25688#discussion_r2200230806
More information about the client-libs-dev
mailing list