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]

Jeremy Wood duke at openjdk.org
Thu Jun 5 16:56:52 UTC 2025


On Thu, 5 Jun 2025 12:53:01 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> 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.

This is updated. (I have no preference on the behavior; this was copied and pasted from other test files.)

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

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


More information about the client-libs-dev mailing list