< prev index next >
src/hotspot/share/classfile/classLoader.cpp
Print this page
*** 268,285 ****
int len = jio_snprintf(path, path_len, "%s%s%s", _dir, os::file_separator(), name);
assert(len == (int)(path_len - 1), "sanity");
// check if file exists
struct stat st;
if (os::stat(path, &st) == 0) {
- #if INCLUDE_CDS
- if (DumpSharedSpaces) {
- // We have already check in ClassLoader::check_shared_classpath() that the directory is empty, so
- // we should never find a file underneath it -- unless user has added a new file while we are running
- // the dump, in which case let's quit!
- ShouldNotReachHere();
- }
- #endif
// found file, open it
int file_handle = os::open(path, 0, 0);
if (file_handle != -1) {
// read contents into resource array
u1* buffer = NEW_RESOURCE_ARRAY(u1, st.st_size);
--- 268,277 ----
*** 711,722 ****
ResourceMark rm(THREAD);
char* path = NEW_RESOURCE_ARRAY(char, end - start + 1);
strncpy(path, &class_path[start], end - start);
path[end - start] = '\0';
- check_shared_classpath(path);
-
update_class_path_entry_list(path, false, false);
while (class_path[end] == os::path_separator()[0]) {
end++;
}
--- 703,712 ----
*** 755,765 ****
add_to_module_path_entries(path, new_entry);
return;
}
void ClassLoader::setup_module_search_path(const char* path, TRAPS) {
- check_shared_classpath(path);
update_module_path_entry_list(path, THREAD);
}
#endif // INCLUDE_CDS
// Construct the array of module/path pairs as specified to --patch-module
--- 745,754 ----
*** 884,898 ****
// Every entry on the system boot class path after the initial base piece,
// which is set by os::set_boot_path(), is considered an appended entry.
update_class_path_entry_list(path, false, true);
}
- #if INCLUDE_CDS
- if (DumpSharedSpaces) {
- check_shared_classpath(path);
- }
- #endif
while (class_path[end] == os::path_separator()[0]) {
end++;
}
}
}
--- 873,882 ----
*** 1080,1094 ****
_last_app_classpath_entry = entry;
}
if (entry->is_jar_file()) {
ClassLoaderExt::process_jar_manifest(entry, check_for_duplicates);
- } else {
- if (!os::dir_is_empty(path)) {
- tty->print_cr("Error: non-empty directory '%s'", path);
- exit_with_path_failure("Cannot have non-empty directory in app classpaths", NULL);
- }
}
#endif
}
// Returns true IFF the file/dir exists and the entry was successfully created.
--- 1064,1073 ----
< prev index next >