提交 54547bea 编写于 作者: P peterz

6801769: 6588003 should be backed out from jdk7

Reviewed-by: alexp
上级 5dbb7474
......@@ -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 @@ import sun.awt.AppContext;
*/
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 @@ public class LayoutQueue {
* 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;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册