6828273: javax/swing/system/6799345/TestShutdown.java test fails with RuntimeException.
authorart
Tue, 05 Oct 2010 18:13:52 +0400
changeset 6820 bd6e9b4e1460
parent 6819 3f85320a78af
child 6821 f5949f5159ec
6828273: javax/swing/system/6799345/TestShutdown.java test fails with RuntimeException. Reviewed-by: anthony, dcherepanov
jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
jdk/test/javax/swing/system/6799345/TestShutdown.java
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Tue Oct 05 18:12:04 2010 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Tue Oct 05 18:13:52 2010 +0400
@@ -377,22 +377,22 @@
             init();
             XWM.init();
             SunToolkit.setDataTransfererClassName(DATA_TRANSFERER_CLASS_NAME);
-            toolkitThread = new Thread(this, "AWT-XAWT");
-            toolkitThread.setPriority(Thread.NORM_PRIORITY + 1);
-            toolkitThread.setDaemon(true);
-            ThreadGroup mainTG = (ThreadGroup)AccessController.doPrivileged(
-                                                                            new PrivilegedAction() {
-                                                                                    public Object run() {
-                                                                                        ThreadGroup currentTG =
-                                                                                            Thread.currentThread().getThreadGroup();
-                                                                                        ThreadGroup parentTG = currentTG.getParent();
-                                                                                        while (parentTG != null) {
-                                                                                            currentTG = parentTG;
-                                                                                            parentTG = currentTG.getParent();
-                                                                                        }
-                                                                                        return currentTG;
-                                                                                    }
-                                                                                });
+
+            PrivilegedAction<Thread> action = new PrivilegedAction() {
+                public Thread run() {
+                    ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
+                    ThreadGroup parentTG = currentTG.getParent();
+                    while (parentTG != null) {
+                        currentTG = parentTG;
+                        parentTG = currentTG.getParent();
+                    }
+                    Thread thread = new Thread(currentTG, XToolkit.this, "AWT-XAWT");
+                    thread.setPriority(Thread.NORM_PRIORITY + 1);
+                    thread.setDaemon(true);
+                    return thread;
+                }
+            };
+            toolkitThread = AccessController.doPrivileged(action);
             toolkitThread.start();
         }
     }
--- a/jdk/test/javax/swing/system/6799345/TestShutdown.java	Tue Oct 05 18:12:04 2010 +0400
+++ b/jdk/test/javax/swing/system/6799345/TestShutdown.java	Tue Oct 05 18:13:52 2010 +0400
@@ -59,7 +59,7 @@
 
         while (!appcontextInitDone)
         {
-            Thread.sleep(500);
+            Thread.sleep(1000);
         }
 
         targetAppContext.dispose();
@@ -146,7 +146,6 @@
                     startGUI();
                 }
             });
-            stk.realSync();
 
             // start multiple SwingWorkers
             while (!Thread.interrupted())