karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Rathgeb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-4270) Shell-compat gets NPE trying to give help for combo of local and compat commands
Date Wed, 10 Feb 2016 21:49:18 GMT

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

Markus Rathgeb commented on KARAF-4270:
---------------------------------------

I found this issue after I implemented the fix myself. ;) I should look at JIRA first...

The applied patch fixes the NPE but returns "null" in the getDescription() function.
The other branches in that file (that handles other command types) implement the getDescription()
that it returns getName() if the description is null.
See
* https://github.com/bimargulies/karaf/blob/5a00ab7ee204c05df06925f38d196840bf7f0302/shell/console/src/main/java/org/apache/karaf/shell/compat/CommandTracker.java#L88
* https://github.com/bimargulies/karaf/blob/5a00ab7ee204c05df06925f38d196840bf7f0302/shell/console/src/main/java/org/apache/karaf/shell/compat/CommandTracker.java#L136

Shouldn't we do here the same to handle it the same way as the other ones?
I would prefer to change that line:
https://github.com/bimargulies/karaf/blob/5a00ab7ee204c05df06925f38d196840bf7f0302/shell/console/src/main/java/org/apache/karaf/shell/compat/CommandTracker.java#L193
to "return getName();"

What do you think?

> Shell-compat gets NPE trying to give help for combo of local and compat commands
> --------------------------------------------------------------------------------
>
>                 Key: KARAF-4270
>                 URL: https://issues.apache.org/jira/browse/KARAF-4270
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.0.4
>            Reporter: Benson Margulies
>            Assignee: Freeman Fang
>             Fix For: 4.1.0, 4.0.5
>
>
> {noformat}
> karaf@root>help scr
> pipe: java.lang.NullPointerException
> karaf@root>
> {noformat}



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

Mime
View raw message