You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@griffin.apache.org by gu...@apache.org on 2018/08/07 08:20:55 UTC

incubator-griffin git commit: Fix code style violations and improve quality

Repository: incubator-griffin
Updated Branches:
  refs/heads/master d58bd194f -> 589c377fd


Fix code style violations and improve quality

Author: Eugene <to...@163.com>

Closes #383 from toyboxman/EnvConfig.


Project: http://git-wip-us.apache.org/repos/asf/incubator-griffin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-griffin/commit/589c377f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-griffin/tree/589c377f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-griffin/diff/589c377f

Branch: refs/heads/master
Commit: 589c377fd21269e44afd0b579bf436bf24200b66
Parents: d58bd19
Author: Eugene <to...@163.com>
Authored: Tue Aug 7 16:20:49 2018 +0800
Committer: William Guo <gu...@apache.org>
Committed: Tue Aug 7 16:20:49 2018 +0800

----------------------------------------------------------------------
 .../apache/griffin/core/config/EnvConfig.java   | 26 +++++++++++---------
 1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/589c377f/service/src/main/java/org/apache/griffin/core/config/EnvConfig.java
----------------------------------------------------------------------
diff --git a/service/src/main/java/org/apache/griffin/core/config/EnvConfig.java b/service/src/main/java/org/apache/griffin/core/config/EnvConfig.java
index c411473..ebd5a46 100644
--- a/service/src/main/java/org/apache/griffin/core/config/EnvConfig.java
+++ b/service/src/main/java/org/apache/griffin/core/config/EnvConfig.java
@@ -19,6 +19,10 @@ under the License.
 
 package org.apache.griffin.core.config;
 
+import static org.apache.griffin.core.util.FileUtil.getFilePath;
+import static org.apache.griffin.core.util.JsonUtil.toEntity;
+import static org.apache.griffin.core.util.JsonUtil.toJsonWithFormat;
+
 import com.fasterxml.jackson.core.type.TypeReference;
 
 import java.io.FileInputStream;
@@ -29,10 +33,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.core.io.ClassPathResource;
 
-import static org.apache.griffin.core.util.FileUtil.getFilePath;
-import static org.apache.griffin.core.util.JsonUtil.toEntity;
-import static org.apache.griffin.core.util.JsonUtil.toJsonWithFormat;
-
 public class EnvConfig {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(EnvConfig.class);
@@ -40,7 +40,7 @@ public class EnvConfig {
     public static String ENV_STREAMING;
 
     /**
-     * read env config from resource
+     * read env config from resource.
      *
      * @param path resource path
      * @return String
@@ -62,13 +62,13 @@ public class EnvConfig {
             result = toEntity(in, new TypeReference<Object>() {
             });
         } finally {
-        	in.close();
+            in.close();
         }
         return toJsonWithFormat(result);
     }
-    
+
     /**
-     * read env config from resource
+     * read env config from resource.
      *
      * @param path resource path
      * @return String
@@ -86,16 +86,17 @@ public class EnvConfig {
             result = toEntity(in, new TypeReference<Object>() {
             });
         } finally {
-        	in.close();
+            in.close();
         }
         return toJsonWithFormat(result);
     }
 
     /**
-     * read batch env
+     * read batch env.
      *
      * @param name        batch env name that you need to search
-     * @param defaultPath If there is no target file in location directory, it'll read from default path.
+     * @param defaultPath If there is no target file in location directory,
+     *                    it'll read from default path.
      * @param location    env path that you configure in application.properties
      * @return String
      * @throws IOException io exception
@@ -115,7 +116,8 @@ public class EnvConfig {
         return ENV_BATCH;
     }
 
-    static String getStreamingEnv(String name, String defaultPath, String location) throws IOException {
+    static String getStreamingEnv(String name, String defaultPath, String location)
+            throws IOException {
         if (ENV_STREAMING != null) {
             return ENV_STREAMING;
         }