< prev index next >

src/java.desktop/share/classes/sun/java2d/marlin/MarlinUtils.java

Print this page

53 
54     public static void logException(final String msg, final Throwable th) {
55         if (MarlinConst.USE_LOGGER) {
56             LOG.warning(msg, th);
57         } else if (MarlinConst.ENABLE_LOGS) {
58             System.out.print("WARNING: ");
59             System.out.println(msg);
60             th.printStackTrace(System.err);
61         }
62     }
63 
64     // From sun.awt.util.ThreadGroupUtils
65 
66     /**
67      * Returns a root thread group.
68      * Should be called with {@link sun.security.util.SecurityConstants#MODIFY_THREADGROUP_PERMISSION}
69      *
70      * @return a root {@code ThreadGroup}
71      */
72     public static ThreadGroup getRootThreadGroup() {

73         ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
74         ThreadGroup parentTG = currentTG.getParent();
75         while (parentTG != null) {
76             currentTG = parentTG;
77             parentTG = currentTG.getParent();
78         }
79         return currentTG;
80     }
81 }

53 
54     public static void logException(final String msg, final Throwable th) {
55         if (MarlinConst.USE_LOGGER) {
56             LOG.warning(msg, th);
57         } else if (MarlinConst.ENABLE_LOGS) {
58             System.out.print("WARNING: ");
59             System.out.println(msg);
60             th.printStackTrace(System.err);
61         }
62     }
63 
64     // From sun.awt.util.ThreadGroupUtils
65 
66     /**
67      * Returns a root thread group.
68      * Should be called with {@link sun.security.util.SecurityConstants#MODIFY_THREADGROUP_PERMISSION}
69      *
70      * @return a root {@code ThreadGroup}
71      */
72     public static ThreadGroup getRootThreadGroup() {
73         @SuppressWarnings("deprecation")
74         ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
75         ThreadGroup parentTG = currentTG.getParent();
76         while (parentTG != null) {
77             currentTG = parentTG;
78             parentTG = currentTG.getParent();
79         }
80         return currentTG;
81     }
82 }
< prev index next >