You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2019/09/06 07:08:00 UTC

[jira] [Commented] (KARAF-6351) The classes command fails with package-less classes

    [ https://issues.apache.org/jira/browse/KARAF-6351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16923974#comment-16923974 ] 

ASF subversion and git services commented on KARAF-6351:
--------------------------------------------------------

Commit 473925941e796752b9b98c2f37e7728de13e01ca in karaf's branch refs/heads/karaf-4.2.x from Stephen Kitt
[ https://gitbox.apache.org/repos/asf?p=karaf.git;h=4739259 ]

[KARAF-6351] Handle package-less classes

The classes command unconditionnally tries to extract a package name,
which fails with classes which don't have one. This patch checks for
the presence of "/" before attempting to use it as a delimiter.
Classes with no package are assumed to not be exported.

Signed-off-by: Stephen Kitt <sk...@redhat.com>

(cherry-pick from commit 5e885946aebd43c01bd816b3c71a85d1602f8362)


> The classes command fails with package-less classes
> ---------------------------------------------------
>
>                 Key: KARAF-6351
>                 URL: https://issues.apache.org/jira/browse/KARAF-6351
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.2.1, 4.2.2, 4.2.3, 4.2.4, 4.2.5, 4.2.6
>            Reporter: Stephen Kitt
>            Assignee: Jean-Baptiste Onofré
>            Priority: Minor
>             Fix For: 4.3.0, 4.2.7
>
>
> Running
> {code:java}
> classes{code}
> often produces errors of the form
>  
> {code:java}
> Unable to execute command on bundle 451: String index out of range: -1{code}
> Looking at the logs shows
> {code:java}
>         Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>                 at java.lang.String.substring(String.java:1967) ~[?:?]
>                 at org.apache.karaf.bundle.command.Classes.isExported(Classes.java:81) ~[?:?]
>                 at org.apache.karaf.bundle.command.Classes.executeOnBundle(Classes.java:67) ~[?:?]{code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)