--- a/hotspot/src/share/vm/memory/filemap.cpp Tue Nov 18 15:25:14 2014 -0800
+++ b/hotspot/src/share/vm/memory/filemap.cpp Wed Dec 03 14:21:14 2014 +0000
@@ -217,9 +217,14 @@
EXCEPTION_MARK; // The following call should never throw, but would exit VM on error.
SharedClassUtil::update_shared_classpath(cpe, ent, st.st_mtime, st.st_size, THREAD);
} else {
- ent->_filesize = -1;
- if (!os::dir_is_empty(name)) {
- ClassLoader::exit_with_path_failure("Cannot have non-empty directory in archived classpaths", name);
+ struct stat st;
+ if ((os::stat(name, &st) == 0) && ((st.st_mode & S_IFDIR) == S_IFDIR)) {
+ if (!os::dir_is_empty(name)) {
+ ClassLoader::exit_with_path_failure("Cannot have non-empty directory in archived classpaths", name);
+ }
+ ent->_filesize = -1;
+ } else {
+ ent->_filesize = -2;
}
}
ent->_name = strptr;
@@ -271,7 +276,7 @@
fail_continue("directory is not empty: %s", name);
ok = false;
}
- } else {
+ } else if (ent->is_jar()) {
if (ent->_timestamp != st.st_mtime ||
ent->_filesize != st.st_size) {
ok = false;