changeset 50760:0cc29ebee3f9

8203400: Fix issue with "8199852: Print more information about class loaders in LinkageErrors." Reviewed-by: dholmes, lfoltan
author goetz
date Fri, 18 May 2018 10:59:04 +0200
parents 589ed2770141
children 9806f23d5e5e
files src/hotspot/share/classfile/javaClasses.cpp src/hotspot/share/classfile/systemDictionary.cpp
diffstat 2 files changed, 4 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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);