Skip to content

Commit 70a905a

Browse files
committed
changed for loop to while (just to make sonar happy). removed unused imports and undeprecated ClickHouseUtils as we use it
1 parent 74bb966 commit 70a905a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseColumn.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,12 @@ public static void parseJSONColumn(String args, List<ClickHouseColumn> nestedCol
688688
String name = null;
689689
ClickHouseColumn column = null;
690690
StringBuilder builder = new StringBuilder();
691-
for (int i = 0, len = args.length(); i < len; i++) {
691+
int i =0;
692+
int len = args.length();
693+
while (i < len) {
692694
char ch = args.charAt(i);
693695
if (Character.isWhitespace(ch)) {
696+
i++;
694697
continue;
695698
}
696699

@@ -709,12 +712,15 @@ public static void parseJSONColumn(String args, List<ClickHouseColumn> nestedCol
709712
} else if (column == null) { // now type
710713
LinkedList<ClickHouseColumn> colList = new LinkedList<>();
711714
i = readColumn(args, i, len, name, colList) - 1;
712-
nestedColumns.add(column = colList.getFirst());
715+
column = colList.getFirst();
716+
nestedColumns.add(column);
713717
} else { // prepare for next column
714718
i = ClickHouseUtils.skipContentsUntil(args, i, len, ',') - 1;
715719
name = null;
716720
column = null;
717721
}
722+
723+
i++;
718724
}
719725
}
720726

clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
import java.util.function.Supplier;
5252
import java.util.function.UnaryOperator;
5353

54-
@Deprecated
5554
public final class ClickHouseUtils {
5655
private static final boolean IS_UNIX;
5756
private static final boolean IS_WINDOWS;

client-v2/src/main/java/com/clickhouse/client/api/data_formats/internal/BinaryStreamReader.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.clickhouse.client.api.data_formats.internal;
22

33
import com.clickhouse.client.api.ClientException;
4-
import com.clickhouse.client.api.DataTransferException;
54
import com.clickhouse.data.ClickHouseColumn;
65
import com.clickhouse.data.ClickHouseDataType;
76
import com.clickhouse.data.ClickHouseEnum;
@@ -36,8 +35,6 @@
3635
import java.util.Set;
3736
import java.util.TimeZone;
3837
import java.util.UUID;
39-
import java.util.function.Function;
40-
import java.util.stream.Collectors;
4138

4239
/**
4340
* This class is not thread safe and should not be shared between multiple threads.

0 commit comments

Comments
 (0)