src/hotspot/share/classfile/systemDictionary.cpp
changeset 47673 6126617b8508
parent 47614 0ecfd6c951a6
child 47761 1b0566927c7a
equal deleted inserted replaced
47672:50aa24ce898c 47673:6126617b8508
  1248     }
  1248     }
  1249   }
  1249   }
  1250   SharedClassPathEntry* ent =
  1250   SharedClassPathEntry* ent =
  1251             (SharedClassPathEntry*)FileMapInfo::shared_classpath(path_index);
  1251             (SharedClassPathEntry*)FileMapInfo::shared_classpath(path_index);
  1252   if (!Universe::is_module_initialized()) {
  1252   if (!Universe::is_module_initialized()) {
  1253     assert(ent != NULL && ent->is_jrt(),
  1253     assert(ent != NULL && ent->is_modules_image(),
  1254            "Loading non-bootstrap classes before the module system is initialized");
  1254            "Loading non-bootstrap classes before the module system is initialized");
  1255     assert(class_loader.is_null(), "sanity");
  1255     assert(class_loader.is_null(), "sanity");
  1256     return true;
  1256     return true;
  1257   }
  1257   }
  1258   // Get the pkg_entry from the classloader
  1258   // Get the pkg_entry from the classloader
  1284     // "modules" jimage, the PackageEntry/ModuleEntry must be defined
  1284     // "modules" jimage, the PackageEntry/ModuleEntry must be defined
  1285     // by the NULL classloader.
  1285     // by the NULL classloader.
  1286     if (mod_entry != NULL) {
  1286     if (mod_entry != NULL) {
  1287       // PackageEntry/ModuleEntry is found in the classloader. Check if the
  1287       // PackageEntry/ModuleEntry is found in the classloader. Check if the
  1288       // ModuleEntry's location agrees with the archived class' origination.
  1288       // ModuleEntry's location agrees with the archived class' origination.
  1289       if (ent->is_jrt() && mod_entry->location()->starts_with("jrt:")) {
  1289       if (ent->is_modules_image() && mod_entry->location()->starts_with("jrt:")) {
  1290         return true; // Module class from the "module" jimage
  1290         return true; // Module class from the "module" jimage
  1291       }
  1291       }
  1292     }
  1292     }
  1293 
  1293 
  1294     // If the archived class is not from the "module" jimage, the class can be
  1294     // If the archived class is not from the "module" jimage, the class can be
  1295     // loaded by the NULL classloader if
  1295     // loaded by the NULL classloader if
  1296     //
  1296     //
  1297     // 1. the class is from the unamed package
  1297     // 1. the class is from the unamed package
  1298     // 2. or, the class is not from a module defined in the NULL classloader
  1298     // 2. or, the class is not from a module defined in the NULL classloader
  1299     // 3. or, the class is from an unamed module
  1299     // 3. or, the class is from an unamed module
  1300     if (!ent->is_jrt() && ik->is_shared_boot_class()) {
  1300     if (!ent->is_modules_image() && ik->is_shared_boot_class()) {
  1301       // the class is from the -Xbootclasspath/a
  1301       // the class is from the -Xbootclasspath/a
  1302       if (pkg_string == NULL ||
  1302       if (pkg_string == NULL ||
  1303           pkg_entry == NULL ||
  1303           pkg_entry == NULL ||
  1304           pkg_entry->in_unnamed_module()) {
  1304           pkg_entry->in_unnamed_module()) {
  1305         assert(mod_entry == NULL ||
  1305         assert(mod_entry == NULL ||