Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-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 90AC51135D for ; Thu, 1 May 2014 22:20:28 +0000 (UTC) Received: (qmail 58667 invoked by uid 500); 1 May 2014 22:20:28 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 58611 invoked by uid 500); 1 May 2014 22:20:27 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 58604 invoked by uid 99); 1 May 2014 22:20:27 -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, 01 May 2014 22:20:27 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8A50C6522; Thu, 1 May 2014 22:20:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tbeerbower@apache.org To: commits@ambari.apache.org Message-Id: <0aeeeeabdce548a4b6a86e020b68213d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-5651 - Ambari Views : NPE deploying view with no instances defined Date: Thu, 1 May 2014 22:20:27 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/branch-1.6.0 e94f24e3c -> 61d2658a4 AMBARI-5651 - Ambari Views : NPE deploying view with no instances defined Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/61d2658a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/61d2658a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/61d2658a Branch: refs/heads/branch-1.6.0 Commit: 61d2658a428eb668018bbec97b7456faed3ad717 Parents: e94f24e Author: tbeerbower Authored: Thu May 1 18:20:08 2014 -0400 Committer: tbeerbower Committed: Thu May 1 18:20:08 2014 -0400 ---------------------------------------------------------------------- .../java/org/apache/ambari/server/view/ViewRegistry.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/61d2658a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java index c8da1ae..a45cb39 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java @@ -58,6 +58,7 @@ import java.io.InputStream; import java.net.URL; import java.net.URLClassLoader; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -170,7 +171,13 @@ public class ViewRegistry { * @return the collection of view instances for the view definition */ public Collection getInstanceDefinitions(ViewEntity definition) { - return definition == null ? null : viewInstanceDefinitions.get(definition).values(); + if (definition != null) { + Map instanceEntityMap = viewInstanceDefinitions.get(definition); + if (instanceEntityMap != null) { + return instanceEntityMap.values(); + } + } + return Collections.emptyList(); } /**