OpenJDK / bsd-port / bsd-port / jdk
changeset 4904:7929ac999cde
7134690: remove legacy jnilib support from ClassLoader and System [macosx]
Reviewed-by: alanb
author | michaelm |
---|---|
date | Mon, 30 Jan 2012 07:43:40 +0000 |
parents | 789287639365 |
children | 63b6953bbcfa |
files | src/share/classes/java/lang/ClassLoader.java src/share/classes/java/lang/System.java |
diffstat | 2 files changed, 0 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/java/lang/ClassLoader.java Mon Jan 30 07:37:43 2012 +0000 +++ b/src/share/classes/java/lang/ClassLoader.java Mon Jan 30 07:43:40 2012 +0000 @@ -1846,12 +1846,6 @@ if (loadLibrary0(fromClass, libfile)) { return; } - for (String libname : System.mapLegacyLibraryNames(name)) { - libfile = new File(sys_paths[i], libname); - if (loadLibrary0(fromClass, libfile)) { - return; - } - } } if (loader != null) { for (int i = 0 ; i < usr_paths.length ; i++) { @@ -1860,12 +1854,6 @@ if (loadLibrary0(fromClass, libfile)) { return; } - for (String libname : System.mapLegacyLibraryNames(name)) { - libfile = new File(usr_paths[i], libname); - if (loadLibrary0(fromClass, libfile)) { - return; - } - } } } // Oops, it failed
--- a/src/share/classes/java/lang/System.java Mon Jan 30 07:37:43 2012 +0000 +++ b/src/share/classes/java/lang/System.java Mon Jan 30 07:43:40 2012 +0000 @@ -1098,26 +1098,6 @@ */ public static native String mapLibraryName(String libname); - static boolean systemUsesJnilib; - /** - * On platforms which have a different legacy name for libraries - * (such that mapLibraryName is inappropriate, because it can't tell - * which to use), returns an array of possible alternate library names. - * - * This exists entirely for the benefit of ClassLoader and should not - * be used directly. - */ - static String []mapLegacyLibraryNames(String libname) { - if (!systemUsesJnilib) - return new String[0]; - - String mappedName = mapLibraryName(libname); - String names[] = new String[1]; - names[0] = mappedName.substring(0, mappedName.lastIndexOf("dylib")) + "jnilib"; - - return names; - } - /** * Initialize the system class. Called after thread initialization. */ @@ -1183,12 +1163,6 @@ Thread current = Thread.currentThread(); current.getThreadGroup().add(current); - // Cache systemUsesJnilib, which needs to be set after initProperties - // is called. This is done to avoid slowing down mapLegacyLibraryNames - // for the uncommon case of it having to return something. - String osName = System.getProperty("os.name"); - systemUsesJnilib = osName.startsWith("Mac OS X") || osName.startsWith("Darwin"); - // register shared secrets setJavaLangAccess(); }