RFR: 8277463: JFileChooser with Metal L&F doesn't show non-canonical UNC path in - Look in [v2]

Sergey Bylokhov serb at openjdk.java.net
Tue Dec 21 05:31:16 UTC 2021


On Mon, 20 Dec 2021 09:32:24 GMT, Masanori Yano <myano at openjdk.org> wrote:

>> test/jdk/javax/swing/JFileChooser/8277463/UNCFileChooserTest.java line 105:
>> 
>>> 103:             throw new RuntimeException("Enter the directory path to test.");
>>> 104:         }
>>> 105:         UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
>> 
>> The test might be executed under some non-default L&F and switching it here might cause some issues for the instruction dialog which will not be updated to use the metal. So it is better to set metal at the start of the test.
>
> I fixed the test as it was pointed out to me.

Now it cannot be compiled due to "unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown" from the setLookAndFeel(); Note that the new version still has a race, the invokeLater/setLookAndFeel can be executed later than the code in the showOpenDialog(), so the code in showOpenDialog may use the wrong L&F properties, can we move the showOpenDialog to the EDT as well?

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

PR: https://git.openjdk.java.net/jdk/pull/6796



More information about the client-libs-dev mailing list