Skip to content

[java] Fix #7101: Skip non-archive files on the auxclasspath - #7102

Merged
adangel merged 7 commits into
pmd:mainfrom
kalayciburak:fix/skip-non-archive-auxclasspath
Sep 25, 2026
Merged

adangel merged 7 commits into
pmd:mainfrom
kalayciburak:fix/skip-non-archive-auxclasspath

Conversation

@kalayciburak

Copy link
Copy Markdown
Contributor

Describe the PR

AuxClasspathLoader opened every regular auxclasspath file as a zip. A non-archive entry, such as a sqlite4java native library, aborted analysis with ZipException: zip END header not found. Those entries are now skipped with a warning, and the rest of the classpath is still searched.

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)

Tests

  • ./mvnw -pl pmd-core checkstyle:check test — checkstyle 0 violations; pmd-core 6462 tests, 0 failures, 8 skipped

@pmd-actions-helper

pmd-actions-helper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
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.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.

Regression Tester Report

(comment created at 2026-09-25 06:30:44+00:00 for 44b1c6a)

@adangel adangel added this to the 7.28.0 milestone Sep 24, 2026
@adangel adangel self-assigned this Sep 24, 2026
AuxClasspathLoader treated every regular file as a jar. A native library or other non-zip entry then aborted analysis with ZipException. Skip those entries and keep searching the rest of the classpath.
@kalayciburak
kalayciburak force-pushed the fix/skip-non-archive-auxclasspath branch from 3550495 to 56251a2 Compare September 24, 2026 10:23

@adangel adangel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I'd log the ignored/skipped entry on debug level, as otherwise we get another new warning. And to get rid of the warning, gradle would need to be fixed (or the config workaround need to be applied).

It would also be better to distinguish between real jar/zip files that are corrupt (e.g. half-finished download) and files, that are not jar/zip files.

Ignoring corrupt jar files could lead to false positives/negatives as PMD might be missing types, so a warning makes sense in that case. Once I've merged #7086, this warning can be ignored (although not recommended - as it causes potential false positive/negatives).

I'll update your PR accordingly, no changes from your side are needed.

@adangel
adangel merged commit 388f07a into pmd:main Sep 25, 2026
13 checks passed
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.

[java] ZipException when auxClasspath contains a non-jar file (since 7.27.0)

2 participants