--- old/src/hotspot/share/classfile/systemDictionaryShared.cpp 2020-03-26 15:58:12.000000000 -0700 +++ new/src/hotspot/share/classfile/systemDictionaryShared.cpp 2020-03-26 15:58:11.000000000 -0700 @@ -909,7 +909,7 @@ if (!UseSharedSpaces) { return NULL; } - if (class_name == NULL) { // don't do this for anonymous classes + if (class_name == NULL) { // don't do this for hidden and unsafe anonymous classes return NULL; } if (class_loader.is_null() || @@ -1088,9 +1088,9 @@ } bool SystemDictionaryShared::should_be_excluded(InstanceKlass* k) { - if (k->class_loader_data()->is_unsafe_anonymous()) { - warn_excluded(k, "Unsafe anonymous class"); - return true; // unsafe anonymous classes are not archived, skip + if (k->is_hidden() || k->is_unsafe_anonymous()) { + warn_excluded(k, "Hidden or Unsafe anonymous class"); + return true; // hidden and unsafe anonymous classes are not archived, skip } if (k->is_in_error_state()) { warn_excluded(k, "In error state");