1075N/A/*
2362N/A * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
1075N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1075N/A *
1075N/A * This code is free software; you can redistribute it and/or modify it
1075N/A * under the terms of the GNU General Public License version 2 only, as
1075N/A * published by the Free Software Foundation.
1075N/A *
1075N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1075N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1075N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1075N/A * version 2 for more details (a copy is included in the LICENSE file that
1075N/A * accompanied this code).
1075N/A *
1075N/A * You should have received a copy of the GNU General Public License version
1075N/A * 2 along with this work; if not, write to the Free Software Foundation,
1075N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1075N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
1075N/A */
1075N/A
1075N/A/* @test
1075N/A @bug 6588003
1075N/A @summary LayoutQueue should not share its DefaultQueue across AppContexts
1075N/A @author Peter Zhelezniakov
1075N/A @run main Test6588003
1075N/A*/
1075N/A
1075N/Aimport javax.swing.text.LayoutQueue;
1075N/Aimport sun.awt.SunToolkit;
1075N/A
1075N/Apublic class Test6588003 implements Runnable {
1075N/A private static final LayoutQueue DEFAULT = new LayoutQueue();
1075N/A
1075N/A public static void main(String[] args) throws InterruptedException {
1075N/A LayoutQueue.setDefaultQueue(DEFAULT);
1075N/A
1075N/A ThreadGroup group = new ThreadGroup("Test6588003");
1075N/A Thread thread = new Thread(group, new Test6588003());
1075N/A thread.start();
1075N/A thread.join();
1075N/A
1075N/A if (LayoutQueue.getDefaultQueue() != DEFAULT) {
1075N/A throw new RuntimeException("Sharing detected");
1075N/A }
1075N/A }
1075N/A
1075N/A public void run() {
1075N/A SunToolkit.createNewAppContext();
1075N/A
1075N/A if (LayoutQueue.getDefaultQueue() == DEFAULT) {
1075N/A throw new RuntimeException("Sharing detected");
1075N/A }
1075N/A
1075N/A LayoutQueue.setDefaultQueue(new LayoutQueue());
1075N/A }
1075N/A}