jdk/src/java.desktop/share/classes/sun/awt/AppContext.java
changeset 31653 d88ff422c7fb
parent 30948 0a0972d3b58d
child 32834 e1dca5fe4de3
child 32865 f9cb6e427f9e
--- a/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java	Fri Jun 26 12:38:39 2015 +0300
+++ b/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java	Mon Jun 29 01:27:08 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -44,7 +44,7 @@
 import java.beans.PropertyChangeListener;
 import java.lang.ref.SoftReference;
 
-import sun.misc.InnocuousThread;
+import sun.misc.ManagedLocalsThread;
 import sun.util.logging.PlatformLogger;
 import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.Lock;
@@ -591,13 +591,9 @@
         }
 
         public Thread run() {
-            Thread t;
-            if (System.getSecurityManager() == null) {
-                t = new Thread(appContext.getThreadGroup(), runnable);
-            } else {
-                t = new InnocuousThread(appContext.getThreadGroup(), runnable, "AppContext Disposer");
-            }
-            t.setContextClassLoader(null);
+            Thread t = new ManagedLocalsThread(appContext.getThreadGroup(),
+                                               runnable, "AppContext Disposer");
+            t.setContextClassLoader(appContext.getContextClassLoader());
             t.setPriority(Thread.NORM_PRIORITY + 1);
             t.setDaemon(true);
             return t;