changeset 1078:0960e96d0de8

6801769: 6588003 should be backed out from jdk7 Reviewed-by: alexp
author peterz
date Thu, 05 Feb 2009 19:16:13 +0300
parents 27dabbdfdcac
children 794e786306c1
files src/share/classes/javax/swing/text/LayoutQueue.java
diffstat 1 files changed, 9 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/text/LayoutQueue.java	Thu Feb 05 17:00:57 2009 +0300
+++ b/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;
     }
 
     /**