Skip to content

Commit d04d656

Browse files
committed
8296433: Encountered null CLD while loading shared lambda proxy class
Reviewed-by: iklam, dholmes
1 parent 74f2b16 commit d04d656

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/hotspot/share/classfile/systemDictionary.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,19 +1170,19 @@ InstanceKlass* SystemDictionary::load_shared_lambda_proxy_class(InstanceKlass* i
11701170
assert(s->is_shared(), "must be");
11711171
}
11721172

1173-
// The lambda proxy class and its nest host have the same class loader and class loader data,
1174-
// as verified in SystemDictionaryShared::add_lambda_proxy_class()
1175-
assert(shared_nest_host->class_loader() == class_loader(), "mismatched class loader");
1176-
assert(shared_nest_host->class_loader_data() == ClassLoaderData::class_loader_data(class_loader()), "mismatched class loader data");
1177-
ik->set_nest_host(shared_nest_host);
1178-
11791173
InstanceKlass* loaded_ik = load_shared_class(ik, class_loader, protection_domain, NULL, pkg_entry, CHECK_NULL);
11801174

11811175
if (loaded_ik != NULL) {
11821176
assert(shared_nest_host->is_same_class_package(ik),
11831177
"lambda proxy class and its nest host must be in the same package");
11841178
}
11851179

1180+
// The lambda proxy class and its nest host have the same class loader and class loader data,
1181+
// as verified in SystemDictionaryShared::add_lambda_proxy_class()
1182+
assert(shared_nest_host->class_loader() == class_loader(), "mismatched class loader");
1183+
assert(shared_nest_host->class_loader_data() == ClassLoaderData::class_loader_data(class_loader()), "mismatched class loader data");
1184+
ik->set_nest_host(shared_nest_host);
1185+
11861186
return loaded_ik;
11871187
}
11881188

src/hotspot/share/oops/instanceKlass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ void InstanceKlass::set_nest_host(InstanceKlass* host) {
387387
_nest_host = host;
388388
// Record dependency to keep nest host from being unloaded before this class.
389389
ClassLoaderData* this_key = class_loader_data();
390+
assert(this_key != NULL, "sanity");
390391
this_key->record_dependency(host);
391392
}
392393

0 commit comments

Comments
 (0)