8203400: Fix issue with "8199852: Print more information about class loaders in LinkageErrors."
Reviewed-by: dholmes, lfoltan
--- a/src/hotspot/share/classfile/javaClasses.cpp Fri May 18 08:43:49 2018 -0300
+++ b/src/hotspot/share/classfile/javaClasses.cpp Fri May 18 10:59:04 2018 +0200
@@ -4134,9 +4134,9 @@
oop parentNameOop = java_lang_ClassLoader::name(pl);
if (parentNameOop != NULL) {
parentName = java_lang_String::as_utf8_string(parentNameOop);
- if (parentName == NULL) {
- parentName = "<unnamed>";
- }
+ }
+ if (parentName == NULL) {
+ parentName = "<unnamed>";
}
ss.print(", child of \"%s\" %s", parentName, pl->klass()->external_name());
} else {
--- a/src/hotspot/share/classfile/systemDictionary.cpp Fri May 18 08:43:49 2018 -0300
+++ b/src/hotspot/share/classfile/systemDictionary.cpp Fri May 18 10:59:04 2018 +0200
@@ -2120,14 +2120,8 @@
stringStream ss;
bool throwException = false;
- const char *linkage_error1 = NULL;
- const char *linkage_error2 = NULL;
- const char *linkage_error3 = "";
- // Remember the loader of the similar class that is already loaded.
- const char *existing_klass_loader_name = "";
-
{
- Symbol* name = k->name();
+ Symbol *name = k->name();
ClassLoaderData *loader_data = class_loader_data(class_loader);
MutexLocker mu(SystemDictionary_lock, THREAD);