mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8296433: Encountered null CLD while loading shared lambda proxy class
Reviewed-by: iklam, dholmes
This commit is contained in:
parent
74f2b16a8e
commit
d04d6566b0
2 changed files with 7 additions and 6 deletions
|
@ -1170,12 +1170,6 @@ InstanceKlass* SystemDictionary::load_shared_lambda_proxy_class(InstanceKlass* i
|
|||
assert(s->is_shared(), "must be");
|
||||
}
|
||||
|
||||
// The lambda proxy class and its nest host have the same class loader and class loader data,
|
||||
// as verified in SystemDictionaryShared::add_lambda_proxy_class()
|
||||
assert(shared_nest_host->class_loader() == class_loader(), "mismatched class loader");
|
||||
assert(shared_nest_host->class_loader_data() == ClassLoaderData::class_loader_data(class_loader()), "mismatched class loader data");
|
||||
ik->set_nest_host(shared_nest_host);
|
||||
|
||||
InstanceKlass* loaded_ik = load_shared_class(ik, class_loader, protection_domain, NULL, pkg_entry, CHECK_NULL);
|
||||
|
||||
if (loaded_ik != NULL) {
|
||||
|
@ -1183,6 +1177,12 @@ InstanceKlass* SystemDictionary::load_shared_lambda_proxy_class(InstanceKlass* i
|
|||
"lambda proxy class and its nest host must be in the same package");
|
||||
}
|
||||
|
||||
// The lambda proxy class and its nest host have the same class loader and class loader data,
|
||||
// as verified in SystemDictionaryShared::add_lambda_proxy_class()
|
||||
assert(shared_nest_host->class_loader() == class_loader(), "mismatched class loader");
|
||||
assert(shared_nest_host->class_loader_data() == ClassLoaderData::class_loader_data(class_loader()), "mismatched class loader data");
|
||||
ik->set_nest_host(shared_nest_host);
|
||||
|
||||
return loaded_ik;
|
||||
}
|
||||
|
||||
|
|
|
@ -387,6 +387,7 @@ void InstanceKlass::set_nest_host(InstanceKlass* host) {
|
|||
_nest_host = host;
|
||||
// Record dependency to keep nest host from being unloaded before this class.
|
||||
ClassLoaderData* this_key = class_loader_data();
|
||||
assert(this_key != NULL, "sanity");
|
||||
this_key->record_dependency(host);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue