jixuan1989 commented on a change in pull request #25: Fix sonar
URL: https://github.com/apache/incubator-iotdb/pull/25#discussion_r250492334
 
 

 ##########
 File path: iotdb-cli/src/main/java/org/apache/iotdb/cli/client/WinClient.java
 ##########
 @@ -84,70 +83,50 @@ public static void main(String[] args) throws 
ClassNotFoundException, SQLExcepti
       hf.printHelp(IOTDB_CLI_PREFIX, options, true);
       return;
     }
-    Scanner scanner = null;
-    try {
-      String s;
-
-      try {
-        host = checkRequiredArg(HOST_ARGS, HOST_NAME, commandLine, false, 
host);
-        port = checkRequiredArg(PORT_ARGS, PORT_NAME, commandLine, false, 
port);
-        username = checkRequiredArg(USERNAME_ARGS, USERNAME_NAME, commandLine, 
true, null);
 
-        password = commandLine.getOptionValue(PASSWORD_ARGS);
-        if (password == null) {
-          password = readPassword();
-        }
-        try {
-          connection = (IoTDBConnection) DriverManager
-              .getConnection(Config.IOTDB_URL_PREFIX + host + ":" + port + 
"/", username, password);
-          properties = connection.getServerProperties();
-          
AGGREGRATE_TIME_LIST.addAll(properties.getSupportedTimeAggregationOperations());
-        } catch (SQLException e) {
-          System.out.println(IOTDB_CLI_PREFIX + "> " + e.getMessage());
-          return;
-        }
-      } catch (ArgsErrorException e) {
-        // System.out.println(TSFILEDB_CLI_PREFIX + ": " + e.getMessage());
-        return;
+    try (Scanner scanner = new Scanner(System.in)){
 
 Review comment:
   checkstyle
   ) {

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to