Details
Description
When typing any command and just "|" at the end karaf completely exits.
There is the stacktrace below in the log.
I found that this is because of a unprotected access to the first token of the parsed command.
2017-01-27T14:52:22,844 | ERROR | Karaf local console user karaf | ShellUtil | 43 - org.apache.karaf.shell.core - 4.1.0.SNAPSHOT | Exception caught while executing command
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653) [?:?]
at java.util.ArrayList.get(ArrayList.java:429) [?:?]
at org.apache.karaf.shell.impl.console.parsing.KarafParser.doParse(KarafParser.java:78) [43:org.apache.karaf.shell.core:4.1.0.SNAPSHOT]
at org.apache.karaf.shell.impl.console.parsing.KarafParser.parse(KarafParser.java:49) [43:org.apache.karaf.shell.core:4.1.0.SNAPSHOT]
at org.jline.reader.impl.LineReaderImpl.insertSecondaryPrompts(LineReaderImpl.java:3430) [50:org.jline:3.1.2]
at org.jline.reader.impl.LineReaderImpl.insertSecondaryPrompts(LineReaderImpl.java:3387) [50:org.jline:3.1.2]
at org.jline.reader.impl.LineReaderImpl.getDisplayedBufferWithPrompts(LineReaderImpl.java:3268) [50:org.jline:3.1.2]
at org.jline.reader.impl.LineReaderImpl.redisplay(LineReaderImpl.java:3203) [50:org.jline:3.1.2]
at org.jline.reader.impl.LineReaderImpl.cleanup(LineReaderImpl.java:2180) [50:org.jline:3.1.2]
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:570) [50:org.jline:3.1.2]
at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:332) [43:org.apache.karaf.shell.core:4.1.0.SNAPSHOT]
at java.lang.Thread.run(Thread.java:745) [?:?]