RFR: 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text [v9]

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Jun 6 03:25:01 UTC 2025


On Thu, 5 Jun 2025 16:56:50 GMT, Jeremy Wood <duke at openjdk.org> wrote:

>> Make sure AquaTextPasswordFieldUI can't use selectWordAction.
>> 
>> The core problem here was we could call selectWordAction in the Aqua LAF on a JPasswordField. This problem was already solved in the BasicPasswordFieldUI and SynthPasswordFieldUI, but the AquaTextPasswordFieldUI does NOT extend the BasicPasswordFieldUI, so it wasn't inheriting this solution.
>> 
>> So the problem is partially about multiple inheritance.
>> 
>> My first response at solving the problem is just to move the existing solution to the parent BasicTextUI class and use an instanceof to make sure it is only applied to JPasswordFields.
>> 
>> There may be many different philosophies/recommendations on how to resolve this; I'm open to suggestions.
>
> Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'origin/JDK-8354646' into JDK-8354646
>  - 8354646: make UnsupportedLookAndFeelException fail test
>    
>    This is in response to:
>    https://github.com/openjdk/jdk/pull/25443#discussion_r2128771448

test/jdk/javax/swing/plaf/basic/BasicPasswordFieldUI/PasswordSelectionWordTest.java line 27:

> 25:  * @test
> 26:  * @key headful
> 27:  * @bug 4231444 8354646

This bugid needs to be added to java/awt/TextField/SetEchoCharWordOpsTest.java also as that is the original test which raises this issue.

test/jdk/javax/swing/plaf/basic/BasicPasswordFieldUI/PasswordSelectionWordTest.java line 33:

> 31:  * identify spaces in the password. 8354646 is an offshoot of 4231444 that
> 32:  * reproduced in Aqua because AquaTextPasswordFieldUI does NOT extend
> 33:  * BasicPasswordFieldUI.

Please align the text below "Password" word not to be in same line as jtreg tag..

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25443#discussion_r2131430468
PR Review Comment: https://git.openjdk.org/jdk/pull/25443#discussion_r2131431316


More information about the client-libs-dev mailing list