Repository navigation
[java] Fix #6010: Add replacement for ClasspathClassloader - #6859
Merged
Merged
Conversation
Instead, use new AuxClasspathLoader, which will replace ClasspathClassLoader (an internal class). Might fix pmd#6010
This is especially needed for RuleTst.
So that JvmLanguageProperty.AUX_CLASSPATH is wired...
Cache the information whether the entry is a file or directory, to avoid asking the filesystem over and over again.
Contributor
|
Compared to main: (comment created at 2026-08-20 09:48:10+00:00 for 1bd2fd6) |
instead of prependAuxClasspath
Also add test for supporting different Java versions (loadFromJava)
adangel
commented
Jul 17, 2026
stokpop
reviewed
Jul 21, 2026
stokpop
left a comment
Contributor
There was a problem hiding this comment.
proposed some possible concurrency improvements and extra cleanup in LRU construct
The fields javaHome, fileSystem and packagesDirsToModules are now final so that it is clear, they are not mutable.
While we're closing the AuxClasspathLoader, there might still be a findResource request ongoing, which could open a new ZipFile and add it to zipFiles.
stokpop
reviewed
Jul 22, 2026
stokpop
reviewed
Jul 26, 2026
4 tasks done
4 tasks
This was referenced Sep 18, 2026
adangel
added a commit
that referenced
this pull request
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the PR
This creates an alternative implementation for the ClasspathClassloader, which is not anymore using URLClassloader in the background. This allows us to control when files are closed ourselves. As it using only ZipFile and not JarFile with verify=true (like URLClassloader), this also solves the OOM reported in #6010.
While this PR works on its own, it is not quite ready yet:
https://docs.junit.org/6.1.1/advanced-topics/launcher-api.html#launcher-session-listeners-custom at the end
See use case: https://github.com/xdev-software/intellij-plugin-pmd/blob/develop/src/main/java/software/xdev/pmd/analysis/PMDAnalyzer.java#L173
Maybe support caching multiple instances?
Have it extensible... some strategy. For the RuleTests we only need to cache one. But IDE plugin might need more (one per module)
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)