8169559: Add class loader names to relevant VM messages

Added new method class_in_module_of_loader to provide a standard format for class information within error messages.

Reviewed-by: goetz, hseigel, mchung
This commit is contained in:
Lois Foltan 2018-06-25 11:33:11 -04:00
parent fc73803071
commit 7ca4027957
13 changed files with 379 additions and 75 deletions

View file

@ -2850,9 +2850,14 @@ Method* InstanceKlass::method_at_itable(Klass* holder, int index, TRAPS) {
if (cnt >= nof_interfaces) {
ResourceMark rm(THREAD);
stringStream ss;
bool same_module = (module() == holder->module());
ss.print("Receiver class %s does not implement "
"the interface %s defining the method to be called",
class_loader_and_module_name(), holder->class_loader_and_module_name());
"the interface %s defining the method to be called "
"(%s%s%s)",
external_name(), holder->external_name(),
(same_module) ? joint_in_module_of_loader(holder) : class_in_module_of_loader(),
(same_module) ? "" : "; ",
(same_module) ? "" : holder->class_in_module_of_loader());
THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), ss.as_string());
}