< prev index next >

src/hotspot/share/classfile/sharedPathsMiscInfo.cpp

Print this page

@@ -87,20 +87,20 @@
   return false;
 }
 
 void SharedPathsMiscInfo::print_path(outputStream* out, int type, const char* path) {
   switch (type) {
-  case BOOT:
+  case BOOT_PATH:
     out->print("Expecting BOOT path=%s", path);
     break;
   case NON_EXIST:
     out->print("Expecting that %s does not exist", path);
     break;
-  case APP:
+  case APP_PATH:
     ClassLoader::trace_class_path("Expecting -Djava.class.path=", path);
     break;
-  case MODULE:
+  case MODULE_PATH:
     ClassLoader::trace_class_path("Checking module path: ", path);
     break;
   default:
     ShouldNotReachHere();
   }

@@ -143,11 +143,11 @@
   return true;
 }
 
 bool SharedPathsMiscInfo::check(jint type, const char* path) {
   switch (type) {
-  case BOOT:
+  case BOOT_PATH:
     // In the future we should perform the check based on the content of the mapped archive.
     if (os::file_name_strcmp(path, Arguments::get_sysclasspath()) != 0) {
       return fail("[BOOT classpath mismatch, actual =", Arguments::get_sysclasspath());
     }
     break;

@@ -159,11 +159,11 @@
         // But we want it to not exist -> fail
         return fail("File must not exist");
       }
     }
     break;
-  case APP:
+  case APP_PATH:
     {
       // Prefix is OK: E.g., dump with -cp foo.jar, but run with -cp foo.jar:bar.jar
       size_t len = strlen(path);
       const char *appcp = Arguments::get_appclasspath();
       assert(appcp != NULL, "NULL app classpath");

@@ -186,11 +186,17 @@
       if (appcp[len] != '\0' && appcp[len] != os::path_separator()[0]) {
         return fail("Dump time APP classpath is not a proper prefix of run time APP classpath: ", appcp);
       }
     }
     break;
-    // FIXME: why is there no MODULE check?
+  case MODULE_PATH:
+    // The path check for archived module classes is handled differently than the classes
+    // from the -cp or -Xbootclasspath/a because we can quickly determine if an archived
+    // module class's origin matches with the runtime module source path (see
+    // SystemDictionaryShared::is_shared_class_visible_for_classloader()). No need to
+    // do strict string matching here.
+    ShouldNotReachHere();
   default:
     return fail("Corrupted archive file header");
   }
 
   return true;
< prev index next >