Rico Neubauer created FELIX-6153:
------------------------------------

             Summary: StringIndexOutOfBoundsException on TAB completion with 
blanks
                 Key: FELIX-6153
                 URL: https://issues.apache.org/jira/browse/FELIX-6153
             Project: Felix
          Issue Type: Bug
          Components: Gogo JLine
    Affects Versions: gogo.jline-1.1.4
            Reporter: Rico Neubauer


Hi,

This is Karaf 4.2.6 using gogo-jline 1.1.4.

Using command-completion in client-console with values, that may include blanks 
fails with StringIndexOutOfBoundsException shown below.

Example: Having this command and hitting TAB, shows the possible values (note 
there is no blank on the first entry, but then a blanc in the 2nd entry).
{noformat}
adapters:start " "
"SILClient" "FTP Client"
"AS2 Client" "RESTClient"
"BIC Client" "WSRMClient"
{noformat}
Hitting TAB once more goes to "SILClient" in this example - successful.
Hitting TAB once more would go to the entry with blank and fails with:

 
{noformat}
ERROR org.apache.karaf.shell.support.ShellUtil Karaf ssh console user admin 
[org.apache.karaf.shell.core:4.2.6.SEE2] Exception caught while executing 
command
java.lang.StringIndexOutOfBoundsException: String index out of range: 12
 at java.lang.String.charAt(String.java:658) ~[?:?]
 at org.apache.felix.gogo.jline.ParsedLineImpl.escape(ParsedLineImpl.java:131) 
~[?:?]
 at 
org.jline.reader.impl.LineReaderImpl$MenuSupport.update(LineReaderImpl.java:4538)
 ~[740:org.jline:3.11.0]
 at 
org.jline.reader.impl.LineReaderImpl$MenuSupport.next(LineReaderImpl.java:4452) 
~[740:org.jline:3.11.0]
 at org.jline.reader.impl.LineReaderImpl.doMenu(LineReaderImpl.java:4606) 
~[740:org.jline:3.11.0]
 at org.jline.reader.impl.LineReaderImpl.doList(LineReaderImpl.java:4749) 
~[740:org.jline:3.11.0]
 at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4284) 
~[740:org.jline:3.11.0]
 at 
org.jline.reader.impl.LineReaderImpl.expandOrComplete(LineReaderImpl.java:4010) 
~[740:org.jline:3.11.0]
 at org.jline.reader.impl.LineReaderImpl$1.apply(LineReaderImpl.java:3616) 
~[740:org.jline:3.11.0]
 at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:614) 
~[740:org.jline:3.11.0]
 at 
org.apache.karaf.shell.impl.console.ConsoleSessionImpl.readCommand(ConsoleSessionImpl.java:444)
 [644:org.apache.karaf.shell.core:4.2.6]
 at 
org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:402)
 [644:org.apache.karaf.shell.core:4.2.6]
 at java.lang.Thread.run(Thread.java:748) [?:?]adapters:s{noformat}
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to