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

nnag pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/geode-kafka-connector.git


The following commit(s) were added to refs/heads/master by this push:
     new 75d1107  Static analyzer changes
75d1107 is described below

commit 75d110702d52630b5d5d591bc38903fe0ad92ce4
Author: Naburun Nag <n...@cs.wisc.edu>
AuthorDate: Wed Feb 19 13:18:37 2020 -0800

    Static analyzer changes
---
 src/main/java/org/apache/geode/kafka/sink/BatchRecords.java       | 4 +---
 .../java/org/apache/geode/kafka/GeodeConnectorConfigTest.java     | 8 ++++----
 .../org/apache/geode/kafka/source/GeodeKafkaSourceTaskTest.java   | 2 +-
 .../java/org/apache/geode/kafka/utilities/KafkaLocalCluster.java  | 2 +-
 4 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/geode/kafka/sink/BatchRecords.java 
b/src/main/java/org/apache/geode/kafka/sink/BatchRecords.java
index 45a93d6..073e5ea 100644
--- a/src/main/java/org/apache/geode/kafka/sink/BatchRecords.java
+++ b/src/main/java/org/apache/geode/kafka/sink/BatchRecords.java
@@ -61,9 +61,7 @@ public class BatchRecords {
     // if so if a previous value was in the remove list
     // let's not remove it at the end of this operation
     if (nullValuesMeansRemove) {
-      if (removeList.contains(record.key())) {
-        removeList.remove(record.key());
-      }
+      removeList.remove(record.key());
     }
     updateMap.put(record.key(), record.value());
   }
diff --git a/src/test/java/org/apache/geode/kafka/GeodeConnectorConfigTest.java 
b/src/test/java/org/apache/geode/kafka/GeodeConnectorConfigTest.java
index db7d921..dfe786c 100644
--- a/src/test/java/org/apache/geode/kafka/GeodeConnectorConfigTest.java
+++ b/src/test/java/org/apache/geode/kafka/GeodeConnectorConfigTest.java
@@ -82,8 +82,8 @@ public class GeodeConnectorConfigTest {
 
   public List<String> oneToOneBindings() {
     return Arrays.asList(
-        new String[] {"[region1:topic1],[region2:topic2]", "[region1:topic1] , 
[region2:topic2]",
-            "[region1:topic1], [region2:topic2] ,", "[region1: topic1], 
[region2 :topic2]"});
+        "[region1:topic1],[region2:topic2]", "[region1:topic1] , 
[region2:topic2]",
+        "[region1:topic1], [region2:topic2] ,", "[region1: topic1], [region2 
:topic2]");
   }
 
   @Test
@@ -94,10 +94,10 @@ public class GeodeConnectorConfigTest {
   }
 
   public List<String> oneToManyBindings() {
-    return Arrays.asList(new String[] 
{"[region1:topic1,topic2],[region2:topic2,topic3]",
+    return Arrays.asList("[region1:topic1,topic2],[region2:topic2,topic3]",
         "[region1:topic1 , topic2] , [region2:topic2 , topic3]",
         "[region1:topic1 ,], [region2:topic2 ,] ,",
-        "[region1: topic1 ,topic3], [region2 :topic2]"});
+        "[region1: topic1 ,topic3], [region2 :topic2]");
   }
 
   @Test
diff --git 
a/src/test/java/org/apache/geode/kafka/source/GeodeKafkaSourceTaskTest.java 
b/src/test/java/org/apache/geode/kafka/source/GeodeKafkaSourceTaskTest.java
index bf427fd..a8d6122 100644
--- a/src/test/java/org/apache/geode/kafka/source/GeodeKafkaSourceTaskTest.java
+++ b/src/test/java/org/apache/geode/kafka/source/GeodeKafkaSourceTaskTest.java
@@ -200,7 +200,7 @@ public class GeodeKafkaSourceTaskTest {
   @Test
   public void createSourcePartitionsShouldReturnAMapOfSourcePartitions() {
     GeodeKafkaSourceTask task = new GeodeKafkaSourceTask();
-    List<String> regionNames = Arrays.asList(new String[] {"region1", 
"region2", "region3"});
+    List<String> regionNames = Arrays.asList("region1", "region2", "region3");
     Map<String, Map<String, String>> sourcePartitions = 
task.createSourcePartitionsMap(regionNames);
     assertThat(3, is(sourcePartitions.size()));
     assertThat(true, 
is(sourcePartitions.get("region1").get(REGION_PARTITION).equals("region1")));
diff --git 
a/src/test/java/org/apache/geode/kafka/utilities/KafkaLocalCluster.java 
b/src/test/java/org/apache/geode/kafka/utilities/KafkaLocalCluster.java
index 338e819..f342aa4 100644
--- a/src/test/java/org/apache/geode/kafka/utilities/KafkaLocalCluster.java
+++ b/src/test/java/org/apache/geode/kafka/utilities/KafkaLocalCluster.java
@@ -34,7 +34,7 @@ public class KafkaLocalCluster {
       kafka.startup();
       System.out.println("Kafka started up");
     } catch (Throwable t) {
-      System.out.println(t);
+      System.out.println(t.getMessage());
     }
   }
 

Reply via email to