You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ca...@apache.org on 2019/01/24 05:53:14 UTC

[incubator-iotdb] branch fix_sonar updated: fix sonar problem

This is an automated email from the ASF dual-hosted git repository.

caogaofei pushed a commit to branch fix_sonar
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/fix_sonar by this push:
     new a7f06e0  fix sonar problem
a7f06e0 is described below

commit a7f06e09a7da4ab5748573dea990a607fba97476
Author: CGF <cg...@foxmail.com>
AuthorDate: Thu Jan 24 13:52:59 2019 +0800

    fix sonar problem
---
 .../iotdb/db/engine/cache/TsFileMetadataUtils.java |  2 --
 .../org/apache/iotdb/db/engine/filenode/Main.java  | 26 ----------------------
 .../org/apache/iotdb/tsfile/read/common/Path.java  | 17 ++++++++++----
 3 files changed, 13 insertions(+), 32 deletions(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/cache/TsFileMetadataUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/cache/TsFileMetadataUtils.java
index 34dc85e..477a209 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/cache/TsFileMetadataUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/cache/TsFileMetadataUtils.java
@@ -34,8 +34,6 @@ import org.slf4j.LoggerFactory;
  */
 public class TsFileMetadataUtils {
 
-  private static final Logger LOGGER = LoggerFactory.getLogger(TsFileMetadataUtils.class);
-
   /**
    * get tsfile meta data.
    *
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/Main.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/Main.java
deleted file mode 100644
index afb8189..0000000
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/Main.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.db.engine.filenode;
-
-/**
- * Created by liukun on 2019/1/9.
- */
-public class Main {
-
-}
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/Path.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/Path.java
index 5db6012..0b3533d 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/Path.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/Path.java
@@ -32,28 +32,37 @@ public class Path {
   private String measurement = null;
   private String device = null;
   private String fullPath;
+  private String illegalPathArgument = "Path parameter is null";
 
   public Path(StringContainer pathSc) {
-    assert pathSc != null;
+    if (pathSc == null) {
+      throw new IllegalArgumentException("");
+    }
     String[] splits = pathSc.toString().split(SystemConstant.PATH_SEPARATER_NO_REGEX);
     init(splits);
   }
 
   public Path(String pathSc) {
-    assert pathSc != null;
+    if (pathSc == null) {
+      throw new IllegalArgumentException(illegalPathArgument);
+    }
     String[] splits = pathSc.split(SystemConstant.PATH_SEPARATER_NO_REGEX);
     init(splits);
   }
 
   public Path(String[] pathSc) {
-    assert pathSc != null;
+    if (pathSc == null) {
+      throw new IllegalArgumentException(illegalPathArgument);
+    }
     String[] splits = new StringContainer(pathSc, SystemConstant.PATH_SEPARATOR).toString()
         .split(SystemConstant.PATH_SEPARATER_NO_REGEX);
     init(splits);
   }
 
   public Path(String device, String measurement) {
-    assert device != null && measurement != null;
+    if (device == null || measurement == null) {
+      throw new IllegalArgumentException(illegalPathArgument);
+    }
     String[] splits = (device + SystemConstant.PATH_SEPARATOR + measurement)
         .split(SystemConstant.PATH_SEPARATER_NO_REGEX);
     init(splits);