< prev index next >

src/hotspot/share/classfile/systemDictionary.cpp

Print this page

@@ -1355,10 +1355,11 @@
 bool SystemDictionary::is_shared_class_visible_impl(Symbol* class_name,
                                                InstanceKlass* ik,
                                                PackageEntry* pkg_entry,
                                                Handle class_loader, TRAPS) {
   int scp_index = ik->shared_classpath_index();
+  assert(!ik->is_shared_unregistered_class(), "this function should be called for built-in classes only");
   assert(scp_index >= 0, "must be");
   SharedClassPathEntry* scp_entry = FileMapInfo::shared_path(scp_index);
   if (!Universe::is_module_initialized()) {
     assert(scp_entry != NULL && scp_entry->is_modules_image(),
            "Loading non-bootstrap classes before the module system is initialized");

@@ -1373,10 +1374,13 @@
 
   if (was_archived_from_named_module) {
     if (should_be_in_named_module) {
       // Is the module loaded from the same location as during dump time?
       visible = mod_entry->shared_path_index() == scp_index;
+      if (visible) {
+        assert(!mod_entry->is_patched(), "cannot load archived classes for patched module");
+      }
     } else {
       // During dump time, this class was in a named module, but at run time, this class should be
       // in an unnamed module.
       visible = false;
     }
< prev index next >