[~cushon] reported a strange class loader issue with recent JDK mainline change. Below is a test case constructed by [~cushon] for demonstrating the issue:
```
import java.util.List;
class LoadJavacClassTest {
public static void main(String[] args) throws Exception {
for (var c :
List.of(
"com.sun.tools.javac.processing.JavacProcessingEnvironment")) {
var cl = ClassLoader.getSystemClassLoader().loadClass(c).getClassLoader();
System.err.printf("%s loaded from %s\n", c, cl);
if (cl == null) {
throw new AssertionError();
}
}
}
}
```
com.sun.tools.javac.processing.JavacProcessingEnvironment is provided by jdk.compiler module and should be loaded by the PlatformClassLoader.
Running with `java -cp <path> LoadJavacClassTest`, the test works as expected.
When running the test with extra `--enable-native-access=ALL-UNNAMED -Djava.lang.Integer.IntegerCache.high=3000`, it fails to load the class JavacProcessingEnvironment.
When running with `--enable-native-access=ALL-UNNAMED -Djava.lang.Integer.IntegerCache.high=3000` and with `-Xshare:off` to disable the default CDS, the test works ok.
I investigated the issue and found it's caused by the archived map in ModuleLoaderMap.Mapper. Will provide details in additional comments.