On Mon, 25 Sep 2023 06:53:49 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> wrote:
>> test/jdk/javax/swing/JTableHeader/SerializeJTableHeader.java line 55: >> >>> 53: for (UIManager.LookAndFeelInfo laf : >>> UIManager.getInstalledLookAndFeels()) { >>> 54: System.out.println("Testing L&F: " + laf); >>> 55: SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf)); >> >> Why did you choose to set LAF on EDT? You then continue with creating and >> serialising the component on the main thread. > > I was not sure if any event processing needs to be done for lookandfeel > change particularly native l&f like GTK and Aqua. > Seems like it works with both EDT and non-EDT...tried with repeat count > 50....so removed EDT usage... > however GTK is not supported on headless environment so made the test run on > headful environment. I never thought about it… Yet if there's anything that depends on access to native platform, it probably needs to run on the toolkit thread. I'm for keeping it simpler: if it works correctly on the main thread here, let's keep it this way. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15507#discussion_r1335747606