8166931: Do not include classes which are unusable during run time in the classlist file

Added check to exclude classes found in the --patch-module list

Reviewed-by: jiangli, lfoltan, iklam
This commit is contained in:
Calvin Cheung 2016-10-18 16:15:03 -07:00
parent 3b1fe56bf5
commit c5dc50c03f
4 changed files with 161 additions and 6 deletions

View file

@ -945,11 +945,11 @@ ClassPathZipEntry* ClassLoader::create_class_path_zip_entry(const char *path, bo
}
// returns true if entry already on class path
bool ClassLoader::contains_entry(ClassPathEntry *entry) {
bool ClassLoader::contains_append_entry(const char* name) {
ClassPathEntry* e = _first_append_entry;
while (e != NULL) {
// assume zip entries have been canonicalized
if (strcmp(entry->name(), e->name()) == 0) {
if (strcmp(name, e->name()) == 0) {
return true;
}
e = e->next();
@ -991,7 +991,7 @@ bool ClassLoader::update_class_path_entry_list(const char *path,
// Do not reorder the bootclasspath which would break get_system_package().
// Add new entry to linked list
if (!check_for_duplicates || !contains_entry(new_entry)) {
if (!check_for_duplicates || !contains_append_entry(new_entry->name())) {
ClassLoaderExt::add_class_path_entry(path, check_for_duplicates, new_entry);
}
return true;