Moduleloading: Fix loading of classes in packages only present as versioned entries#9396
Moduleloading: Fix loading of classes in packages only present as versioned entries#9396matthiasblaesing wants to merge 2 commits into
Conversation
- General cleanups - JarClassLoader#addURL is unused - JarClassLoader#getClassData is unused - Archive#isActive is unused
…sioned entries The NetBeans classloader infrastructure relies on a mapping of packages classloaders can load resources/classes from. That mapping is currently not scanning META-INF/versions/<version> for packages. This becomes a problem if the versioned folder contains packages not present in the non-versioned part of the JAR. This change adds coverage for the versioned folder. Closes: apache#9371
8d8e8d7 to
fc5f876
Compare
|
have you tried: -> and checked if the packages show up automatically when the jdk api is used? This will open the jar in multi release mode, default is jdk8 mode. |
|
I thought briefly about using the |
|
As I have to assume I won't get a quick test of the fix (#9371 (comment)), I created my own reproducer:
Assuming the sample is run on JDK 21+, with a build from master you get:
With this PR the result is the expected:
|


The NetBeans classloader infrastructure relies on a mapping of packages
classloaders can load resources/classes from. That mapping is currently
not scanning META-INF/versions/ for packages. This becomes a
problem if the versioned folder contains packages not present in the
non-versioned part of the JAR.
This change adds coverage for the versioned folder.
Closes: #9371