Return-Path: X-Original-To: apmail-karaf-commits-archive@minotaur.apache.org Delivered-To: apmail-karaf-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7FF76100C2 for ; Tue, 17 Dec 2013 16:56:18 +0000 (UTC) Received: (qmail 66160 invoked by uid 500); 17 Dec 2013 16:50:55 -0000 Delivered-To: apmail-karaf-commits-archive@karaf.apache.org Received: (qmail 66046 invoked by uid 500); 17 Dec 2013 16:50:40 -0000 Mailing-List: contact commits-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list commits@karaf.apache.org Received: (qmail 65836 invoked by uid 99); 17 Dec 2013 16:50:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Dec 2013 16:50:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8C6118BA3E9; Tue, 17 Dec 2013 16:50:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gnodet@apache.org To: commits@karaf.apache.org Date: Tue, 17 Dec 2013 16:50:13 -0000 Message-Id: <3c9f1fa297d045e7aa06df75fe3e38e4@git.apache.org> In-Reply-To: <8a07ff8e2716423ea5fa32dd4fb1422d@git.apache.org> References: <8a07ff8e2716423ea5fa32dd4fb1422d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/5] git commit: Improve support for old commands annotations in namespace handler Improve support for old commands annotations in namespace handler Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/c999ac90 Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/c999ac90 Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/c999ac90 Branch: refs/heads/master Commit: c999ac9029b98a037c21b2a7f10b145205f6dfdd Parents: 5c08402 Author: Guillaume Nodet Authored: Tue Dec 17 09:24:54 2013 +0100 Committer: Guillaume Nodet Committed: Tue Dec 17 17:49:19 2013 +0100 ---------------------------------------------------------------------- .../shell/console/commands/NamespaceHandler.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/c999ac90/shell/console/src/main/java/org/apache/karaf/shell/console/commands/NamespaceHandler.java ---------------------------------------------------------------------- diff --git a/shell/console/src/main/java/org/apache/karaf/shell/console/commands/NamespaceHandler.java b/shell/console/src/main/java/org/apache/karaf/shell/console/commands/NamespaceHandler.java index d20bcfa..d1992f3 100644 --- a/shell/console/src/main/java/org/apache/karaf/shell/console/commands/NamespaceHandler.java +++ b/shell/console/src/main/java/org/apache/karaf/shell/console/commands/NamespaceHandler.java @@ -308,11 +308,25 @@ public class NamespaceHandler implements org.apache.aries.blueprint.NamespaceHan public static String getScope(Class action) { Command command = action.getAnnotation(Command.class); - return command.scope(); + if (command != null) { + return command.scope(); + } + org.apache.felix.gogo.commands.Command command2 = action.getAnnotation(org.apache.felix.gogo.commands.Command.class); + if (command2 != null) { + return command2.scope(); + } + return null; } public static String getName(Class action) { Command command = action.getAnnotation(Command.class); - return command.name(); + if (command != null) { + return command.name(); + } + org.apache.felix.gogo.commands.Command command2 = action.getAnnotation(org.apache.felix.gogo.commands.Command.class); + if (command2 != null) { + return command2.name(); + } + return null; } }