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 — [java] Fix #7101: Skip non-archive files on the auxclasspath by kalayciburak · Pull Request #7102 · pmd/pmd

Conversation

@kalayciburak

@kalayciburak kalayciburak commented Sep 23, 2026

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

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pmd-actions-helper

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

Uh oh!

There was an error while loading. Please reload this page.

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)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adangel adangel added this to the 7.28.0 milestone Sep 24, 2026
@adangel adangel self-assigned this Sep 24, 2026
@kalayciburak
[java] Fix pmd#7101: Skip non-archive files on the auxclasspath
56251a2
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 approved these changes Sep 24, 2026
View reviewed changes

@adangel adangel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kalayciburak reacted with heart emoji
All reactions
  • ❤️ 1 reaction
adangel added 5 commits September 24, 2026 13:40
@adangel
Warn only for corrupt archives, all others are logged on debug
936237e
@adangel
Merge branch 'main' into pr-7102
f68ddb1
@adangel
Warn only if not disableAuxClasspathWarnings is used
32c62ea
@adangel
Merge branch 'main' into pr-7102
7978140
@adangel
Add additional test for corrupt jar warning
95584a1
adangel
adangel reviewed Sep 25, 2026
View reviewed changes
Comment thread pmd-core/src/main/java/net/sourceforge/pmd/util/AuxClasspathLoader.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@adangel
Make new AuxClasspathLoader#create(_,WarnOrDebugLogger) internal
44b1c6a
@adangel
adangel merged commit 388f07a into pmd:main Sep 25, 2026
13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Oct 6, 2026
[core] Analysis cache fails with ZipException on invalid archive on the auxclasspath #7156
Closed
[core] Fix #7156: Analysis cache fails with ZipException on invalid archive #7157
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adangel adangel adangel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@adangel adangel

Labels

None yet

Projects

None yet

Milestone

7.28.0

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@kalayciburak @adangel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.