changeset 5336:46e0bd218fcc

7164376: Replace use of sun.security.action.LoadLibraryAction with System.loadLibrary Reviewed-by: alanb, mullan, prr
author mchung
date Tue, 01 May 2012 19:45:34 -0700
parents 6c9c3d7ce9e2
children d78c6095dc98
files src/macosx/classes/apple/launcher/JavaAppLauncher.java src/macosx/classes/apple/security/KeychainStore.java src/macosx/classes/com/apple/concurrent/LibDispatchNative.java src/macosx/classes/com/apple/eawt/Application.java src/macosx/classes/com/apple/eio/FileManager.java src/macosx/classes/com/apple/laf/AquaFileView.java src/macosx/classes/com/apple/laf/AquaLookAndFeel.java src/macosx/classes/com/apple/laf/AquaNativeResources.java src/macosx/classes/com/apple/laf/ScreenMenu.java src/macosx/classes/com/apple/laf/ScreenPopupFactory.java src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java src/macosx/classes/sun/awt/CGraphicsEnvironment.java src/macosx/classes/sun/lwawt/macosx/CAccessibility.java src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java src/share/classes/java/awt/SplashScreen.java src/share/classes/java/awt/Toolkit.java src/share/classes/java/awt/event/NativeLibLoader.java src/share/classes/java/awt/image/ColorModel.java src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java src/share/classes/java/net/AbstractPlainSocketImpl.java src/share/classes/java/net/DatagramPacket.java src/share/classes/java/net/InetAddress.java src/share/classes/java/net/NetworkInterface.java src/share/classes/sun/awt/NativeLibLoader.java src/share/classes/sun/awt/image/JPEGImageDecoder.java src/share/classes/sun/awt/image/NativeLibLoader.java src/share/classes/sun/java2d/Disposer.java src/share/classes/sun/management/ManagementFactoryHelper.java src/share/classes/sun/net/sdp/SdpSupport.java src/share/classes/sun/net/spi/DefaultProxySelector.java src/share/classes/sun/nio/ch/Util.java src/share/classes/sun/security/action/LoadLibraryAction.java src/share/classes/sun/security/krb5/SCDynamicStoreConfig.java src/share/classes/sun/security/smartcardio/PCSC.java src/share/classes/sun/tracing/dtrace/JVM.java src/solaris/classes/sun/management/FileSystemImpl.java src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java src/solaris/classes/sun/print/CUPSPrinter.java src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java src/windows/classes/sun/awt/windows/WToolkit.java src/windows/classes/sun/management/FileSystemImpl.java src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java src/windows/classes/sun/print/Win32PrintServiceLookup.java src/windows/classes/sun/security/smartcardio/PlatformPCSC.java
diffstat 49 files changed, 323 insertions(+), 153 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/apple/launcher/JavaAppLauncher.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/apple/launcher/JavaAppLauncher.java	Tue May 01 19:45:34 2012 -0700
@@ -27,7 +27,6 @@
 
 import java.io.*;
 import java.lang.reflect.*;
-import java.security.PrivilegedAction;
 import java.text.MessageFormat;
 import java.util.*;
 import java.util.jar.*;
@@ -36,7 +35,13 @@
 
 class JavaAppLauncher implements Runnable {
     static {
-        java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osx"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("osx");
+                    return null;
+                }
+            });
     }
 
     private static native <T> T nativeConvertAndRelease(final long ptr);
--- a/src/macosx/classes/apple/security/KeychainStore.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/apple/security/KeychainStore.java	Tue May 01 19:45:34 2012 -0700
@@ -103,7 +103,13 @@
     private static final int SALT_LEN = 20;
 
     static {
-        java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osx"));
+        AccessController.doPrivileged(
+            new PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("osx");
+                    return null;
+                }
+            });
         try {
             PKCS8ShroudedKeyBag_OID = new ObjectIdentifier(keyBag);
             pbeWithSHAAnd3KeyTripleDESCBC_OID = new ObjectIdentifier(pbeWithSHAAnd3KeyTripleDESCBC);
--- a/src/macosx/classes/com/apple/concurrent/LibDispatchNative.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/com/apple/concurrent/LibDispatchNative.java	Tue May 01 19:45:34 2012 -0700
@@ -26,17 +26,23 @@
 package com.apple.concurrent;
 
 final class LibDispatchNative {
-        static {
-                java.security.AccessController.doPrivileged((java.security.PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osx"));
-        }
+    static {
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("osx");
+                    return null;
+                }
+            });
+    }
 
-        static native boolean nativeIsDispatchSupported();
-        static native long nativeGetMainQueue();
-        static native long nativeCreateConcurrentQueue(int priority);
-        static native long nativeCreateSerialQueue(String name);
-        static native void nativeReleaseQueue(long nativeQueue);
-        static native void nativeExecuteAsync(long nativeQueue, Runnable task);
-        static native void nativeExecuteSync(long nativeQueue, Runnable task);
+    static native boolean nativeIsDispatchSupported();
+    static native long nativeGetMainQueue();
+    static native long nativeCreateConcurrentQueue(int priority);
+    static native long nativeCreateSerialQueue(String name);
+    static native void nativeReleaseQueue(long nativeQueue);
+    static native void nativeExecuteAsync(long nativeQueue, Runnable task);
+    static native void nativeExecuteSync(long nativeQueue, Runnable task);
 
-        private LibDispatchNative() { }
+    private LibDispatchNative() { }
 }
--- a/src/macosx/classes/com/apple/eawt/Application.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/com/apple/eawt/Application.java	Tue May 01 19:45:34 2012 -0700
@@ -28,7 +28,6 @@
 import java.awt.*;
 import java.awt.peer.*;
 import java.beans.Beans;
-import java.security.PrivilegedAction;
 
 import javax.swing.JMenuBar;
 
@@ -59,7 +58,13 @@
     static Application sApplication = null;
 
     static {
-        java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("awt"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
 
         checkSecurity();
         if (!Beans.isDesignTime()) {
--- a/src/macosx/classes/com/apple/eio/FileManager.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/com/apple/eio/FileManager.java	Tue May 01 19:45:34 2012 -0700
@@ -55,7 +55,13 @@
  */
 public class FileManager {
     static {
-        java.security.AccessController.doPrivileged((java.security.PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osx"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("osx");
+                    return null;
+                }
+            });
     }
 
     /**
--- a/src/macosx/classes/com/apple/laf/AquaFileView.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaFileView.java	Tue May 01 19:45:34 2012 -0700
@@ -26,7 +26,6 @@
 package com.apple.laf;
 
 import java.io.*;
-import java.security.PrivilegedAction;
 import java.util.*;
 import java.util.Map.Entry;
 
@@ -57,7 +56,13 @@
     static final int kLSItemInfoExtensionIsHidden  = 0x00100000; /* Item has a hidden extension*/
 
     static {
-        java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osxui"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("osxui");
+                    return null;
+                }
+            });
     }
 
     // TODO: Un-comment this out when the native version exists
--- a/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Tue May 01 19:45:34 2012 -0700
@@ -134,10 +134,16 @@
      * @see UIManager#setLookAndFeel
      */
     public void initialize() {
-        java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osxui"));
-        java.security.AccessController.doPrivileged(new PrivilegedAction<Object>(){
+        java.security.AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("osxui");
+                    return null;
+                }
+            });
+
+        java.security.AccessController.doPrivileged(new PrivilegedAction<Void>(){
             @Override
-            public Object run() {
+            public Void run() {
                 JRSUIControl.initJRSUI();
                 return null;
             }
--- a/src/macosx/classes/com/apple/laf/AquaNativeResources.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaNativeResources.java	Tue May 01 19:45:34 2012 -0700
@@ -27,7 +27,6 @@
 
 import java.awt.*;
 import java.awt.image.BufferedImage;
-import java.security.PrivilegedAction;
 
 import javax.swing.plaf.UIResource;
 
@@ -35,7 +34,13 @@
 
 public class AquaNativeResources {
     static {
-        java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osxui"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("osxui");
+                    return null;
+                }
+            });
     }
 
     // TODO: removing CColorPaint for now
--- a/src/macosx/classes/com/apple/laf/ScreenMenu.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/com/apple/laf/ScreenMenu.java	Tue May 01 19:45:34 2012 -0700
@@ -28,7 +28,6 @@
 import java.awt.*;
 import java.awt.event.*;
 import java.awt.peer.MenuComponentPeer;
-import java.security.PrivilegedAction;
 import java.util.Hashtable;
 
 import javax.swing.*;
@@ -38,7 +37,13 @@
 
 class ScreenMenu extends Menu implements ContainerListener, ComponentListener, ScreenMenuPropertyHandler {
     static {
-        java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("awt"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
     }
 
     // screen menu stuff
--- a/src/macosx/classes/com/apple/laf/ScreenPopupFactory.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/com/apple/laf/ScreenPopupFactory.java	Tue May 01 19:45:34 2012 -0700
@@ -26,15 +26,19 @@
 package com.apple.laf;
 
 import java.awt.*;
-import java.security.PrivilegedAction;
-
 import javax.swing.*;
 
 import sun.lwawt.macosx.CPlatformWindow;
 
 class ScreenPopupFactory extends PopupFactory {
     static {
-        java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osxui"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("osxui");
+                    return null;
+                }
+            });
     }
 
     static final Float TRANSLUCENT = new Float(248f/255f);
--- a/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Tue May 01 19:45:34 2012 -0700
@@ -79,7 +79,13 @@
 class MacOSXPreferencesFile {
 
     static {
-        java.security.AccessController.doPrivileged(new sun.security.action.LoadLibraryAction("osx"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("osx");
+                    return null;
+                }
+            });
     }
 
     private class FlushTask extends TimerTask {
--- a/src/macosx/classes/sun/awt/CGraphicsEnvironment.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/sun/awt/CGraphicsEnvironment.java	Tue May 01 19:45:34 2012 -0700
@@ -58,9 +58,15 @@
     public static void init() { }
 
     static {
-        java.security.AccessController.doPrivileged(new sun.security.action.LoadLibraryAction("awt"));
-        java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<Object>() {
-            public Object run() {
+        java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<Void>() {
+            public Void run() {
+                System.loadLibrary("awt");
+                return null;
+            }
+        });
+
+        java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<Void>() {
+            public Void run() {
                 if (isHeadless()) return null;
                 initCocoa();
                 return null;
--- a/src/macosx/classes/sun/lwawt/macosx/CAccessibility.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CAccessibility.java	Tue May 01 19:45:34 2012 -0700
@@ -29,7 +29,6 @@
 import java.beans.*;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
-import java.security.PrivilegedAction;
 import java.util.*;
 import java.util.concurrent.Callable;
 
@@ -41,7 +40,13 @@
 
     static {
         // Need to load the native library for this code.
-        java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("awt"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
     }
 
     static CAccessibility sAccessibility;
--- a/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Tue May 01 19:45:34 2012 -0700
@@ -87,7 +87,12 @@
 
     static {
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("jpeg"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("jpeg");
+                    return null;
+                }
+            });
         initReaderIDs(ImageInputStream.class,
                       JPEGQTable.class,
                       JPEGHuffmanTable.class);
--- a/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Tue May 01 19:45:34 2012 -0700
@@ -177,7 +177,12 @@
 
     static {
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("jpeg"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("jpeg");
+                    return null;
+                }
+            });
         initWriterIDs(ImageOutputStream.class,
                       JPEGQTable.class,
                       JPEGHuffmanTable.class);
--- a/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java	Tue May 01 19:45:34 2012 -0700
@@ -87,7 +87,12 @@
         // If loading from stand alone build uncomment this.
         // System.loadLibrary("unpack");
         java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("unpack"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("unpack");
+                    return null;
+                }
+            });
         initIDs();
     }
 
--- a/src/share/classes/java/awt/SplashScreen.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/java/awt/SplashScreen.java	Tue May 01 19:45:34 2012 -0700
@@ -119,7 +119,12 @@
             // SplashScreen class is now a singleton
             if (!wasClosed && theInstance == null) {
                 java.security.AccessController.doPrivileged(
-                        new sun.security.action.LoadLibraryAction("splashscreen"));
+                    new java.security.PrivilegedAction<Void>() {
+                        public Void run() {
+                            System.loadLibrary("splashscreen");
+                            return null;
+                        }
+                    });
                 long ptr = _getInstance();
                 if (ptr != 0 && _isVisible(ptr)) {
                     theInstance = new SplashScreen(ptr);
--- a/src/share/classes/java/awt/Toolkit.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/java/awt/Toolkit.java	Tue May 01 19:45:34 2012 -0700
@@ -1646,7 +1646,12 @@
     static void loadLibraries() {
         if (!loaded) {
             java.security.AccessController.doPrivileged(
-                          new sun.security.action.LoadLibraryAction("awt"));
+                new java.security.PrivilegedAction<Void>() {
+                    public Void run() {
+                        System.loadLibrary("awt");
+                        return null;
+                    }
+                });
             loaded = true;
         }
     }
--- a/src/share/classes/java/awt/event/NativeLibLoader.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/java/awt/event/NativeLibLoader.java	Tue May 01 19:45:34 2012 -0700
@@ -54,6 +54,11 @@
      */
     static void loadLibraries() {
         java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("awt"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
     }
 }
--- a/src/share/classes/java/awt/image/ColorModel.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/java/awt/image/ColorModel.java	Tue May 01 19:45:34 2012 -0700
@@ -204,7 +204,12 @@
     static void loadLibraries() {
         if (!loaded) {
             java.security.AccessController.doPrivileged(
-                  new sun.security.action.LoadLibraryAction("awt"));
+                new java.security.PrivilegedAction<Void>() {
+                    public Void run() {
+                        System.loadLibrary("awt");
+                        return null;
+                    }
+                });
             loaded = true;
         }
     }
--- a/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java	Tue May 01 19:45:34 2012 -0700
@@ -67,7 +67,12 @@
      */
     static {
         java.security.AccessController.doPrivileged(
-                  new sun.security.action.LoadLibraryAction("net"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("net");
+                    return null;
+                }
+            });
     }
 
     /**
--- a/src/share/classes/java/net/AbstractPlainSocketImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/java/net/AbstractPlainSocketImpl.java	Tue May 01 19:45:34 2012 -0700
@@ -78,7 +78,12 @@
      */
     static {
         java.security.AccessController.doPrivileged(
-                  new sun.security.action.LoadLibraryAction("net"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("net");
+                    return null;
+                }
+            });
     }
 
     /**
--- a/src/share/classes/java/net/DatagramPacket.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/java/net/DatagramPacket.java	Tue May 01 19:45:34 2012 -0700
@@ -47,7 +47,12 @@
      */
     static {
         java.security.AccessController.doPrivileged(
-                  new sun.security.action.LoadLibraryAction("net"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("net");
+                    return null;
+                }
+            });
         init();
     }
 
--- a/src/share/classes/java/net/InetAddress.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/java/net/InetAddress.java	Tue May 01 19:45:34 2012 -0700
@@ -234,7 +234,13 @@
     static {
         preferIPv6Address = java.security.AccessController.doPrivileged(
             new GetBooleanAction("java.net.preferIPv6Addresses")).booleanValue();
-        AccessController.doPrivileged(new LoadLibraryAction("net"));
+        AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("net");
+                    return null;
+                }
+            });
         init();
     }
 
--- a/src/share/classes/java/net/NetworkInterface.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/java/net/NetworkInterface.java	Tue May 01 19:45:34 2012 -0700
@@ -53,7 +53,14 @@
     private static final int defaultIndex; /* index of defaultInterface */
 
     static {
-        AccessController.doPrivileged(new LoadLibraryAction("net"));
+        AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("net");
+                    return null;
+                }
+            });
+
         init();
         defaultInterface = DefaultInterface.getDefault();
         if (defaultInterface != null) {
--- a/src/share/classes/sun/awt/NativeLibLoader.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/awt/NativeLibLoader.java	Tue May 01 19:45:34 2012 -0700
@@ -54,6 +54,11 @@
      */
     static void loadLibraries() {
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("awt"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
     }
 }
--- a/src/share/classes/sun/awt/image/JPEGImageDecoder.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/awt/image/JPEGImageDecoder.java	Tue May 01 19:45:34 2012 -0700
@@ -54,7 +54,12 @@
 
     static {
         java.security.AccessController.doPrivileged(
-                  new sun.security.action.LoadLibraryAction("jpeg"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("jpeg");
+                    return null;
+                }
+            });
         initIDs(InputStreamClass);
         RGBcolormodel = new DirectColorModel(24, 0xff0000, 0xff00, 0xff);
         ARGBcolormodel = ColorModel.getRGBdefault();
--- a/src/share/classes/sun/awt/image/NativeLibLoader.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/awt/image/NativeLibLoader.java	Tue May 01 19:45:34 2012 -0700
@@ -53,7 +53,12 @@
      * that the name of the library is "awt".  -br.
      */
     static void loadLibraries() {
-        java.security.AccessController.doPrivileged
-                (new sun.security.action.LoadLibraryAction("awt"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
     }
 }
--- a/src/share/classes/sun/java2d/Disposer.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/java2d/Disposer.java	Tue May 01 19:45:34 2012 -0700
@@ -57,7 +57,12 @@
 
     static {
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("awt"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
         initIDs();
         String type = (String) java.security.AccessController.doPrivileged(
                 new sun.security.action.GetPropertyAction("sun.java2d.reftype"));
--- a/src/share/classes/sun/management/ManagementFactoryHelper.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/management/ManagementFactoryHelper.java	Tue May 01 19:45:34 2012 -0700
@@ -37,7 +37,6 @@
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
-import sun.security.action.LoadLibraryAction;
 
 import sun.util.logging.LoggingSupport;
 
@@ -422,7 +421,13 @@
     }
 
     static {
-        AccessController.doPrivileged(new LoadLibraryAction("management"));
+        AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("management");
+                    return null;
+                }
+            });
         jvm = new VMManagementImpl();
     }
 
--- a/src/share/classes/sun/net/sdp/SdpSupport.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/net/sdp/SdpSupport.java	Tue May 01 19:45:34 2012 -0700
@@ -76,6 +76,11 @@
 
     static {
         AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("net"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("net");
+                    return null;
+                }
+            });
     }
 }
--- a/src/share/classes/sun/net/spi/DefaultProxySelector.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/net/spi/DefaultProxySelector.java	Tue May 01 19:45:34 2012 -0700
@@ -95,7 +95,12 @@
                 }});
         if (b != null && b.booleanValue()) {
             java.security.AccessController.doPrivileged(
-                      new sun.security.action.LoadLibraryAction("net"));
+                new java.security.PrivilegedAction<Void>() {
+                    public Void run() {
+                        System.loadLibrary("net");
+                        return null;
+                    }
+                });
             hasSystemProxies = init();
         }
     }
--- a/src/share/classes/sun/nio/ch/Util.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/nio/ch/Util.java	Tue May 01 19:45:34 2012 -0700
@@ -472,10 +472,15 @@
             if (loaded)
                 return;
             loaded = true;
-            java.security.AccessController
-                .doPrivileged(new sun.security.action.LoadLibraryAction("net"));
-            java.security.AccessController
-                .doPrivileged(new sun.security.action.LoadLibraryAction("nio"));
+            java.security.AccessController.doPrivileged(
+                new java.security.PrivilegedAction<Void>() {
+                    public Void run() {
+                        System.loadLibrary("net");
+                        System.loadLibrary("nio");
+                        return null;
+                    }
+                });
+
             // IOUtil must be initialized; Its native methods are called from
             // other places in native nio code so they must be set up.
             IOUtil.initIDs();
--- a/src/share/classes/sun/security/action/LoadLibraryAction.java	Tue May 01 11:30:51 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1998, 2006, 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.security.action;
-
-/**
- * A convenience class for loading a system library as a privileged action.
- *
- * <p>An instance of this class can be used as the argument of
- * <code>AccessController.doPrivileged</code>.
- *
- * <p>The following code attempts to load the system library named
- * <code>"lib"</code> as a privileged action: <p>
- *
- * <pre>
- * java.security.AccessController.doPrivileged(new LoadLibraryAction("lib"));
- * </pre>
- *
- * @author Roland Schemers
- * @see java.security.PrivilegedAction
- * @see java.security.AccessController
- * @since 1.2
- */
-
-public class LoadLibraryAction implements java.security.PrivilegedAction<Void> {
-    private String theLib;
-
-    /**
-     * Constructor that takes the name of the system library that needs to be
-     * loaded.
-     *
-     * <p>The manner in which a library name is mapped to the
-     * actual system library is system dependent.
-     *
-     * @param theLib the name of the library.
-     */
-    public LoadLibraryAction(String theLib) {
-        this.theLib = theLib;
-    }
-
-    /**
-     * Loads the system library whose name was specified in the constructor.
-     */
-    public Void run() {
-        System.loadLibrary(theLib);
-        return null;
-    }
-}
--- a/src/share/classes/sun/security/krb5/SCDynamicStoreConfig.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/security/krb5/SCDynamicStoreConfig.java	Tue May 01 19:45:34 2012 -0700
@@ -36,7 +36,13 @@
     private static native Hashtable<String, Object> getKerberosConfig();
 
     static {
-        java.security.AccessController.doPrivileged(new sun.security.action.LoadLibraryAction("osx"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("osx");
+                    return null;
+                }
+            });
         installNotificationCallback();
     }
 
--- a/src/share/classes/sun/security/smartcardio/PCSC.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/security/smartcardio/PCSC.java	Tue May 01 19:45:34 2012 -0700
@@ -27,8 +27,6 @@
 
 import java.security.AccessController;
 
-import sun.security.action.LoadLibraryAction;
-
 /**
  * Access to native PC/SC functions and definition of PC/SC constants.
  * Initialization and platform specific PC/SC constants are handled in
--- a/src/share/classes/sun/tracing/dtrace/JVM.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/share/classes/sun/tracing/dtrace/JVM.java	Tue May 01 19:45:34 2012 -0700
@@ -35,8 +35,13 @@
 class JVM {
 
     static {
-      java.security.AccessController.doPrivileged(
-              new sun.security.action.LoadLibraryAction("jsdt"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("jsdt");
+                    return null;
+                }
+            });
     }
 
     static long activate(String moduleName, DTraceProvider[] providers) {
--- a/src/solaris/classes/sun/management/FileSystemImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/solaris/classes/sun/management/FileSystemImpl.java	Tue May 01 19:45:34 2012 -0700
@@ -48,7 +48,12 @@
     // Initialization
 
     static {
-        java.security.AccessController
-            .doPrivileged(new sun.security.action.LoadLibraryAction("management"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("management");
+                    return null;
+                }
+            });
     }
 }
--- a/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	Tue May 01 19:45:34 2012 -0700
@@ -251,7 +251,12 @@
 
     static {
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("net"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("net");
+                    return null;
+                }
+            });
     }
 
 }
--- a/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java	Tue May 01 19:45:34 2012 -0700
@@ -1100,7 +1100,12 @@
     static {
         Util.load();   /* loads nio & net native libraries */
         java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("sctp"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("sctp");
+                    return null;
+                }
+            });
         initIDs();
     }
 }
--- a/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java	Tue May 01 19:45:34 2012 -0700
@@ -989,6 +989,11 @@
     static {
         Util.load();   /* loads nio & net native libraries */
         java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("sctp"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("sctp");
+                    return null;
+                }
+            });
     }
 }
--- a/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java	Tue May 01 19:45:34 2012 -0700
@@ -428,7 +428,12 @@
     static {
         Util.load();   // loads nio & net native libraries
         java.security.AccessController.doPrivileged(
-                new sun.security.action.LoadLibraryAction("sctp"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("sctp");
+                    return null;
+                }
+            });
         initIDs();
     }
 }
--- a/src/solaris/classes/sun/print/CUPSPrinter.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/solaris/classes/sun/print/CUPSPrinter.java	Tue May 01 19:45:34 2012 -0700
@@ -77,7 +77,12 @@
     static {
         // load awt library to access native code
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("awt"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
         libFound = initIDs();
         if (libFound) {
            cupsServer = getCupsServer();
--- a/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Tue May 01 19:45:34 2012 -0700
@@ -37,8 +37,6 @@
 import java.util.List;
 import java.util.concurrent.*;
 
-import sun.security.action.LoadLibraryAction;
-
 import static sun.awt.shell.Win32ShellFolder2.*;
 import sun.awt.OSInfo;
 
@@ -56,7 +54,13 @@
 
     static {
         // Load library here
-        AccessController.doPrivileged(new LoadLibraryAction("awt"));
+        AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
     }
 
     public ShellFolder createShellFolder(File file) throws FileNotFoundException {
--- a/src/windows/classes/sun/awt/windows/WToolkit.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java	Tue May 01 19:45:34 2012 -0700
@@ -94,7 +94,12 @@
     public static void loadLibraries() {
         if (!loaded) {
             java.security.AccessController.doPrivileged(
-                          new sun.security.action.LoadLibraryAction("awt"));
+                new java.security.PrivilegedAction<Void>() {
+                    public Void run() {
+                        System.loadLibrary("awt");
+                        return null;
+                    }
+                });
             loaded = true;
         }
     }
--- a/src/windows/classes/sun/management/FileSystemImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/windows/classes/sun/management/FileSystemImpl.java	Tue May 01 19:45:34 2012 -0700
@@ -56,8 +56,13 @@
     // Initialization
 
     static {
-        java.security.AccessController
-            .doPrivileged(new sun.security.action.LoadLibraryAction("management"));
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("management");
+                    return null;
+                }
+            });
         init0();
     }
 }
--- a/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java	Tue May 01 19:45:34 2012 -0700
@@ -161,7 +161,12 @@
 
     static {
         java.security.AccessController.doPrivileged(
-            new sun.security.action.LoadLibraryAction("net"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("net");
+                    return null;
+                }
+            });
         init0();
 
         // start the address listener thread
--- a/src/windows/classes/sun/print/Win32PrintServiceLookup.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/windows/classes/sun/print/Win32PrintServiceLookup.java	Tue May 01 19:45:34 2012 -0700
@@ -56,7 +56,12 @@
 
     static {
         java.security.AccessController.doPrivileged(
-                    new sun.security.action.LoadLibraryAction("awt"));
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("awt");
+                    return null;
+                }
+            });
     }
 
     /* The singleton win32 print lookup service.
--- a/src/windows/classes/sun/security/smartcardio/PlatformPCSC.java	Tue May 01 11:30:51 2012 -0700
+++ b/src/windows/classes/sun/security/smartcardio/PlatformPCSC.java	Tue May 01 19:45:34 2012 -0700
@@ -26,8 +26,7 @@
 package sun.security.smartcardio;
 
 import java.security.AccessController;
-
-import sun.security.action.LoadLibraryAction;
+import java.security.PrivilegedAction;
 
 // Platform specific code and constants
 class PlatformPCSC {
@@ -44,7 +43,12 @@
 
     private static Throwable loadLibrary() {
         try {
-            AccessController.doPrivileged(new LoadLibraryAction("j2pcsc"));
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("j2pcsc");
+                    return null;
+                }
+            });
             return null;
         } catch (Throwable e) {
             return e;