src/hotspot/share/memory/filemap.cpp
changeset 52562 3a9384c12260
parent 52514 f4e3900c8d08
child 52596 dfa02b3f728c
--- a/src/hotspot/share/memory/filemap.cpp	Wed Nov 14 12:25:15 2018 -0800
+++ b/src/hotspot/share/memory/filemap.cpp	Wed Nov 14 18:49:02 2018 -0500
@@ -287,6 +287,12 @@
                                  " the shared archive file: %s", name);
     }
   }
+
+  if (PrintSharedArchiveAndExit && !ok) {
+    // If PrintSharedArchiveAndExit is enabled, don't report failure to the
+    // caller. Please see above comments for more details.
+    ok = true;
+  }
   return ok;
 }
 
@@ -479,16 +485,17 @@
     if (i < module_paths_start_index) {
       if (shared_path(i)->validate()) {
         log_info(class, path)("ok");
+      } else {
+        assert(!UseSharedSpaces, "UseSharedSpaces should be disabled");
+        return false;
       }
     } else if (i >= module_paths_start_index) {
       if (shared_path(i)->validate(false /* not a class path entry */)) {
         log_info(class, path)("ok");
+      } else {
+        assert(!UseSharedSpaces, "UseSharedSpaces should be disabled");
+        return false;
       }
-    } else if (!PrintSharedArchiveAndExit) {
-      _validating_shared_path_table = false;
-      _shared_path_table = NULL;
-      _shared_path_table_size = 0;
-      return false;
     }
   }