kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [04/21] kylin git commit: KYLIN-2510 Fix unintended NPE in CubeMetaExtractor
Date Fri, 31 Mar 2017 06:59:54 GMT
KYLIN-2510 Fix unintended NPE in CubeMetaExtractor


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/8be842e9
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/8be842e9
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/8be842e9

Branch: refs/heads/KYLIN-2501
Commit: 8be842e9b845477541c2569ae1c2484e9d627214
Parents: dde297e
Author: lidongsjtu <lidong@apache.org>
Authored: Thu Mar 16 09:44:47 2017 +0800
Committer: lidongsjtu <lidong@apache.org>
Committed: Thu Mar 16 09:44:54 2017 +0800

----------------------------------------------------------------------
 tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/8be842e9/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
----------------------------------------------------------------------
diff --git a/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java b/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
index e370e48..188524d 100644
--- a/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
+++ b/tool/src/main/java/org/apache/kylin/tool/CubeMetaExtractor.java
@@ -65,6 +65,7 @@ import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
@@ -172,6 +173,7 @@ public class CubeMetaExtractor extends AbstractInfoExtractor {
             String projectNames = optionsHelper.getOptionValue(OPTION_PROJECT);
             for (String projectName : projectNames.split(",")) {
                 ProjectInstance projectInstance = projectManager.getProject(projectName);
+                Preconditions.checkNotNull(projectInstance, "Project " + projectName + "
does not exist.");
                 requireProject(projectInstance);
             }
         } else if (optionsHelper.hasOption(OPTION_CUBE)) {
@@ -202,9 +204,6 @@ public class CubeMetaExtractor extends AbstractInfoExtractor {
     }
 
     private void requireProject(ProjectInstance projectInstance) throws IOException {
-        if (projectInstance == null) {
-            throw new IllegalArgumentException("Project " + projectInstance.getName() + "
does not exist");
-        }
         addRequired(projectInstance.getResourcePath());
         List<RealizationEntry> realizationEntries = projectInstance.getRealizationEntries();
         for (RealizationEntry realizationEntry : realizationEntries) {


Mime
View raw message