590 true, false, CHECK); |
590 true, false, CHECK); |
591 // Any existing exceptions that may have been thrown, for example LinkageErrors |
591 // Any existing exceptions that may have been thrown, for example LinkageErrors |
592 // from nest-host resolution, have been allowed to propagate. |
592 // from nest-host resolution, have been allowed to propagate. |
593 if (!can_access) { |
593 if (!can_access) { |
594 ResourceMark rm(THREAD); |
594 ResourceMark rm(THREAD); |
|
595 bool same_module = (sel_klass->module() == ref_klass->module()); |
595 Exceptions::fthrow( |
596 Exceptions::fthrow( |
596 THREAD_AND_LOCATION, |
597 THREAD_AND_LOCATION, |
597 vmSymbols::java_lang_IllegalAccessError(), |
598 vmSymbols::java_lang_IllegalAccessError(), |
598 "tried to access method %s.%s%s from class %s", |
599 "class %s tried to access method %s.%s%s (%s%s%s)", |
|
600 ref_klass->external_name(), |
599 sel_klass->external_name(), |
601 sel_klass->external_name(), |
600 sel_method->name()->as_C_string(), |
602 sel_method->name()->as_C_string(), |
601 sel_method->signature()->as_C_string(), |
603 sel_method->signature()->as_C_string(), |
602 ref_klass->external_name() |
604 (same_module) ? ref_klass->joint_in_module_of_loader(sel_klass) : ref_klass->class_in_module_of_loader(), |
|
605 (same_module) ? "" : "; ", |
|
606 (same_module) ? "" : sel_klass->class_in_module_of_loader() |
603 ); |
607 ); |
604 return; |
608 return; |
605 } |
609 } |
606 } |
610 } |
607 |
611 |