test/java/awt/Focus/SortingFPT/JDK8048887.java

Print this page

        

@@ -24,11 +24,11 @@
 /*
   @test
   @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;
 import javax.swing.JPanel;
 import javax.swing.SwingUtilities;

@@ -51,13 +51,16 @@
     }
 
     public void start() {
         final CountDownLatch latch = new CountDownLatch(1);
 
-        SwingUtilities.invokeLater(() -> {
+        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;

@@ -73,10 +76,13 @@
                         public void windowGainedFocus(WindowEvent e) {
                             latch.countDown();
                         }
                 });
                 d.setVisible(true);
+
+
+                }
         });
 
         try {
             latch.await(5, TimeUnit.SECONDS);
         } catch (InterruptedException e) {