flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [5/9] flink git commit: [FLINK-1193][java-api][scala-api] Fix copy method for ObjectArraySerializer
Date Tue, 03 Feb 2015 12:23:44 GMT
[FLINK-1193][java-api][scala-api] Fix copy method for ObjectArraySerializer


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

Branch: refs/heads/master
Commit: 9906cbaac549ec90fb6e9517091436d256935897
Parents: 57b3e9f
Author: Stephan Ewen <sewen@apache.org>
Authored: Tue Feb 3 11:53:13 2015 +0100
Committer: Stephan Ewen <sewen@apache.org>
Committed: Tue Feb 3 11:53:13 2015 +0100

----------------------------------------------------------------------
 .../flink/api/common/typeutils/base/GenericArraySerializer.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/9906cbaa/flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/GenericArraySerializer.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/GenericArraySerializer.java
b/flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/GenericArraySerializer.java
index c4c1102..b8612a2 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/GenericArraySerializer.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/GenericArraySerializer.java
@@ -72,8 +72,9 @@ public final class GenericArraySerializer<C> extends TypeSerializer<C[]>
{
 		C[] copy = create(from.length);
 
 		for (int i = 0; i < copy.length; i++) {
-			if (from[i] != null) {
-				copy[i] = this.componentSerializer.copy(from[i], this.componentSerializer.createInstance());
+			C val = from[i];
+			if (val != null) {
+				copy[i] = this.componentSerializer.copy(val);
 			}
 		}
 


Mime
View raw message