Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C61AF11F94 for ; Thu, 22 May 2014 23:57:39 +0000 (UTC) Received: (qmail 77614 invoked by uid 500); 22 May 2014 23:57:39 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 77578 invoked by uid 500); 22 May 2014 23:57:39 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 77570 invoked by uid 99); 22 May 2014 23:57:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2014 23:57:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 533B49882AF; Thu, 22 May 2014 23:57:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mchen@apache.org To: commits@cloudstack.apache.org Message-Id: <2f1f0ac4ca3346e7a33bd41d9bcc9b74@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.4-forward to da5ad74 Date: Thu, 22 May 2014 23:57:39 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/4.4-forward 40207929f -> da5ad74d5 CLOUDSTACK-6752: IAM command class separation caused ApiDoc warning of duplicated cmd class for the same api name. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/da5ad74d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/da5ad74d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/da5ad74d Branch: refs/heads/4.4-forward Commit: da5ad74d5f4388c4aa1df2f2e5f9053bfb70d83d Parents: 4020792 Author: Min Chen Authored: Thu May 22 16:56:36 2014 -0700 Committer: Min Chen Committed: Thu May 22 16:57:00 2014 -0700 ---------------------------------------------------------------------- server/src/com/cloud/api/doc/ApiXmlDocWriter.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/da5ad74d/server/src/com/cloud/api/doc/ApiXmlDocWriter.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java index c19f7af..0194f07 100644 --- a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java +++ b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java @@ -105,10 +105,21 @@ public class ApiXmlDocWriter { for (Class cmdClass : cmdClasses) { String apiName = cmdClass.getAnnotation(APICommand.class).name(); if (s_apiNameCmdClassMap.containsKey(apiName)) { - System.out.println("Warning, API Cmd class " + cmdClass.getName() + " has non-unique apiname" + apiName); - continue; + // handle API cmd separation into admin cmd and user cmd with the common api name + Class curCmd = s_apiNameCmdClassMap.get(apiName); + if (curCmd.isAssignableFrom(cmdClass)) { + // api_cmd map always keep the admin cmd class to get full response and parameters + s_apiNameCmdClassMap.put(apiName, cmdClass); + } else if (cmdClass.isAssignableFrom(curCmd)) { + // just skip this one without warning + continue; + } else { + System.out.println("Warning, API Cmd class " + cmdClass.getName() + " has non-unique apiname " + apiName); + continue; + } + } else { + s_apiNameCmdClassMap.put(apiName, cmdClass); } - s_apiNameCmdClassMap.put(apiName, cmdClass); } LinkedProperties preProcessedCommands = new LinkedProperties();