flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twal...@apache.org
Subject flink git commit: [FLINK-4601] [java] Check for empty string properly
Date Fri, 09 Sep 2016 10:17:53 GMT
Repository: flink
Updated Branches:
  refs/heads/master 95b673f0b -> e92f91aeb


[FLINK-4601] [java] Check for empty string properly

This closes #2483.


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

Branch: refs/heads/master
Commit: e92f91aeba3c9e8da5a5ff9efda342cb19da928c
Parents: 95b673f
Author: Alexander Pivovarov <apivovarov@gmail.com>
Authored: Thu Sep 8 23:58:45 2016 -0700
Committer: twalthr <twalthr@apache.org>
Committed: Fri Sep 9 12:16:18 2016 +0200

----------------------------------------------------------------------
 .../org/apache/flink/api/java/sca/UdfAnalyzerExamplesTest.java     | 2 +-
 .../test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/e92f91ae/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerExamplesTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerExamplesTest.java
b/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerExamplesTest.java
index 5254b68..11ab5f2 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerExamplesTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerExamplesTest.java
@@ -548,7 +548,7 @@ public class UdfAnalyzerExamplesTest {
 				if (i == 42 - 1) {
 					p.setLabel(new Integer(split[i].trim().substring(0, 1)));
 				} else {
-					if (a < 42 && split[i].trim() != "") {
+					if (a < 42 && !split[i].trim().isEmpty()) {
 						features[a++] = Double.parseDouble(split[i].trim());
 					}
 				}

http://git-wip-us.apache.org/repos/asf/flink/blob/e92f91ae/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java b/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java
index dc2d1db..20ce261 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java
@@ -1101,7 +1101,7 @@ public class UdfAnalyzerTest {
 	public static class Reduce2 implements ReduceFunction<MyPojo> {
 		@Override
 		public MyPojo reduce(MyPojo value1, MyPojo value2) throws Exception {
-			if (value1.field == "") {
+			if (value1.field != null && value1.field.isEmpty()) {
 				return value2;
 			}
 			return value1;


Mime
View raw message