8270404: Better canonicalization

Reviewed-by: coleenp, rhalade, mschoene
This commit is contained in:
Harold Seigel 2021-07-26 17:32:18 +00:00 committed by Henry Jen
parent 24b588eddb
commit 76373ae3c8
2 changed files with 19 additions and 0 deletions

View file

@ -3066,6 +3066,18 @@ InstanceKlass* InstanceKlass::compute_enclosing_class(bool* inner_is_member, TRA
constantPoolHandle i_cp(THREAD, constants());
if (ooff != 0) {
Klass* ok = i_cp->klass_at(ooff, CHECK_NULL);
if (!ok->is_instance_klass()) {
// If the outer class is not an instance klass then it cannot have
// declared any inner classes.
ResourceMark rm(THREAD);
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_IncompatibleClassChangeError(),
"%s and %s disagree on InnerClasses attribute",
ok->external_name(),
external_name());
return NULL;
}
outer_klass = InstanceKlass::cast(ok);
*inner_is_member = true;
}