Skip to content

[core] Fix #7156: Analysis cache fails with ZipException on invalid archive - #7157

Merged
UncleOwen merged 2 commits into
pmd:mainfrom
stokpop:core/fingerprint-invalid-archives
Oct 7, 2026
Merged

UncleOwen merged 2 commits into
pmd:mainfrom
stokpop:core/fingerprint-invalid-archives

Conversation

@stokpop

@stokpop stokpop commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Describe the PR

ZipFileFingerprinter opened every jar/zip on the auxclasspath to fingerprint it for the
analysis cache. An invalid archive aborted the whole analysis with a ZipException
("Incremental analysis can't fingerprint classpath contents"). Such entries are now skipped
with a warning, like AuxClasspathLoader does since #7102. When the archive later becomes
valid, its entries are part of the fingerprint again, so the cache is invalidated.

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 verify: 6454 tests, 0 failures; checkstyle, PMD and CPD checks, japicmp pass

@pmd-actions-helper

pmd-actions-helper Bot commented Oct 6, 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-10-07 08:47:39+00:00 for 90888f1)

@UncleOwen UncleOwen added this to the 7.29.0 milestone Oct 7, 2026

@UncleOwen UncleOwen 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!

@UncleOwen
UncleOwen merged commit bf3faf2 into pmd:main Oct 7, 2026
13 checks passed
@adangel

adangel commented Oct 8, 2026

Copy link
Copy Markdown
Member

Thanks for fixing this. Now I can delete my personal TODO item, which was

  • PMD: net.sourceforge.pmd.cache.internal.ZipFileFingerprinter#fingerprint fails on corrupt.jar...
    -> incremental analysis

@stokpop

stokpop commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@adangel You're welcome. We are trying to release a new Intellij PMD plugin with 7.28.0 and this came out of the tests to reduce cases of UnresolvedType. I think the auxClasspath updates in 7.27.0 also help! Thanks for that.

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] Analysis cache fails with ZipException on invalid archive on the auxclasspath

4 participants