8231993: Remove redundant pkg_str param from is_shared_class_visible_for_classloader

Reviewed-by: hseigel, coleenp
This commit is contained in:
Claes Redestad 2019-10-08 15:48:36 +02:00
parent f412bfc34e
commit fe8c0edee0
3 changed files with 3 additions and 8 deletions

@ -1205,10 +1205,8 @@ bool SystemDictionary::is_shared_class_visible(Symbol* class_name,
TempNewSymbol pkg_name = NULL;
PackageEntry* pkg_entry = NULL;
ModuleEntry* mod_entry = NULL;
const char* pkg_string = NULL;
pkg_name = InstanceKlass::package_from_name(class_name, CHECK_false);
if (pkg_name != NULL) {
pkg_string = pkg_name->as_C_string();
if (loader_data != NULL) {
pkg_entry = loader_data->packages()->lookup_only(pkg_name);
}
@ -1245,7 +1243,7 @@ bool SystemDictionary::is_shared_class_visible(Symbol* class_name,
// 3. or, the class is from an unamed module
if (!ent->is_modules_image() && ik->is_shared_boot_class()) {
// the class is from the -Xbootclasspath/a
if (pkg_string == NULL ||
if (pkg_name == NULL ||
pkg_entry == NULL ||
pkg_entry->in_unnamed_module()) {
assert(mod_entry == NULL ||
@ -1257,8 +1255,7 @@ bool SystemDictionary::is_shared_class_visible(Symbol* class_name,
return false;
} else {
bool res = SystemDictionaryShared::is_shared_class_visible_for_classloader(
ik, class_loader, pkg_string, pkg_name,
pkg_entry, mod_entry, CHECK_(false));
ik, class_loader, pkg_name, pkg_entry, mod_entry, CHECK_(false));
return res;
}
}

@ -657,7 +657,6 @@ bool SystemDictionaryShared::is_sharing_possible(ClassLoaderData* loader_data) {
bool SystemDictionaryShared::is_shared_class_visible_for_classloader(
InstanceKlass* ik,
Handle class_loader,
const char* pkg_string,
Symbol* pkg_name,
PackageEntry* pkg_entry,
ModuleEntry* mod_entry,
@ -684,7 +683,7 @@ bool SystemDictionaryShared::is_shared_class_visible_for_classloader(
}
} else if (SystemDictionary::is_system_class_loader(class_loader())) {
assert(ent != NULL, "shared class for system loader should have valid SharedClassPathEntry");
if (pkg_string == NULL) {
if (pkg_name == NULL) {
// The archived class is in the unnamed package. Currently, the boot image
// does not contain any class in the unnamed package.
assert(!ent->is_modules_image(), "Class in the unnamed package must be from the classpath");

@ -240,7 +240,6 @@ public:
static bool is_sharing_possible(ClassLoaderData* loader_data);
static bool is_shared_class_visible_for_classloader(InstanceKlass* ik,
Handle class_loader,
const char* pkg_string,
Symbol* pkg_name,
PackageEntry* pkg_entry,
ModuleEntry* mod_entry,