When adding a header to a console-ui prompt, if the number of items in the header list is larger then the number of lines the terminal has to display, the program crashes. Here is the stack trace.
java.lang.IndexOutOfBoundsException: Index 74 out of bounds for length 5
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.base/java.util.Objects.checkIndex(Objects.java:361)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
at org.jline.consoleui.prompt.AbstractPrompt.displayLines(AbstractPrompt.java:152)
at org.jline.consoleui.prompt.AbstractPrompt.refreshDisplay(AbstractPrompt.java:116)
at org.jline.consoleui.prompt.AbstractPrompt$InputValuePrompt.execute(AbstractPrompt.java:587)
at org.jline.consoleui.prompt.ConsolePrompt.prompt(ConsolePrompt.java:121)
at org.jline.consoleui.examples.Basic.main(Basic.java:175)
I've attached a modified Basic.java example to demonstrate the problem.
Basic.java.txt
When adding a header to a console-ui prompt, if the number of items in the header list is larger then the number of lines the terminal has to display, the program crashes. Here is the stack trace.
java.lang.IndexOutOfBoundsException: Index 74 out of bounds for length 5 at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) at java.base/java.util.Objects.checkIndex(Objects.java:361)
at java.base/java.util.ArrayList.get(ArrayList.java:427) at org.jline.consoleui.prompt.AbstractPrompt.displayLines(AbstractPrompt.java:152) at org.jline.consoleui.prompt.AbstractPrompt.refreshDisplay(AbstractPrompt.java:116) at org.jline.consoleui.prompt.AbstractPrompt$InputValuePrompt.execute(AbstractPrompt.java:587)
at org.jline.consoleui.prompt.ConsolePrompt.prompt(ConsolePrompt.java:121) at org.jline.consoleui.examples.Basic.main(Basic.java:175)
I've attached a modified Basic.java example to demonstrate the problem. Basic.java.txt