Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[core] Fix #4953: Deprecate PMDConfiguration set/getClassloader#6398

Draft
adangel wants to merge 3 commits intopmd:mainfrom
adangel:core/issue-4953-deprecate-classloader
Draft

[core] Fix #4953: Deprecate PMDConfiguration set/getClassloader#6398
adangel wants to merge 3 commits intopmd:mainfrom
adangel:core/issue-4953-deprecate-classloader

Conversation

@adangel
Copy link
Member

@adangel adangel commented Jan 13, 2026

Describe the PR

This is my own attempt to this issue...

Things to think about, stuff that is not ready

  • should we really rename auxclasspath to analysisclasspath? What is the correct name? Auxclasspath is older, but IMHO AnalysisClasspath sounds better
  • should we introduce now AnalysisClasspath or keep it as a simple String in PMDConfiguration?
  • When should we validate the provided auxclasspath (e.g. do the provided paths exist, etc.). We probably should do this not here, but in [java] Report missing classes during analysis #5064 .
  • documentation / api doc and tests
  • This is API compatible, but heavily changes the semantics of PMDConfiguration - e.g. the sequence of the calls prependAuxclasspath, getClassloader.getURLs() doesn't work anymore (we used that in unit tests). Is this a problem?
    • In summary I think, the main culprit is that PMDConfiguration is more than data
  • Were should the logic be placed to interpret the classpath string provided to PMD? I've extracted it into separately used methods in ClasspathClassloader, but it maybe belongs to AnalysisClasspath
  • Maybe the performance problem for our rule unit tests could be solved in a more elegant way - ideally some solution, that we can keep (and no temporary solution)
  • commit messages here need to be redone
  • ...

Some ideas on how to approach part of this and make this change even smaller:

  • first refactor ClasspathClassloader to define, where the logic for parsing a string into URLs belong
  • refactor Analysis Cache / Fingerprinter to not use URLs, if possible. If at all, we should use URIs.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@pmd-actions-helper
Copy link
Contributor

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.

Regression Tester Report

(comment created at 2026-01-13 22:32:11+00:00 for 3dd5b8c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[core] Deprecate PMDConfiguration#setClassloader and #getClassloader

1 participant