8147545: Remove sun.misc.ManagedLocalsThread from java.prefs
authorbpb
Fri, 22 Jan 2016 12:44:32 -0800
changeset 35311 613162418a3d
parent 35310 24e6bd6c0b75
child 35312 4fbe776d28c5
8147545: Remove sun.misc.ManagedLocalsThread from java.prefs Summary: Replace ManagedLocalsThread with Thread(null,null,threadName,0,false) Reviewed-by: chegar
jdk/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java
jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java
jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java
--- a/jdk/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Fri Jan 22 17:43:21 2016 +0000
+++ b/jdk/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Fri Jan 22 12:44:32 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, 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
@@ -31,7 +31,6 @@
 import java.util.Timer;
 import java.util.TimerTask;
 import java.lang.ref.WeakReference;
-import sun.misc.ManagedLocalsThread;
 
 
 /*
@@ -344,7 +343,8 @@
     {
         if (timer == null) {
             timer = new Timer(true); // daemon
-            Thread flushThread = new ManagedLocalsThread() {
+            Thread flushThread =
+                new Thread(null, null, "Flush Thread", 0, false) {
                 @Override
                 public void run() {
                     flushWorld();
--- a/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java	Fri Jan 22 17:43:21 2016 +0000
+++ b/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java	Fri Jan 22 12:44:32 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, 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
@@ -29,7 +29,6 @@
 import java.io.*;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import sun.misc.ManagedLocalsThread;
 // These imports needed only as a workaround for a JavaDoc bug
 import java.lang.Integer;
 import java.lang.Long;
@@ -1515,7 +1514,11 @@
      * A single background thread ("the event notification thread") monitors
      * the event queue and delivers events that are placed on the queue.
      */
-    private static class EventDispatchThread extends ManagedLocalsThread {
+    private static class EventDispatchThread extends Thread {
+        private EventDispatchThread() {
+            super(null, null, "Event Dispatch Thread", 0, false);
+        }
+
         public void run() {
             while(true) {
                 // Wait on eventQueue till an event is present
--- a/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java	Fri Jan 22 17:43:21 2016 +0000
+++ b/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java	Fri Jan 22 12:44:32 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, 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
@@ -30,7 +30,6 @@
 import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
 import java.security.PrivilegedActionException;
-import sun.misc.ManagedLocalsThread;
 import sun.util.logging.PlatformLogger;
 
 /**
@@ -443,7 +442,8 @@
         // Add shutdown hook to flush cached prefs on normal termination
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             public Void run() {
-                Runtime.getRuntime().addShutdownHook(new ManagedLocalsThread() {
+                Runtime.getRuntime().addShutdownHook(
+                    new Thread(null, null, "Sync Timer Thread", 0, false) {
                     public void run() {
                         syncTimer.cancel();
                         syncWorld();