7164376: Replace use of sun.security.action.LoadLibraryAction with System.loadLibrary
authormchung
Tue, 01 May 2012 19:45:34 -0700
changeset 12559 9456ceada8b1
parent 12558 9a300e0567f7
child 12560 069c9358158b
7164376: Replace use of sun.security.action.LoadLibraryAction with System.loadLibrary Reviewed-by: alanb, mullan, prr
jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java
jdk/src/macosx/classes/apple/security/KeychainStore.java
jdk/src/macosx/classes/com/apple/concurrent/LibDispatchNative.java
jdk/src/macosx/classes/com/apple/eawt/Application.java
jdk/src/macosx/classes/com/apple/eio/FileManager.java
jdk/src/macosx/classes/com/apple/laf/AquaFileView.java
jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java
jdk/src/macosx/classes/com/apple/laf/AquaNativeResources.java
jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java
jdk/src/macosx/classes/com/apple/laf/ScreenPopupFactory.java
jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java
jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java
jdk/src/macosx/classes/sun/lwawt/macosx/CAccessibility.java
jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java
jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java
jdk/src/share/classes/java/awt/SplashScreen.java
jdk/src/share/classes/java/awt/Toolkit.java
jdk/src/share/classes/java/awt/event/NativeLibLoader.java
jdk/src/share/classes/java/awt/image/ColorModel.java
jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java
jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java
jdk/src/share/classes/java/net/DatagramPacket.java
jdk/src/share/classes/java/net/InetAddress.java
jdk/src/share/classes/java/net/NetworkInterface.java
jdk/src/share/classes/sun/awt/NativeLibLoader.java
jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java
jdk/src/share/classes/sun/awt/image/NativeLibLoader.java
jdk/src/share/classes/sun/java2d/Disposer.java
jdk/src/share/classes/sun/management/ManagementFactoryHelper.java
jdk/src/share/classes/sun/net/sdp/SdpSupport.java
jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java
jdk/src/share/classes/sun/nio/ch/Util.java
jdk/src/share/classes/sun/security/action/LoadLibraryAction.java
jdk/src/share/classes/sun/security/krb5/SCDynamicStoreConfig.java
jdk/src/share/classes/sun/security/smartcardio/PCSC.java
jdk/src/share/classes/sun/tracing/dtrace/JVM.java
jdk/src/solaris/classes/sun/management/FileSystemImpl.java
jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java
jdk/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java
jdk/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java
jdk/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java
jdk/src/solaris/classes/sun/print/CUPSPrinter.java
jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
jdk/src/windows/classes/sun/awt/windows/WToolkit.java
jdk/src/windows/classes/sun/management/FileSystemImpl.java
jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java
jdk/src/windows/classes/sun/print/Win32PrintServiceLookup.java
jdk/src/windows/classes/sun/security/smartcardio/PlatformPCSC.java
--- a/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/apple/security/KeychainStore.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/com/apple/concurrent/LibDispatchNative.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/com/apple/eawt/Application.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/com/apple/eio/FileManager.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/com/apple/laf/AquaFileView.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/com/apple/laf/AquaNativeResources.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/com/apple/laf/ScreenPopupFactory.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/macosx/classes/sun/lwawt/macosx/CAccessibility.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/java/awt/SplashScreen.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/java/awt/Toolkit.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/java/awt/event/NativeLibLoader.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/java/awt/image/ColorModel.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/java/net/DatagramPacket.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/java/net/InetAddress.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/java/net/NetworkInterface.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/sun/awt/NativeLibLoader.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/sun/awt/image/NativeLibLoader.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/sun/java2d/Disposer.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/sun/management/ManagementFactoryHelper.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/sun/net/sdp/SdpSupport.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/sun/nio/ch/Util.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/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/jdk/src/share/classes/sun/security/krb5/SCDynamicStoreConfig.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/sun/security/smartcardio/PCSC.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/share/classes/sun/tracing/dtrace/JVM.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/solaris/classes/sun/management/FileSystemImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/solaris/classes/sun/print/CUPSPrinter.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/windows/classes/sun/awt/windows/WToolkit.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/windows/classes/sun/management/FileSystemImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/windows/classes/sun/print/Win32PrintServiceLookup.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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/jdk/src/windows/classes/sun/security/smartcardio/PlatformPCSC.java	Tue May 01 11:30:51 2012 -0700
+++ b/jdk/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;