Description
If you forget to put a @Command annotation on your OsgiCommandSupport subclass, and you try to execute that command with a syntax error (perhaps you forget an argument) then you'll get the following under-informative error in the shell:
Error executing command: java.lang.NullPointerException
The root cause (discovered by stepping in the debugger) is in DefaultActionPreparer.prepare() line 291 where this line of code:
Command command = action.getClass().getAnnotation(Command.class);
is not followed by a null check. In fact, there are several places in that method where the result of getAnnotation() is not checked. I propose one of the following two solutions:
1) add null checks
2) throw an informative exception in CommandProcessorImpl.addCommand() if the @Command is missing