You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Jean-Baptiste Onofré (Jira)" <ji...@apache.org> on 2022/10/14 12:42:00 UTC

[jira] [Updated] (KARAF-7580) StringIndexOutOfBoundsException in ShellTable

     [ https://issues.apache.org/jira/browse/KARAF-7580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Onofré updated KARAF-7580:
----------------------------------------
         Component/s: karaf
    Target Version/s: 4.3.8, 4.4.2
          Issue Type: Bug  (was: Improvement)

> StringIndexOutOfBoundsException in ShellTable
> ---------------------------------------------
>
>                 Key: KARAF-7580
>                 URL: https://issues.apache.org/jira/browse/KARAF-7580
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.3.7, 4.4.1
>            Reporter: Rico Neubauer
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>
> Karaf commands that provide text with line breaks in their description can break the general {{help}} command and lead to exception below.
> This line seems to be missing a check for st2.length:
> https://github.com/apache/karaf/blob/main/shell/core/src/main/java/org/apache/karaf/shell/support/table/Row.java#L84
> Will link a pull-request.
> {code:java}
> java.lang.StringIndexOutOfBoundsException: index -1, length 0
>     at java.lang.String.checkIndex(String.java:4563) ~[?:?]
>     at java.lang.AbstractStringBuilder.charAt(AbstractStringBuilder.java:351) ~[?:?]
>     at java.lang.StringBuilder.charAt(StringBuilder.java:91) ~[?:?]
>     at org.apache.karaf.shell.support.table.Row.getContent(Row.java:84) ~[?:?]
>     at org.apache.karaf.shell.support.table.ShellTable.print(ShellTable.java:151) ~[?:?]
>     at org.apache.karaf.shell.support.table.ShellTable.print(ShellTable.java:111) ~[?:?]
>     at org.apache.karaf.shell.impl.console.commands.help.CommandListHelpProvider.printMethodList(CommandListHelpProvider.java:167) ~[?:?]
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)