changeset 10836:2d3e5573286d

8081674: EmptyStackException at startup if running with extended or unsupported charset Reviewed-by: mchung, alanb
author simonis
date Wed, 10 Jun 2015 16:55:13 +0200
parents 6e664b10484e
children db619b622d98
files make/mapfiles/libjava/mapfile-vers src/share/classes/java/lang/ClassLoader.java src/share/native/java/lang/ClassLoader.c
diffstat 3 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/make/mapfiles/libjava/mapfile-vers	Mon Jun 15 14:43:31 2015 +0300
+++ b/make/mapfiles/libjava/mapfile-vers	Wed Jun 10 16:55:13 2015 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2015, 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
@@ -128,12 +128,12 @@
 		Java_java_lang_ClassLoader_defineClass0;
 		Java_java_lang_ClassLoader_defineClass1;
 		Java_java_lang_ClassLoader_defineClass2;
+		Java_java_lang_ClassLoader_findBuiltinLib;
 		Java_java_lang_ClassLoader_findLoadedClass0;
 		Java_java_lang_ClassLoader_resolveClass0;
 		Java_java_lang_ClassLoader_00024NativeLibrary_find;
 		Java_java_lang_ClassLoader_00024NativeLibrary_load;
 		Java_java_lang_ClassLoader_00024NativeLibrary_unload;
-		Java_java_lang_ClassLoader_00024NativeLibrary_findBuiltinLib;
 		Java_java_lang_ClassLoader_registerNatives;
 		Java_java_lang_Compiler_registerNatives;
 		Java_java_lang_Double_longBitsToDouble;
--- a/src/share/classes/java/lang/ClassLoader.java	Mon Jun 15 14:43:31 2015 +0300
+++ b/src/share/classes/java/lang/ClassLoader.java	Wed Jun 10 16:55:13 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -1724,7 +1724,6 @@
 
         native long find(String name);
         native void unload(String name, boolean isBuiltin);
-        static native String findBuiltinLib(String name);
 
         public NativeLibrary(Class<?> fromClass, String name, boolean isBuiltin) {
             this.name = name;
@@ -1865,9 +1864,11 @@
         throw new UnsatisfiedLinkError("no " + name + " in java.library.path");
     }
 
+    private static native String findBuiltinLib(String name);
+
     private static boolean loadLibrary0(Class<?> fromClass, final File file) {
         // Check to see if we're attempting to access a static library
-        String name = NativeLibrary.findBuiltinLib(file.getName());
+        String name = findBuiltinLib(file.getName());
         boolean isBuiltin = (name != null);
         if (!isBuiltin) {
             boolean exists = AccessController.doPrivileged(
--- a/src/share/native/java/lang/ClassLoader.c	Mon Jun 15 14:43:31 2015 +0300
+++ b/src/share/native/java/lang/ClassLoader.c	Wed Jun 10 16:55:13 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -493,12 +493,12 @@
     return res;
 }
 /*
- * Class:     java_lang_ClassLoader_NativeLibrary
+ * Class:     java_lang_ClassLoader
  * Method:    findBuiltinLib
  * Signature: (Ljava/lang/String;)Ljava/lang/String;
  */
 JNIEXPORT jstring JNICALL
-Java_java_lang_ClassLoader_00024NativeLibrary_findBuiltinLib
+Java_java_lang_ClassLoader_findBuiltinLib
   (JNIEnv *env, jclass cls, jstring name)
 {
     const char *cname;
@@ -514,8 +514,6 @@
         JNU_ThrowInternalError(env, "NULL filename for native library");
         return NULL;
     }
-    // Can't call initIDs because it will recurse into NativeLibrary via
-    // FindClass to check context so set prochandle here as well.
     procHandle = getProcessHandle();
     cname = JNU_GetStringPlatformChars(env, name, 0);
     if (cname == NULL) {