ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tbeerbo...@apache.org
Subject git commit: AMBARI-5651 - Ambari Views : NPE deploying view with no instances defined
Date Thu, 01 May 2014 22:20:27 GMT
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 <tbeerbower@hortonworks.com>
Authored: Thu May 1 18:20:08 2014 -0400
Committer: tbeerbower <tbeerbower@hortonworks.com>
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<ViewInstanceEntity> getInstanceDefinitions(ViewEntity definition)
{
-    return definition == null ? null : viewInstanceDefinitions.get(definition).values();
+    if (definition != null) {
+      Map<String, ViewInstanceEntity> instanceEntityMap = viewInstanceDefinitions.get(definition);
+      if (instanceEntityMap != null) {
+        return instanceEntityMap.values();
+      }
+    }
+    return Collections.emptyList();
   }
 
   /**


Mime
View raw message