Christian Schneider created KARAF-4960:
------------------------------------------

             Summary: Karaf exits when typing "la |"
                 Key: KARAF-4960
                 URL: https://issues.apache.org/jira/browse/KARAF-4960
             Project: Karaf
          Issue Type: Bug
          Components: karaf-shell
    Affects Versions: 4.1.0
            Reporter: Christian Schneider
            Assignee: Christian Schneider
             Fix For: 4.1.0


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) [?:?]




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to