Repository navigation
[java] Fix #7101: Skip non-archive files on the auxclasspath - #7102
Conversation
|
Compared to main: (comment created at 2026-09-25 06:30:44+00:00 for 44b1c6a) |
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.
3550495 to
56251a2
Compare
adangel
left a comment
There was a problem hiding this comment.
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.
Describe the PR
AuxClasspathLoaderopened every regular auxclasspath file as a zip. A non-archive entry, such as a sqlite4java native library, aborted analysis withZipException: 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?
./mvnw clean verifypasses (checked automatically by github actions)Tests
./mvnw -pl pmd-core checkstyle:check test— checkstyle 0 violations; pmd-core 6462 tests, 0 failures, 8 skipped