6801769: 6588003 should be backed out from jdk7
authorpeterz
Thu, 05 Feb 2009 19:16:13 +0300
changeset 2484 9f3b45efb17d
parent 2483 71aa8bfff99d
child 2485 dc7165666847
6801769: 6588003 should be backed out from jdk7 Reviewed-by: alexp
jdk/src/share/classes/javax/swing/text/LayoutQueue.java
--- a/jdk/src/share/classes/javax/swing/text/LayoutQueue.java	Thu Feb 05 17:00:57 2009 +0300
+++ b/jdk/src/share/classes/javax/swing/text/LayoutQueue.java	Thu Feb 05 19:16:13 2009 +0300
@@ -25,7 +25,6 @@
 package javax.swing.text;
 
 import java.util.Vector;
-import sun.awt.AppContext;
 
 /**
  * A queue of text layout tasks.
@@ -36,10 +35,10 @@
  */
 public class LayoutQueue {
 
-    private static final Object DEFAULT_QUEUE = new Object();
+    Vector<Runnable> tasks;
+    Thread worker;
 
-    private Vector<Runnable> tasks;
-    private Thread worker;
+    static LayoutQueue defaultQueue;
 
     /**
      * Construct a layout queue.
@@ -52,31 +51,19 @@
      * Fetch the default layout queue.
      */
     public static LayoutQueue getDefaultQueue() {
-        AppContext ac = AppContext.getAppContext();
-        synchronized (DEFAULT_QUEUE) {
-            LayoutQueue defaultQueue = (LayoutQueue) ac.get(DEFAULT_QUEUE);
-            if (defaultQueue == null) {
-                defaultQueue = new LayoutQueue();
-                ac.put(DEFAULT_QUEUE, defaultQueue);
-            }
-            return defaultQueue;
+        if (defaultQueue == null) {
+            defaultQueue = new LayoutQueue();
         }
+        return defaultQueue;
     }
 
     /**
      * Set the default layout queue.
      *
-     * @param defaultQueue the new queue.
+     * @param q the new queue.
      */
-    public static void setDefaultQueue(LayoutQueue defaultQueue) {
-        synchronized (DEFAULT_QUEUE) {
-            AppContext ac = AppContext.getAppContext();
-            if (defaultQueue == null) {
-                ac.remove(DEFAULT_QUEUE);
-            } else {
-                ac.put(DEFAULT_QUEUE, defaultQueue);
-            }
-        }
+    public static void setDefaultQueue(LayoutQueue q) {
+        defaultQueue = q;
     }
 
     /**