You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apex.apache.org by ch...@apache.org on 2015/09/10 00:13:09 UTC

[38/50] incubator-apex-core git commit: SPOI-6002: NPE while finding if a port type has schema classes

SPOI-6002: NPE while finding if a port type has schema classes


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/commit/e914fc9a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/tree/e914fc9a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/diff/e914fc9a

Branch: refs/heads/master
Commit: e914fc9ae8cc0389554c1cbbf69780130e963686
Parents: 9d08532
Author: Chandni Singh <ch...@datatorrent.com>
Authored: Thu Aug 20 13:42:31 2015 -0700
Committer: Chandni Singh <ch...@datatorrent.com>
Committed: Thu Aug 20 13:42:31 2015 -0700

----------------------------------------------------------------------
 .../stram/webapp/OperatorDiscoverer.java           | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/e914fc9a/engine/src/main/java/com/datatorrent/stram/webapp/OperatorDiscoverer.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/OperatorDiscoverer.java b/engine/src/main/java/com/datatorrent/stram/webapp/OperatorDiscoverer.java
index 0867b03..b35efe6 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/OperatorDiscoverer.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/OperatorDiscoverer.java
@@ -808,14 +808,17 @@ public class OperatorDiscoverer
           continue;
         }
         boolean hasSchemaClasses = false;
-        for (String descendant : typeGraph.getInstantiableDescendants(portType)) {
-          try {
-            if (typeGraph.isInstantiableBean(descendant)) {
-              hasSchemaClasses = true;
-              break;
+        List<String> instantiableDescendants = typeGraph.getInstantiableDescendants(portType);
+        if (instantiableDescendants != null) {
+          for (String descendant : instantiableDescendants) {
+            try {
+              if (typeGraph.isInstantiableBean(descendant)) {
+                hasSchemaClasses = true;
+                break;
+              }
+            } catch (JSONException ex) {
+              LOG.warn("checking descendant is instantiable {}", descendant);
             }
-          } catch (JSONException ex) {
-            LOG.warn("checking descendant is instantiable {}", descendant);
           }
         }
         portTypesWithSchemaClasses.put(portType, hasSchemaClasses);