Skip to content

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

Open

Description

@suztomo

When I pass an invalid coordinates to LinkageCheckerMain, it throws IndexOutOfBoundsException. This does not tell the cause of the error.

> Task :checkJavaLinkage
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.IndexOutOfBoundsException: end index (1) must not be greater than size (0)
        at com.google.common.base.Preconditions.checkPositionIndexes(Preconditions.java:1420)
        at com.google.common.collect.ImmutableList.subList(ImmutableList.java:433)
        at com.google.cloud.tools.opensource.classpath.LinkageCheckerMain.checkArtifacts(LinkageCheckerMain.java:159)
        at com.google.cloud.tools.opensource.classpath.LinkageCheckerMain.main(LinkageCheckerMain.java:66)

> Task :checkJavaLinkage FAILED

Activity

  1. added
    bug
    help wanted
    good first issue
    on Jul 22, 2021
  2. NabeelShahid7 commented on Sep 10, 2022

    @NabeelShahid7

    I would like to work on this issue. @elharo

  3. suztomo commented on Sep 10, 2022

    @suztomo
    ContributorAuthor

    This issue might be outdated. Check whether the problem still exists or not.

  4. Manishpandey11 commented on Sep 20, 2022

    @Manishpandey11

    Hi
    I want to contribute by work on this issue

  5. Indu34569 commented on Nov 3, 2026

    @Indu34569

    Hi! I'm a beginner Java developer interested in contributing to this issue.

    I noticed the earlier comment mentioning that the issue might be outdated. Is this problem still reproducible with the current codebase?

    If it is, would you be open to accepting a contribution from me? I'd be happy to investigate and work on a fix.

    Thank you!

  6. Indu34569 commented on Nov 4, 2026

    @Indu34569

    Hi maintainers,

    I investigated this issue and reproduced the IndexOutOfBoundsException when supplying an invalid artifact coordinate.

    I've implemented a fix that detects when the resolved classpath has fewer entries than the requested artifacts and reports a clear resolution error.

    I've added a regression test, and both the regression test and the existing BOM integration test pass locally.

    My changes are committed locally (a5e5b535).

    Could you please confirm whether this issue is still relevant? If so, would you consider adding the Accepting Contributions label so I can submit a PR?

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issuehelp wantedp2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions