--- old/test/java/awt/Focus/SortingFPT/JDK8048887.java 2014-09-01 07:19:09.342287356 -0700 +++ new/test/java/awt/Focus/SortingFPT/JDK8048887.java 2014-09-01 07:19:09.191286933 -0700 @@ -26,7 +26,7 @@ @bug 8048887 @summary Tests SortingFTP for an exception caused by the tim-sort algo. @author anton.tarasov: area=awt.focus - @run main JDK8040632 + @run main JDK8048887 */ import javax.swing.JFrame; @@ -53,28 +53,34 @@ public void start() { final CountDownLatch latch = new CountDownLatch(1); - SwingUtilities.invokeLater(() -> { - // Catch the original exception which sounds like: - // java.lang.IllegalArgumentException: Comparison method violates its general contract! - Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { - public void uncaughtException(Thread t, Throwable e) { - e.printStackTrace(); - if (e instanceof IllegalArgumentException) { - passed = false; - latch.countDown(); - } - } - }); - - TestDialog d = new TestDialog(); - // It's expected that the dialog is focused on start. - // The listener is called after the FTP completes processing and the bug is reproduced or not. - d.addWindowFocusListener(new WindowAdapter() { - public void windowGainedFocus(WindowEvent e) { - latch.countDown(); - } - }); - d.setVisible(true); + SwingUtilities.invokeLater(new Runnable(){ + @Override + public void run(){ + // Catch the original exception which sounds like: + // java.lang.IllegalArgumentException: Comparison method violates its general contract! + + Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + public void uncaughtException(Thread t, Throwable e) { + e.printStackTrace(); + if (e instanceof IllegalArgumentException) { + passed = false; + latch.countDown(); + } + } + }); + + TestDialog d = new TestDialog(); + // It's expected that the dialog is focused on start. + // The listener is called after the FTP completes processing and the bug is reproduced or not. + d.addWindowFocusListener(new WindowAdapter() { + public void windowGainedFocus(WindowEvent e) { + latch.countDown(); + } + }); + d.setVisible(true); + + + } }); try {