< prev index next >

src/hotspot/share/interpreter/linkResolver.cpp

Print this page
rev 49271 : 8199852: Print more information about class loaders in LinkageErrors.

@@ -653,17 +653,17 @@
   Symbol* failed_type_symbol =
     SystemDictionary::check_signature_loaders(link_info.signature(), current_loader,
                                               resolved_loader, true, CHECK);
   if (failed_type_symbol != NULL) {
     const char* msg = "loader constraint violation: when resolving %s"
-      " \"%s\" the class loader (instance of %s) of the current class, %s,"
-      " and the class loader (instance of %s) for the method's defining class, %s, have"
+      " \"%s\" the class loader %s of the current class, %s,"
+      " and the class loader %s for the method's defining class, %s, have"
       " different Class objects for the type %s used in the signature";
     char* sig = link_info.method_string();
-    const char* loader1_name = SystemDictionary::loader_name(current_loader());
+    const char* loader1_name = java_lang_ClassLoader::describe_external(current_loader());
     char* current = link_info.current_klass()->name()->as_C_string();
-    const char* loader2_name = SystemDictionary::loader_name(resolved_loader());
+    const char* loader2_name = java_lang_ClassLoader::describe_external(resolved_loader());
     char* target = resolved_method->method_holder()->name()->as_C_string();
     char* failed_type_name = failed_type_symbol->as_C_string();
     size_t buflen = strlen(msg) + strlen(sig) + strlen(loader1_name) +
       strlen(current) + strlen(loader2_name) + strlen(target) +
       strlen(failed_type_name) + strlen(method_type) + 1;

@@ -686,17 +686,17 @@
                                               ref_loader, sel_loader,
                                               false,
                                               CHECK);
   if (failed_type_symbol != NULL) {
     const char* msg = "loader constraint violation: when resolving field"
-      " \"%s\" the class loader (instance of %s) of the referring class, "
-      "%s, and the class loader (instance of %s) for the field's resolved "
+      " \"%s\" the class loader %s of the referring class, "
+      "%s, and the class loader %s for the field's resolved "
       "type, %s, have different Class objects for that type";
     char* field_name = field->as_C_string();
-    const char* loader1_name = SystemDictionary::loader_name(ref_loader());
+    const char* loader1_name = java_lang_ClassLoader::describe_external(ref_loader());
     char* sel = sel_klass->name()->as_C_string();
-    const char* loader2_name = SystemDictionary::loader_name(sel_loader());
+    const char* loader2_name = java_lang_ClassLoader::describe_external(sel_loader());
     char* failed_type_name = failed_type_symbol->as_C_string();
     size_t buflen = strlen(msg) + strlen(field_name) + strlen(loader1_name) +
                     strlen(sel) + strlen(loader2_name) + strlen(failed_type_name) + 1;
     char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen);
     jio_snprintf(buf, buflen, msg, field_name, loader1_name, sel, loader2_name,
< prev index next >