Skip to content

Remove classloader functionality from module groups #149

@ascopes

Description

@ascopes

The current implementation allows for
acquiring classloaders for module groups.

The JSR-199 file manager API expects trying to
obtain a classloader for a module to be illegal
behaviour and to raise an exception.

Since we also enable acquiring classloaders for
each package oriented group representing
individual modules, this also presently creates
a risk of being able to load the same classes
twice by using the package classloader, and the
module classloader that wraps it.

We should remove this behaviour.

This will likely cause some issues with the
output container group implementation as this
can work with both modules and non-modules.
The solution here is probably going to be an
overhaul over how the output container group API
works. Instead of directly wrapping the modules
and non-modules, it may be more sensible to
rework it to simply delegate to internal
package and module groups.

It may be worth looking into how javac deals
with this internally though. We might be able
to get away with having two potential
implementations: one for containing non-module
files only, and one for containing module files
only.

This needs to be done before the API is made
stable as it is a potentially large breaking
change.

Metadata

Metadata

Assignees

Labels

enhancementOptimisations and internal improvements in the codebase.help neededLooking for people with time/resources/knowledge to help out with this onenew featureA new feature

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions