kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: MINOR: Check null in SmokeTestDriver to avoid NPE
Date Tue, 12 Jul 2016 19:15:20 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 98dfc4b30 -> 3537063a5


MINOR: Check null in SmokeTestDriver to avoid NPE

Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Damian Guy <damian.guy@gmail.com>

Closes #1611 from guozhangwang/Kminor-check-null-smokedriver


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/3537063a
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/3537063a
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/3537063a

Branch: refs/heads/trunk
Commit: 3537063a52b97b6d46f6bd17e3f03e1b03630a3e
Parents: 98dfc4b
Author: Guozhang Wang <wangguoz@gmail.com>
Authored: Tue Jul 12 12:15:16 2016 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Tue Jul 12 12:15:16 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/kafka/streams/smoketest/SmokeTestDriver.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/3537063a/streams/src/test/java/org/apache/kafka/streams/smoketest/SmokeTestDriver.java
----------------------------------------------------------------------
diff --git a/streams/src/test/java/org/apache/kafka/streams/smoketest/SmokeTestDriver.java
b/streams/src/test/java/org/apache/kafka/streams/smoketest/SmokeTestDriver.java
index 205ba4b..b22d8a7 100644
--- a/streams/src/test/java/org/apache/kafka/streams/smoketest/SmokeTestDriver.java
+++ b/streams/src/test/java/org/apache/kafka/streams/smoketest/SmokeTestDriver.java
@@ -379,7 +379,7 @@ public class SmokeTestDriver extends SmokeTestUtil {
                 int min = getMin(entry.getKey());
                 int max = getMax(entry.getKey());
                 int expected = max - min;
-                if (expected != entry.getValue()) {
+                if (entry.getValue() == null || expected != entry.getValue()) {
                     System.out.println("fail: key=" + entry.getKey() + " dif=" + entry.getValue()
+ " expected=" + expected);
                     success = false;
                 }
@@ -455,7 +455,7 @@ public class SmokeTestDriver extends SmokeTestUtil {
                 int max = getMax(entry.getKey());
                 double expected = ((long) min + (long) max) / 2.0;
 
-                if (expected != entry.getValue()) {
+                if (entry.getValue() == null || expected != entry.getValue()) {
                     System.out.println("fail: key=" + entry.getKey() + " avg=" + entry.getValue()
+ " expected=" + expected);
                     success = false;
                 }


Mime
View raw message