You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/09/27 08:17:11 UTC

[GitHub] [incubator-iotdb] wshao08 commented on a change in pull request #1750: [Sonar] Fix Codesmell blocker and critical issue

wshao08 commented on a change in pull request #1750:
URL: https://github.com/apache/incubator-iotdb/pull/1750#discussion_r495542647



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MLogWriter.java
##########
@@ -132,8 +133,8 @@ public static void upgradeMLog(String schemaDir, String logFileName) throws IOEx
     }
 
     // if both old mlog and mlog.tmp exist, delete mlog tmp, then do upgrading
-    if (tmpLogFile.exists()) {
-      if (!tmpLogFile.delete()) {
+    if (tmpLogFile.exists() && !tmpLogFile.delete()) {
+      {

Review comment:
       Remove this pair of  parentheses

##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/BinaryStatistics.java
##########
@@ -36,6 +36,9 @@
 
   private Binary firstValue = new Binary("");
   private Binary lastValue = new Binary("");
+  private static final String BINARY_STATISTICS_NOT_SUPPORT_MIN = "Binary statistics does not support: min";
+  private static final String BINARY_STATISTICS_NOT_SUPPORT_MAX = "Binary statistics does not support: max";
+  private static final String BINARY_STATISTICS_NOT_SUPPORT_SUM = "Binary statistics does not support: sum";

Review comment:
       Use BINARY_STATS_UNSUPPORTED_MSG to represent "Binary statistics does not support: %s", 
   and use String.format(BINARY_STATS_UNSUPPORTED_MSG, "min");

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MTree.java
##########
@@ -898,8 +899,8 @@ private void findPath(MNode node, String[] nodes, int idx, List<Pair<PartialPath
           continue;
         }
         findPath(child, nodes, idx + 1, timeseriesSchemaList, hasLimit, needLast, queryContext);
-        if (hasLimit) {
-          if (count.get().intValue() == limit.get().intValue()) {
+        if (hasLimit && count.get().intValue() == limit.get().intValue()) {
+           {

Review comment:
       remove this parentheses

##########
File path: server/src/main/java/org/apache/iotdb/db/metrics/source/JvmSource.java
##########
@@ -26,23 +26,23 @@
 
 public class JvmSource implements Source {
 
-  public String sourceName = "jvm";
+  public final static String SOURCE_NAME = "jvm";

Review comment:
       public static final

##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/compress/IUnCompressor.java
##########
@@ -41,6 +42,7 @@
    * @param name CompressionType
    * @return the UnCompressor of specified CompressionType
    */
+

Review comment:
       remove blank line

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
##########
@@ -200,6 +200,9 @@
   private UpdateOperator updateOp;
   private QueryOperator queryOp;
   private DeleteDataOperator deleteDataOp;
+  private static final String FOR_DELETE_STATEMENT = "For delete statement, where clause can only contain atomic expressions like : ";

Review comment:
       Combine to one error message. Call it "DELETE_RANGE_ERROR_MSG"




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org