Merge "Move command description checking in 'if' block"

This commit is contained in:
David Pursehouse
2013-02-22 07:25:58 +00:00
committed by Gerrit Code Review

View File

@@ -93,14 +93,14 @@ public class DispatchCommandProvider implements Provider<DispatchCommand> {
for (final Binding<?> b : allCommands()) {
final Annotation annotation = b.getKey().getAnnotation();
if (annotation instanceof CommandName) {
String descr = null;
if (annotation instanceof Commands.NestedCommandNameImpl) {
Commands.NestedCommandNameImpl impl =
((Commands.NestedCommandNameImpl) annotation);
descr = impl.descr();
}
final CommandName n = (CommandName) annotation;
if (!Commands.CMD_ROOT.equals(n) && Commands.isChild(parent, n)) {
String descr = null;
if (annotation instanceof Commands.NestedCommandNameImpl) {
Commands.NestedCommandNameImpl impl =
((Commands.NestedCommandNameImpl) annotation);
descr = impl.descr();
}
m.put(n.value(),
new CommandProvider((Provider<Command>) b.getProvider(), descr));
}