Skip to content

Clear error when Linkage Checker coordinates fail to resolve - #2480

Open
KirtiRamchandani wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
KirtiRamchandani:fix/invalid-coords-error
Open

KirtiRamchandani wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
KirtiRamchandani:fix/invalid-coords-error

Conversation

@KirtiRamchandani

@KirtiRamchandani KirtiRamchandani commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

When invalid Maven coordinates are supplied, dependency resolution can yield a classpath shorter than the requested artifact list. checkArtifacts then called subList(0, artifacts.size()) and threw IndexOutOfBoundsException.

This checks classpath length first and throws IllegalArgumentException with a clear message (including any ArtifactProblems).

Fixes #1948

Test plan

  • Confirmed subList(0, artifacts.size()) still runs without a length guard on current master
  • Guard only triggers when inputClassPath.size() < artifacts.size(); successful resolves take the same path as before
  • Optional follow-up: run Linkage Checker CLI with a bogus GAV and confirm the IllegalArgumentException text

Invalid coordinates previously produced an empty classpath and then
IndexOutOfBoundsException from subList(0, artifacts.size()). Validate
resolution up front and surface artifact problems instead.

Fixes GoogleCloudPlatform#1948

This branch has not been deployed

No deployments
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.

LinkageCheckerMain to provide clear error message when the supplied coordinates are invalid

1 participant