22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "jvm.h" |
26 #include "jvm.h" |
|
27 #include "classfile/javaClasses.hpp" |
27 #include "classfile/systemDictionary.hpp" |
28 #include "classfile/systemDictionary.hpp" |
28 #include "classfile/vmSymbols.hpp" |
29 #include "classfile/vmSymbols.hpp" |
29 #include "interpreter/linkResolver.hpp" |
30 #include "interpreter/linkResolver.hpp" |
30 #include "logging/log.hpp" |
31 #include "logging/log.hpp" |
31 #include "logging/logStream.hpp" |
32 #include "logging/logStream.hpp" |
504 SystemDictionary::check_signature_loaders(signature, target_loader, |
505 SystemDictionary::check_signature_loaders(signature, target_loader, |
505 super_loader, true, |
506 super_loader, true, |
506 CHECK_(false)); |
507 CHECK_(false)); |
507 if (failed_type_symbol != NULL) { |
508 if (failed_type_symbol != NULL) { |
508 const char* msg = "loader constraint violation for class %s: when selecting " |
509 const char* msg = "loader constraint violation for class %s: when selecting " |
509 "overriding method \"%s\" the class loader (instance of %s) of the " |
510 "overriding method %s the class loader %s of the " |
510 "selected method's type %s, and the class loader (instance of %s) for its super " |
511 "selected method's type %s, and the class loader %s for its super " |
511 "type %s have different Class objects for the type %s used in the signature"; |
512 "type %s have different Class objects for the type %s used in the signature"; |
512 char* curr_class = klass->name()->as_C_string(); |
513 const char* curr_class = klass->external_name(); |
513 char* sig = target_method()->name_and_sig_as_C_string(); |
514 const char* method = target_method()->name_and_sig_as_C_string(); |
514 const char* loader1 = SystemDictionary::loader_name(target_loader()); |
515 const char* loader1 = java_lang_ClassLoader::describe_external(target_loader()); |
515 char* sel_class = target_klass->name()->as_C_string(); |
516 const char* sel_class = target_klass->external_name(); |
516 const char* loader2 = SystemDictionary::loader_name(super_loader()); |
517 const char* loader2 = java_lang_ClassLoader::describe_external(super_loader()); |
517 char* super_class = super_klass->name()->as_C_string(); |
518 const char* super_class = super_klass->external_name(); |
518 char* failed_type_name = failed_type_symbol->as_C_string(); |
519 const char* failed_type_name = failed_type_symbol->as_klass_external_name(); |
519 size_t buflen = strlen(msg) + strlen(curr_class) + strlen(sig) + |
520 size_t buflen = strlen(msg) + strlen(curr_class) + strlen(method) + |
520 strlen(loader1) + strlen(sel_class) + strlen(loader2) + |
521 strlen(loader1) + strlen(sel_class) + strlen(loader2) + |
521 strlen(super_class) + strlen(failed_type_name); |
522 strlen(super_class) + strlen(failed_type_name); |
522 char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen); |
523 char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen); |
523 jio_snprintf(buf, buflen, msg, curr_class, sig, loader1, sel_class, loader2, |
524 jio_snprintf(buf, buflen, msg, curr_class, method, loader1, sel_class, loader2, |
524 super_class, failed_type_name); |
525 super_class, failed_type_name); |
525 THROW_MSG_(vmSymbols::java_lang_LinkageError(), buf, false); |
526 THROW_MSG_(vmSymbols::java_lang_LinkageError(), buf, false); |
526 } |
527 } |
527 } |
528 } |
528 } |
529 } |
1234 method_holder_loader, |
1235 method_holder_loader, |
1235 interface_loader, |
1236 interface_loader, |
1236 true, CHECK); |
1237 true, CHECK); |
1237 if (failed_type_symbol != NULL) { |
1238 if (failed_type_symbol != NULL) { |
1238 const char* msg = "loader constraint violation in interface itable" |
1239 const char* msg = "loader constraint violation in interface itable" |
1239 " initialization for class %s: when selecting method \"%s\" the" |
1240 " initialization for class %s: when selecting method %s the" |
1240 " class loader (instance of %s) for super interface %s, and the class" |
1241 " class loader %s for super interface %s, and the class" |
1241 " loader (instance of %s) of the selected method's type, %s have" |
1242 " loader %s of the selected method's type, %s have" |
1242 " different Class objects for the type %s used in the signature"; |
1243 " different Class objects for the type %s used in the signature"; |
1243 char* current = _klass->name()->as_C_string(); |
1244 const char* current = _klass->external_name(); |
1244 char* sig = m->name_and_sig_as_C_string(); |
1245 const char* sig = m->name_and_sig_as_C_string(); |
1245 const char* loader1 = SystemDictionary::loader_name(interface_loader()); |
1246 const char* loader1 = java_lang_ClassLoader::describe_external(interface_loader()); |
1246 char* iface = InstanceKlass::cast(interf)->name()->as_C_string(); |
1247 const char* iface = InstanceKlass::cast(interf)->external_name(); |
1247 const char* loader2 = SystemDictionary::loader_name(method_holder_loader()); |
1248 const char* loader2 = java_lang_ClassLoader::describe_external(method_holder_loader()); |
1248 char* mclass = target()->method_holder()->name()->as_C_string(); |
1249 const char* mclass = target()->method_holder()->external_name(); |
1249 char* failed_type_name = failed_type_symbol->as_C_string(); |
1250 const char* failed_type_name = failed_type_symbol->as_klass_external_name(); |
1250 size_t buflen = strlen(msg) + strlen(current) + strlen(sig) + |
1251 size_t buflen = strlen(msg) + strlen(current) + strlen(sig) + |
1251 strlen(loader1) + strlen(iface) + strlen(loader2) + strlen(mclass) + |
1252 strlen(loader1) + strlen(iface) + strlen(loader2) + strlen(mclass) + |
1252 strlen(failed_type_name); |
1253 strlen(failed_type_name); |
1253 char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen); |
1254 char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen); |
1254 jio_snprintf(buf, buflen, msg, current, sig, loader1, iface, |
1255 jio_snprintf(buf, buflen, msg, current, sig, loader1, iface, |