8035169: Move ThreadGroupUtils from the sun.misc package
authorpchelko
Fri, 18 Apr 2014 10:47:23 +0400
changeset 24520 e8afd90fcb69
parent 24191 75ee64f51cb4
child 24521 97047c850d31
8035169: Move ThreadGroupUtils from the sun.misc package Reviewed-by: anthony, serb, azvegint
jdk/src/macosx/classes/sun/font/CFontManager.java
jdk/src/macosx/classes/sun/lwawt/LWToolkit.java
jdk/src/macosx/native/sun/awt/awt.m
jdk/src/share/classes/sun/awt/AWTAutoShutdown.java
jdk/src/share/classes/sun/awt/util/ThreadGroupUtils.java
jdk/src/share/classes/sun/font/CreatedFontTracker.java
jdk/src/share/classes/sun/font/SunFontManager.java
jdk/src/share/classes/sun/java2d/Disposer.java
jdk/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java
jdk/src/share/classes/sun/misc/ThreadGroupUtils.java
jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java
jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
jdk/src/windows/classes/sun/awt/windows/WToolkit.java
jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java
--- a/jdk/src/macosx/classes/sun/font/CFontManager.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/macosx/classes/sun/font/CFontManager.java	Fri Apr 18 10:47:23 2014 +0400
@@ -40,7 +40,7 @@
 
 import sun.awt.FontConfiguration;
 import sun.awt.HeadlessToolkit;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.lwawt.macosx.*;
 
 public class CFontManager extends SunFontManager {
--- a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java	Fri Apr 18 10:47:23 2014 +0400
@@ -35,7 +35,7 @@
 
 import sun.awt.*;
 import sun.print.*;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 import static sun.lwawt.LWWindowPeer.PeerType;
 
--- a/jdk/src/macosx/native/sun/awt/awt.m	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/macosx/native/sun/awt/awt.m	Fri Apr 18 10:47:23 2014 +0400
@@ -435,7 +435,7 @@
         forceEmbeddedMode = YES;
     }
     JNIEnv* env = [ThreadUtilities getJNIEnvUncached];
-    jclass jc_ThreadGroupUtils = (*env)->FindClass(env, "sun/misc/ThreadGroupUtils");
+    jclass jc_ThreadGroupUtils = (*env)->FindClass(env, "sun/awt/util/ThreadGroupUtils");
     jmethodID sjm_getRootThreadGroup = (*env)->GetStaticMethodID(env, jc_ThreadGroupUtils, "getRootThreadGroup", "()Ljava/lang/ThreadGroup;");
     jobject rootThreadGroup = (*env)->CallStaticObjectMethod(env, jc_ThreadGroupUtils, sjm_getRootThreadGroup);
     [ThreadUtilities setAppkitThreadGroup:(*env)->NewGlobalRef(env, rootThreadGroup)];
--- a/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java	Fri Apr 18 10:47:23 2014 +0400
@@ -35,7 +35,7 @@
 import java.util.Set;
 
 import sun.util.logging.PlatformLogger;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 /**
  * This class is to let AWT shutdown automatically when a user is done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/awt/util/ThreadGroupUtils.java	Fri Apr 18 10:47:23 2014 +0400
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.awt.util;
+
+/**
+ * A utility class needed to access the root {@code ThreadGroup}
+ *
+ * The class should not depend on any others, because it' called from JNI_OnLoad of the AWT
+ * native library. Triggering class loading could lead to a deadlock.
+ */
+public final class ThreadGroupUtils {
+
+    private ThreadGroupUtils() {
+        // Avoid instantiation
+    }
+
+    /**
+     * Returns a root thread group.
+     * Should be called with {@link sun.security.util.SecurityConstants#MODIFY_THREADGROUP_PERMISSION}
+     *
+     * @return a root {@code ThreadGroup}
+     */
+    public static ThreadGroup getRootThreadGroup() {
+        ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
+        ThreadGroup parentTG = currentTG.getParent();
+        while (parentTG != null) {
+            currentTG = parentTG;
+            parentTG = currentTG.getParent();
+        }
+        return currentTG;
+    }
+}
--- a/jdk/src/share/classes/sun/font/CreatedFontTracker.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/share/classes/sun/font/CreatedFontTracker.java	Fri Apr 18 10:47:23 2014 +0400
@@ -35,7 +35,7 @@
 import java.util.concurrent.TimeUnit;
 
 import sun.awt.AppContext;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 public class CreatedFontTracker {
 
--- a/jdk/src/share/classes/sun/font/SunFontManager.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/share/classes/sun/font/SunFontManager.java	Fri Apr 18 10:47:23 2014 +0400
@@ -52,7 +52,7 @@
 import sun.awt.AppContext;
 import sun.awt.FontConfiguration;
 import sun.awt.SunToolkit;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.java2d.FontSupport;
 import sun.util.logging.PlatformLogger;
 
--- a/jdk/src/share/classes/sun/java2d/Disposer.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/share/classes/sun/java2d/Disposer.java	Fri Apr 18 10:47:23 2014 +0400
@@ -25,7 +25,7 @@
 
 package sun.java2d;
 
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
--- a/jdk/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/share/classes/sun/java2d/opengl/OGLRenderQueue.java	Fri Apr 18 10:47:23 2014 +0400
@@ -25,7 +25,7 @@
 
 package sun.java2d.opengl;
 
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.java2d.pipe.RenderBuffer;
 import sun.java2d.pipe.RenderQueue;
 import static sun.java2d.pipe.BufferedOpCodes.*;
--- a/jdk/src/share/classes/sun/misc/ThreadGroupUtils.java	Thu Apr 17 09:45:16 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-/**
- * A utility class needed to access the root {@code ThreadGroup}
- *
- * The class should not depend on any others, because it' called from JNI_OnLoad of the AWT
- * native library. Triggering class loading could could lead to a deadlock.
- */
-public final class ThreadGroupUtils {
-
-    private ThreadGroupUtils() {
-        // Avoid instantiation
-    }
-
-    /**
-     * Returns a root thread group.
-     * Should be called with {@link sun.security.util.SecurityConstants#MODIFY_THREADGROUP_PERMISSION}
-     *
-     * @return a root {@code ThreadGroup}
-     */
-    public static ThreadGroup getRootThreadGroup() {
-        ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
-        ThreadGroup parentTG = currentTG.getParent();
-        while (parentTG != null) {
-            currentTG = parentTG;
-            parentTG = currentTG.getParent();
-        }
-        return currentTG;
-    }
-}
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Fri Apr 18 10:47:23 2014 +0400
@@ -51,7 +51,7 @@
 import sun.font.FontConfigManager;
 import sun.java2d.SunGraphicsEnvironment;
 import sun.misc.*;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.print.PrintJob2D;
 import sun.security.action.GetPropertyAction;
 import sun.security.action.GetBooleanAction;
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Fri Apr 18 10:47:23 2014 +0400
@@ -42,7 +42,7 @@
 import sun.java2d.xr.XRGraphicsConfig;
 import sun.java2d.loops.SurfaceType;
 
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 /**
  * This is an implementation of a GraphicsDevice object for a single
--- a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Fri Apr 18 10:47:23 2014 +0400
@@ -39,7 +39,7 @@
 
 import static sun.awt.shell.Win32ShellFolder2.*;
 import sun.awt.OSInfo;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 
 // NOTE: This class supersedes Win32ShellFolderManager, which was removed
 //       from distribution after version 1.4.2.
--- a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java	Fri Apr 18 10:47:23 2014 +0400
@@ -40,7 +40,7 @@
 import sun.awt.AWTPermissions;
 import sun.awt.LightweightFrame;
 import sun.awt.SunToolkit;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.awt.Win32GraphicsDevice;
 import sun.awt.Win32GraphicsEnvironment;
 import sun.awt.datatransfer.DataTransferer;
--- a/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java	Thu Apr 17 09:45:16 2014 -0700
+++ b/jdk/src/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java	Fri Apr 18 10:47:23 2014 +0400
@@ -38,7 +38,7 @@
 import java.util.HashMap;
 
 import sun.awt.AWTAccessor;
-import sun.misc.ThreadGroupUtils;
+import sun.awt.util.ThreadGroupUtils;
 import sun.awt.Win32GraphicsConfig;
 import sun.awt.windows.WComponentPeer;
 import sun.java2d.InvalidPipeException;