Skip to content

Commit 19c9589

Browse files
author
Vihas Splunk
committed
fix: sonar
1 parent ccf75af commit 19c9589

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

src/main/java/com/splunk/hecclient/ConcurrentHec.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public final void close() {
7474
}
7575

7676
stopped = true;
77-
// executorService.shutdownNow();
7877
executorService.shutdown();
7978
}
8079

src/main/java/com/splunk/hecclient/Indexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private String readAndCloseResponse(CloseableHttpResponse resp) {
272272

273273
String respText = (jsonNode.has("text")) ? jsonNode.get("text").asText() : null;
274274

275-
if (respText == "Invalid data format") {
275+
if (respText.equals("Invalid data format")) {
276276
ObjectNode objNode = jsonMapper.createObjectNode();
277277
objNode.put("text", "Invalid data format");
278278
objNode.put("code", 0); // Mark it as success

src/main/java/com/splunk/hecclient/JsonEventBatch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public int hashCode() {
5757
public boolean equals(Object obj) {
5858
if (obj instanceof JsonEventBatch) {
5959
final JsonEventBatch other = (JsonEventBatch) obj;
60-
return endpoint.equals(endpoint);
60+
return obj.equals(other);
6161
}
6262
return false;
6363
}

src/main/java/com/splunk/kafka/connect/SplunkSinkTask.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void start(Map<String, String> taskConfig) {
7171
tracker = new KafkaRecordTracker();
7272
bufferedRecords = new ArrayList<>();
7373
if(connectorConfig.flushWindow > 0) {
74-
flushWindow = connectorConfig.flushWindow * 1000; // Flush window set to user configured value (Multiply by 1000 as all the calculations are done in milliseconds)
74+
flushWindow = connectorConfig.flushWindow * Long.valueOf(1000); // Flush window set to user configured value (Multiply by 1000 as all the calculations are done in milliseconds)
7575
}
7676

7777
log.info("kafka-connect-splunk task starts with config={}", connectorConfig);
@@ -569,8 +569,7 @@ private void timestampExtraction(Event event) {
569569

570570
if (connectorConfig.timestampFormat.equalsIgnoreCase("epoch")) {
571571
try {
572-
double epoch;
573-
epoch = ((Double.parseDouble(timestamp)));
572+
double epoch = (Double.parseDouble(timestamp));
574573
long long_epoch = Double.valueOf(epoch).longValue();
575574
event.setTime(epoch / (Math.pow(10, Long.toString(long_epoch).length()-10.00)));
576575

0 commit comments

Comments
 (0)