< prev index next >

src/hotspot/share/oops/klassVtable.cpp

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

@@ -502,19 +502,19 @@
               SystemDictionary::check_signature_loaders(signature, target_loader,
                                                         super_loader, true,
                                                         CHECK_(false));
             if (failed_type_symbol != NULL) {
               const char* msg = "loader constraint violation for class %s: when selecting "
-                "overriding method \"%s\" the class loader (instance of %s) of the "
-                "selected method's type %s, and the class loader (instance of %s) for its super "
+                "overriding method %s the class loader %s of the "
+                "selected method's type %s, and the class loader %s for its super "
                 "type %s have different Class objects for the type %s used in the signature";
-              char* curr_class = klass->name()->as_C_string();
-              char* sig = target_method()->name_and_sig_as_C_string();
-              const char* loader1 = SystemDictionary::loader_name(target_loader());
-              char* sel_class = target_klass->name()->as_C_string();
-              const char* loader2 = SystemDictionary::loader_name(super_loader());
-              char* super_class = super_klass->name()->as_C_string();
+              const char* curr_class = klass->external_name();
+              const char* sig = target_method()->name_and_sig_as_C_string();
+              const char* loader1 = java_lang_ClassLoader::describe_external(target_loader());
+              const char* sel_class = target_klass->external_name();
+              const char* loader2 = java_lang_ClassLoader::describe_external(super_loader());
+              const char* super_class = super_klass->external_name();
               char* failed_type_name = failed_type_symbol->as_C_string();
               size_t buflen = strlen(msg) + strlen(curr_class) + strlen(sig) +
                 strlen(loader1) + strlen(sel_class) + strlen(loader2) +
                 strlen(super_class) + strlen(failed_type_name);
               char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen);

@@ -1232,21 +1232,21 @@
                                                       method_holder_loader,
                                                       interface_loader,
                                                       true, CHECK);
           if (failed_type_symbol != NULL) {
             const char* msg = "loader constraint violation in interface itable"
-              " initialization for class %s: when selecting method \"%s\" the"
-              " class loader (instance of %s) for super interface %s, and the class"
-              " loader (instance of %s) of the selected method's type, %s have"
+              " initialization for class %s: when selecting method %s the"
+              " class loader %s for super interface %s, and the class"
+              " loader %s of the selected method's type, %s have"
               " different Class objects for the type %s used in the signature";
-            char* current = _klass->name()->as_C_string();
-            char* sig = m->name_and_sig_as_C_string();
-            const char* loader1 = SystemDictionary::loader_name(interface_loader());
-            char* iface = InstanceKlass::cast(interf)->name()->as_C_string();
-            const char* loader2 = SystemDictionary::loader_name(method_holder_loader());
-            char* mclass = target()->method_holder()->name()->as_C_string();
-            char* failed_type_name = failed_type_symbol->as_C_string();
+            const char* current = _klass->external_name();
+            const char* sig = m->name_and_sig_as_C_string();
+            const char* loader1 = java_lang_ClassLoader::describe_external(interface_loader());
+            const char* iface = InstanceKlass::cast(interf)->external_name();
+            const char* loader2 = java_lang_ClassLoader::describe_external(method_holder_loader());
+            const char* mclass = target()->method_holder()->external_name();
+            const char* failed_type_name = failed_type_symbol->as_C_string();
             size_t buflen = strlen(msg) + strlen(current) + strlen(sig) +
               strlen(loader1) + strlen(iface) + strlen(loader2) + strlen(mclass) +
               strlen(failed_type_name);
             char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen);
             jio_snprintf(buf, buflen, msg, current, sig, loader1, iface,
< prev index next >