changeset 13541:7f5b7acebffd

8147545: Remove sun.misc.ManagedLocalsThread from java.prefs Summary: Replace ManagedLocalsThread with Thread(null,null,threadName,0,false) Reviewed-by: chegar
author bpb
date Fri, 22 Jan 2016 12:44:32 -0800
parents 452162be5da9
children afa1a4e34c20
files src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java
diffstat 3 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Fri Jan 22 17:43:21 2016 +0000
+++ b/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/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java	Fri Jan 22 17:43:21 2016 +0000
+++ b/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/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java	Fri Jan 22 17:43:21 2016 +0000
+++ b/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();