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

Builtin Less has an IndexOutOfBoundsException when seeking to the end of the file #860

Closed
ellisvelo opened this issue Aug 26, 2023 · 0 comments
Milestone

Comments

@ellisvelo
Copy link

I ran into an IndexOutOfBoundsException with the builtin less that can be replicated with jline-repl.sh. I can reproduce the problem with 3.22.0 and also with the latest code.

  1. cd demo
  2. ./jline-repl.sh
  3. groovy-repl> less /opt/homebrew/Dockerfile
    • The file needs to be large enough so that it doesn't display on one page
  4. Type G to seek to the end of the file
    IndexOutOfBoundsException: Index -1 out of bounds for length 81
Error: Index -1 out of bounds for length 81
java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 81
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
        at java.base/java.util.Objects.checkIndex(Objects.java:385)
        at java.base/java.util.ArrayList.get(ArrayList.java:427)
        at org.jline.builtins.Less.getLine(Less.java:1435)
        at org.jline.builtins.Less.prevLine2display(Less.java:1287)
        at org.jline.builtins.Less.moveForward(Less.java:1179)
        at org.jline.builtins.Less.run(Less.java:491)
        at org.jline.builtins.Commands.less(Commands.java:171)
        at org.jline.builtins.Commands.less(Commands.java:119)
@mattirn mattirn added this to the 3.23.1 milestone Aug 29, 2023
@gnodet gnodet modified the milestones: 3.23.1, 3.24.0 Oct 24, 2023
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

3 participants