Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IndexOutOfBoundsException: start 0, end -12, length 12 when searching "spring-data" #37

Closed
jludvice opened this issue Jan 22, 2022 · 4 comments
Milestone

Comments

@jludvice
Copy link

jludvice commented Jan 22, 2022

Hello, for some reason this is not working

 mcs search spring-data-jpa  
Searching for spring-data-jpa...
Found 56 results

java.lang.IndexOutOfBoundsException: start 0, end -12, length 12
        at java.lang.AbstractStringBuilder.checkRange(AbstractStringBuilder.java:1802)
        at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:680)
        at java.lang.StringBuilder.append(StringBuilder.java:214)
        at picocli.CommandLine$Help$Ansi$Text.getStyledChars(CommandLine.java:17711)
        at picocli.CommandLine$Help$TextTable.copy(CommandLine.java:16856)
        at picocli.CommandLine$Help$TextTable.copy(CommandLine.java:16845)
        at picocli.CommandLine$Help$TextTable.putValue(CommandLine.java:16807)
        at picocli.CommandLine$Help$TextTable.addRowValues(CommandLine.java:16739)
        at picocli.CommandLine$Help$TextTable.addRowValues(CommandLine.java:16720)
        at it.mulders.mcs.search.TabularOutputPrinter.print(TabularOutputPrinter.java:36)
        at it.mulders.mcs.search.DelegatingOutputPrinter.print(DelegatingOutputPrinter.java:29)
        at it.mulders.mcs.search.SearchCommandHandler.printResponse(SearchCommandHandler.java:59)
        at it.mulders.mcs.common.Result$Success.ifPresent(Result.java:20)
        at it.mulders.mcs.search.SearchCommandHandler.performWildcardSearch(SearchCommandHandler.java:30)
        at it.mulders.mcs.search.SearchCommandHandler.search(SearchCommandHandler.java:23)
        at it.mulders.mcs.cli.Cli$SearchCommand.call(Cli.java:49)
        at it.mulders.mcs.cli.Cli$SearchCommand.call(Cli.java:32)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at it.mulders.mcs.App.doMain(App.java:17)
        at it.mulders.mcs.App.main(App.java:10)

but different search works

mcs search 'org.springframework.data:spring-data-jpa*'
Searching for org.springframework.data:spring-data-jpa*...

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>2.6.1</version>
    </dependency>

environment:

 java -version
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment 21.9 (build 17.0.1+12)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.1+12, mixed mode, sharing)


mcs --version
mcs v0.1.18
@mthmulders mthmulders added this to the 0.2 milestone Jan 22, 2022
@mthmulders
Copy link
Owner

Thank you for taking the time to report this!

The code has a hard limit for the width of the table (120 characters) but some of the artifacts in Central that match your query have longer coordinates: the longest being 127 characters. This lead to the "timestamp" column being -12 characters long.

The next version of mcs will have this fixed.

@jludvice
Copy link
Author

Impressive response time :)

Thanks for the fix @mthmulders

@mthmulders
Copy link
Owner

@all-contributors please add @jludvice for bug.

Copy link
Contributor

@mthmulders

I've put up a pull request to add @jludvice! 🎉

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

No branches or pull requests

2 participants