3030 * @since 0.0.1
3131 */
3232@ API (since = "0.0.1" , status = Status .INTERNAL )
33- @ SuppressWarnings ("CommentedOutCode" )
3433public final class PackageContainerGroupUrlClassLoader extends URLClassLoader {
3534
3635 /**
@@ -53,41 +52,4 @@ private static URL[] extractUrls(PackageContainerGroup group) {
5352 .map (PathRoot ::getUrl )
5453 .toArray (URL []::new );
5554 }
56-
57- // TODO(ascopes): find a way to retain module information for modules that exist within this
58- // path. Currently we are discarding that information due to the nature of how URLClassLoader
59- // works internally.
60- //
61- // This would need something a bit more complicated to potentially mimic how the internal boot
62- // classloaders currently work in the JVM.
63- //
64- // Module resolution for classloaders is a bit different to regular loading of classes.
65- // As an example, this is how a classloader should be loading modules.
66- //
67- // var bootLayer = ModuleLayer.boot();
68- //
69- // var compiledCodeModuleConfig = Configuration.resolveAndBind(
70- // ModuleFinder.of(compilation.getFileManager()
71- // .getOutputContainerGroup(StandardLocation.CLASS_OUTPUT)
72- // .getPackages()
73- // .stream()
74- // .map(Container::getPathRoot)
75- // .map(PathRoot::getPath)
76- // .toArray(Path[]::new)),
77- // List.of(bootLayer.configuration()),
78- // ModuleFinder.of(),
79- // List.of("org.example")
80- // );
81- //
82- // var compiledCodeController = ModuleLayer.defineModulesWithOneLoader(
83- // compiledCodeModuleConfig,
84- // List.of(bootLayer),
85- // getClass().getClassLoader()
86- // );
87- //
88- // @SuppressWarnings("unchecked")
89- // var someConfigurerCls = (Class<? extends JctCompilerConfigurer<?>>) compiledCodeController
90- // .layer()
91- // .findLoader("org.example")
92- // .loadClass("org.example.SomeConfigurer");
9355}
0 commit comments