On Thu, 5 Jun 2025 12:53:01 GMT, Alexey Ivanov <aiva...@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

Reply via email to