GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [core] PMDConfiguration - "Can't mix setClasspath with getAuxClasspath!" · Issue #7013 · pmd/pmd

[core] PMDConfiguration - "Can't mix setClasspath with getAuxClasspath!" #7013

New issue
Copy link
New issue
Copy link
Closed
#7019
Closed
[core] PMDConfiguration - "Can't mix setClasspath with getAuxClasspath!"#7013
#7019
Copy link
Labels
a:bugPMD crashes or fails to analyse a file.
Milestone
7.28.0

Description

@AB-xdev
AB-xdev
opened on Aug 31, 2026
Issue body actions

Affects PMD Version:

7.27.0

Description:

Call PMDConfiguration#setClassLoader and do an analysis PmdAnalysis.create(pmdConfig) → Crashes

Exception Stacktrace:

2026-08-31 09:20:49,922 [  94383] SEVERE - #software.xdev.pmd.annotator.PMDExternalLanguageAnnotator - Failed to annotate
java.lang.IllegalStateException: Can't mix setClasspath with getAuxClasspath!
	at net.sourceforge.pmd.PMDConfiguration.getAuxClasspath(PMDConfiguration.java:353)
	at net.sourceforge.pmd.PmdAnalysis.create(PmdAnalysis.java:221)
	at software.xdev.pmd.analysis.PMDAnalyzer.analyzeInternal(PMDAnalyzer.java:203)
        ...

Code Sample demonstrating the issue:

See above

Steps to reproduce:

See above

Running PMD through: Other

Activity

  1. AB-xdev
    added
    a:bugPMD crashes or fails to analyse a file.
    on Aug 31, 2026
  2. UncleOwen commented on Aug 31, 2026

    @UncleOwen
    UncleOwen
    on Aug 31, 2026
    Member
    More actions

    Can't reproduce. The following test is green.

        @Test
        void testCreateConfigWithCustomClasspath() {
            PMDConfiguration config = new PMDConfiguration();
            config.setClassLoader(this.getClass().getClassLoader());
    
            assertDoesNotThrow(() -> PmdAnalysis.create(config));
        }
  3. AB-xdev commented on Aug 31, 2026

    @AB-xdev
    AB-xdev
    on Aug 31, 2026
    Author
    More actions

    @UncleOwen Is this test executed using a JvmLanguagePropertyBundle? You probably need to configure a language like Java because otherwise the condition might not be triggered - at least as far as I have seen in the code...

  4. UncleOwen commented on Aug 31, 2026

    @UncleOwen
    UncleOwen
    on Aug 31, 2026
    Member
    More actions

    Ah, I took your problem description a bit too literal. Now I can reproduce.

        @Test
        void testCreateConfigWithCustomClasspath() {
            LanguageRegistry registry = new LanguageRegistry(setOf(new FakeJvmLanguageModule()));
            PMDConfiguration config = new PMDConfiguration(registry);
            config.setClassLoader(this.getClass().getClassLoader());
    
            assertDoesNotThrow(() -> PmdAnalysis.create(config));
        }
    
        private static class FakeJvmLanguageModule extends DummyLanguageModule {
            @Override
            public LanguagePropertyBundle newPropertyBundle() {
                return new JvmLanguagePropertyBundle(this);
            }
        }
  5. UncleOwen
    added a commit that references this issue on Aug 31, 2026

    Only access PMDConfiguration.auxClasspath if it is actually set.

    552ecd8
  6. adangel
    changed the title [-]"Can't mix setClasspath with getAuxClasspath!"[/-] [+][core] PMDConfiguration - "Can't mix setClasspath with getAuxClasspath!"[/+] on Aug 31, 2026
  7. UncleOwen
    added this to the 7.28.0 milestone on Sep 3, 2026
  8. UncleOwen
    closed this as completedin #7019on Sep 3, 2026
  9. UncleOwen
    added a commit that references this issue on Sep 3, 2026

    [core] Fix pmd#7013: Only access PMDConfiguration.auxClasspath if it …

    This issue will close once commit 65dca5e is merged into the 'main' branch.
    65dca5e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:bugPMD crashes or fails to analyse a file.

    Type

    No type

    Projects

    No projects

      Milestone

      • 7.28.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.