You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2021/02/21 06:38:54 UTC

[iotdb] branch master updated: [IOTDB-1165] Using Java Style array declaration

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

hxd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new aefd8ef  [IOTDB-1165] Using Java Style array declaration
aefd8ef is described below

commit aefd8ef01b5057968ac44ff09b3889386c776961
Author: sunjincheng121 <su...@gmail.com>
AuthorDate: Sun Feb 21 09:32:05 2021 +0800

    [IOTDB-1165] Using Java Style array declaration
---
 .../java/org/apache/iotdb/tsfile/TsFileWriteWithTSRecord.java     | 2 +-
 .../apache/iotdb/db/engine/memtable/PrimitiveMemTableTest.java    | 4 ++--
 .../java/org/apache/iotdb/db/qp/physical/SerializationTest.java   | 4 ++--
 .../apache/iotdb/tsfile/encoding/bitpacking/IntPackerTest.java    | 2 +-
 .../apache/iotdb/tsfile/encoding/bitpacking/LongPackerTest.java   | 2 +-
 .../encoding/decoder/delta/DeltaBinaryEncoderIntegerTest.java     | 8 ++++----
 .../tsfile/encoding/decoder/delta/DeltaBinaryEncoderLongTest.java | 8 ++++----
 7 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileWriteWithTSRecord.java b/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileWriteWithTSRecord.java
index 2a8af67..a086958 100644
--- a/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileWriteWithTSRecord.java
+++ b/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileWriteWithTSRecord.java
@@ -37,7 +37,7 @@ import java.io.File;
  */
 public class TsFileWriteWithTSRecord {
 
-  public static void main(String args[]) {
+  public static void main(String[] args) {
     try {
       String path = "test.tsfile";
       File f = FSFactoryProducer.getFSFactory().getFile(path);
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTableTest.java b/server/src/test/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTableTest.java
index c202dbd..907beb2 100644
--- a/server/src/test/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTableTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTableTest.java
@@ -75,7 +75,7 @@ public class PrimitiveMemTableTest {
     IMemTable memTable = new PrimitiveMemTable();
     int count = 10;
     String deviceId = "d1";
-    String measurementId[] = new String[count];
+    String[] measurementId = new String[count];
     for (int i = 0; i < measurementId.length; i++) {
       measurementId[i] = "s" + i;
     }
@@ -186,7 +186,7 @@ public class PrimitiveMemTableTest {
     IMemTable memTable = new PrimitiveMemTable();
     int count = 10;
     String deviceId = "d1";
-    String measurementId[] = new String[count];
+    String[] measurementId = new String[count];
     for (int i = 0; i < measurementId.length; i++) {
       measurementId[i] = "s" + i;
     }
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/physical/SerializationTest.java b/server/src/test/java/org/apache/iotdb/db/qp/physical/SerializationTest.java
index 523f04f..83834cd 100644
--- a/server/src/test/java/org/apache/iotdb/db/qp/physical/SerializationTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/qp/physical/SerializationTest.java
@@ -111,8 +111,8 @@ public class SerializationTest {
   public void testFlush() throws IOException, IllegalPathException {
     Map<PartialPath, List<Pair<Long, Boolean>>> storageGroupPartitionIds = new HashMap<>();
 
-    Boolean isSeqArray[] = new Boolean[] {null, true};
-    boolean isSyncArray[] = new boolean[] {true, false};
+    Boolean[] isSeqArray = new Boolean[] {null, true};
+    boolean[] isSyncArray = new boolean[] {true, false};
     Random random = new Random();
     for (int i = 0; i < 10; i++) {
       List<Pair<Long, Boolean>> partitionIdPairs = new ArrayList<>();
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/bitpacking/IntPackerTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/bitpacking/IntPackerTest.java
index 6ddcfc2..745766c 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/bitpacking/IntPackerTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/bitpacking/IntPackerTest.java
@@ -50,7 +50,7 @@ public class IntPackerTest {
         bb[idx++] = tb[j];
       }
     }
-    int res[] = new int[count * 8];
+    int[] res = new int[count * 8];
     packer.unpackAllValues(bb, bb.length, res);
 
     for (int i = 0; i < count * 8; i++) {
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/bitpacking/LongPackerTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/bitpacking/LongPackerTest.java
index 05019a4..0615865 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/bitpacking/LongPackerTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/bitpacking/LongPackerTest.java
@@ -59,7 +59,7 @@ public class LongPackerTest {
         bb[idx++] = tb[j];
       }
     }
-    long tres[] = new long[count * 8];
+    long[] tres = new long[count * 8];
     packer.unpackAllValues(bb, bb.length, tres);
 
     for (int i = 0; i < count * 8; i++) {
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/delta/DeltaBinaryEncoderIntegerTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/delta/DeltaBinaryEncoderIntegerTest.java
index 0064afe..2af5b52 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/delta/DeltaBinaryEncoderIntegerTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/delta/DeltaBinaryEncoderIntegerTest.java
@@ -48,7 +48,7 @@ public class DeltaBinaryEncoderIntegerTest {
 
   @Test
   public void testBasic() throws IOException {
-    int data[] = new int[ROW_NUM];
+    int[] data = new int[ROW_NUM];
     for (int i = 0; i < ROW_NUM; i++) {
       data[i] = i * i;
     }
@@ -57,7 +57,7 @@ public class DeltaBinaryEncoderIntegerTest {
 
   @Test
   public void testBoundInt() throws IOException {
-    int data[] = new int[ROW_NUM];
+    int[] data = new int[ROW_NUM];
     for (int i = 0; i < 10; i++) {
       boundInt(i, data);
     }
@@ -72,7 +72,7 @@ public class DeltaBinaryEncoderIntegerTest {
 
   @Test
   public void testRandom() throws IOException {
-    int data[] = new int[ROW_NUM];
+    int[] data = new int[ROW_NUM];
     for (int i = 0; i < ROW_NUM; i++) {
       data[i] = ran.nextInt();
     }
@@ -81,7 +81,7 @@ public class DeltaBinaryEncoderIntegerTest {
 
   @Test
   public void testMaxMin() throws IOException {
-    int data[] = new int[ROW_NUM];
+    int[] data = new int[ROW_NUM];
     for (int i = 0; i < ROW_NUM; i++) {
       data[i] = (i & 1) == 0 ? Integer.MAX_VALUE : Integer.MIN_VALUE;
     }
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/delta/DeltaBinaryEncoderLongTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/delta/DeltaBinaryEncoderLongTest.java
index 762c0de..dc0766d 100644
--- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/delta/DeltaBinaryEncoderLongTest.java
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/delta/DeltaBinaryEncoderLongTest.java
@@ -59,7 +59,7 @@ public class DeltaBinaryEncoderLongTest {
   @Test
   public void testBasic() throws IOException {
     reader.reset();
-    long data[] = new long[ROW_NUM];
+    long[] data = new long[ROW_NUM];
     for (int i = 0; i < ROW_NUM; i++) {
       data[i] = i * i * BASIC_FACTOR;
     }
@@ -69,7 +69,7 @@ public class DeltaBinaryEncoderLongTest {
   @Test
   public void testBoundInt() throws IOException {
     reader.reset();
-    long data[] = new long[ROW_NUM];
+    long[] data = new long[ROW_NUM];
     for (int i = 2; i < 21; i++) {
       boundInt(i, data);
     }
@@ -86,7 +86,7 @@ public class DeltaBinaryEncoderLongTest {
   @Test
   public void testRandom() throws IOException {
     reader.reset();
-    long data[] = new long[ROW_NUM];
+    long[] data = new long[ROW_NUM];
     for (int i = 0; i < ROW_NUM; i++) {
       data[i] = ran.nextLong();
     }
@@ -96,7 +96,7 @@ public class DeltaBinaryEncoderLongTest {
   @Test
   public void testMaxMin() throws IOException {
     reader.reset();
-    long data[] = new long[ROW_NUM];
+    long[] data = new long[ROW_NUM];
     for (int i = 0; i < ROW_NUM; i++) {
       data[i] = (i & 1) == 0 ? Long.MAX_VALUE : Long.MIN_VALUE;
     }