Repository navigation
[core] refactor: AnalysisCache based on Path - #6841
Merged
Merged
Conversation
And not anymore based on URLs. Moved out dependency to (URL)ClassLoader. Added new utility AnalysisClasspathUtil to interpret with the classpath.
Contributor
|
Compared to main: (comment created at 2026-07-09 10:34:02+00:00 for 81787a7) |
adangel
commented
Jul 7, 2026
UncleOwen
reviewed
Jul 8, 2026
4 tasks
UncleOwen
approved these changes
Jul 9, 2026
4 of 8 tasks
adangel
added a commit
that referenced
this pull request
Jul 16, 2026
* [core] Fix #4953: Deprecate PMDConfiguration#getClassLoader PMDConfiguration now stores the given raw auxClasspath as string. For backwards compatibility, a classloader can still be set externally when using the programmatic API. But usually (e.g. via CLI), the auxClasspath is set now via the JvmLanguagePropertyBundle only, which creates the actual classloader only when requested. This means, the classloader is not created anymore eagerly by PMDConfiguration. The given auxClasspath is checked early for validity. All files/directories must exist. * [core] fix #4952: Document PMDConfiguration classLoader closing * Add TODO for #6841 * Fix test auxClasspathWithRelativeFile() under Windows * fix: when verifying auxclasspath allow not existing directory entries At least maven-pmd-plugin might provide a directory, which doesn't exist, e.g. "target/test-classes". As we don't check the auxclasspath for completeness (which we can't anyway at this point), there is no difference between a non-existing directory or an empty directory or an incomplete directory. The result is the same: the provided auxclasspath is incomplete. The reason for the empty/non-existing directory might be, that the project being analyzed was not compiled yet - but we don't know. Later on, when trying to resolve classes from the auxclasspath and we don't find classes, we can report this problem, as we know for sure, that the auxclasspath is incomplete (see #5064). For now, we only log a warning for each suspicious auxClasspath entry. * Revert formatting changes in release notes * Fix tests * Fix unused import * refactor: Use AuxClasspathUtil in PMDConfiguration
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 is the first PR working towards a solution for #4953 . It first deals with the AnalysisCache to make it more independent: Now it doesn't depend anymore on classloader instances, but just uses a list of paths.
I've introduced a new utility, which is internal for now: AnalysisClasspathUtil. It supports parsing a string, which is a PMD-like classpath (e.g. given as an --aux-classpath parameter) - PMD-like, because it supports the special prefix "file:".
This new util class is also used for the current (also internal, but more widely used) ClasspathClassLoader.
This PR does not intend to change any behavior. The changes should be all internally.
In the next PRs, I plan to
Related issues
There are a couple of previous PRs/issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)