This check seems to be obsolete, as module information is now available even during -Xshare:dump
https://github.com/openjdk/jdk/blame/fe0ccdf5f8a5559a608d2e2cd2b6aecbe245c5ec/src/hotspot/share/runtime/reflection.cpp#L460-L465
// Ignore modules for DumpSharedSpaces because we do not have any package
// or module information for modules other than java.base.
if (DumpSharedSpaces) {
return ACCESS_OK;
}
https://github.com/openjdk/jdk/blame/fe0ccdf5f8a5559a608d2e2cd2b6aecbe245c5ec/src/hotspot/share/runtime/reflection.cpp#L460-L465
// Ignore modules for DumpSharedSpaces because we do not have any package
// or module information for modules other than java.base.
if (DumpSharedSpaces) {
return ACCESS_OK;
}