提交 c95c0d97 编写于 作者: S simonis

8081674: EmptyStackException at startup if running with extended or unsupported charset

Reviewed-by: mchung, alanb
上级 faa67858
#
# 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 @@ SUNWprivate_1.1 {
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;
......
/*
* 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 @@ public abstract class ClassLoader {
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 @@ public abstract class ClassLoader {
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(
......
/*
* 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 @@ Java_java_lang_ClassLoader_00024NativeLibrary_find
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 @@ Java_java_lang_ClassLoader_00024NativeLibrary_findBuiltinLib
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册