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

Alexey Ivanov aivanov at openjdk.org
Thu Jun 5 12:55:54 UTC 2025


On Thu, 5 Jun 2025 12:46:01 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update test/jdk/javax/swing/plaf/basic/BasicPasswordFieldUI/PasswordSelectionWordTest.java
>>   
>>   Co-authored-by: Alexey Ivanov <alexey.ivanov at oracle.com>
>
> test/jdk/javax/swing/plaf/basic/BasicPasswordFieldUI/PasswordSelectionWordTest.java line 52:
> 
>> 50:                 UIManager.getInstalledLookAndFeels()) {
>> 51:             System.out.println("Testing LAF: " + laf.getClassName());
>> 52:             SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
> 
> If setLookAndFeel finds UnsupportedLookAndFeelException then the runTest here is still executed here whereas it shouldn't continue for that L&F...guess you can use a boolean return value for setLookAndFeel.

Many tests do this kind of thing… the worse thing that happen is that the test code is run again where it's not required.

I'm pretty sure `UnsupportedLookAndFeelException` is a rare situation, and it shouldn't happen for Look and Feels provided by JDK.

Shall we treat `UnsupportedLookAndFeelException` as an error and see how it goes? This will makes the code simpler. If it's ever encountered and proved to be a common case, the test will need updating. Otherwise, I'm for keeping it as simple as possible.

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

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


More information about the client-libs-dev mailing list