--- old/src/share/vm/classfile/packageEntry.cpp 2017-03-23 14:05:11.654147918 -0400 +++ new/src/share/vm/classfile/packageEntry.cpp 2017-03-23 14:05:11.142147897 -0400 @@ -96,12 +96,15 @@ // Illegal to convert an unqualified exported package to be qualifiedly exported return; } + if (module()->is_open()) { + // No-op for open modules since all packages are unqualifiedly exported + return; + } if (m == NULL) { // NULL indicates the package is being unqualifiedly exported. Clean up // the qualified list at the next safepoint. set_unqual_exported(); - } else { // Add the exported module add_qexport(m); @@ -111,6 +114,11 @@ // Set the package as exported to all unnamed modules unless the package is // already unqualifiedly exported. void PackageEntry::set_is_exported_allUnnamed() { + if (module()->is_open()) { + // No-op for open modules since all packages are unqualifiedly exported + return; + } + MutexLocker m1(Module_lock); if (!is_unqual_exported()) { _export_flags = PKG_EXP_ALLUNNAMED; @@ -208,11 +216,6 @@ // Initialize fields specific to a PackageEntry entry->init(); entry->name()->increment_refcount(); - if (!module->is_named()) { - // Set the exported state to true because all packages - // within the unnamed module are unqualifiedly exported - entry->set_unqual_exported(); - } entry->set_module(module); return entry; }