flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject flink git commit: [FLINK-2424] [core] Close output stream in serialization utility
Date Wed, 29 Jul 2015 16:40:21 GMT
Repository: flink
Updated Branches:
  refs/heads/master a34c94167 -> 7bd57d789


[FLINK-2424] [core] Close output stream in serialization utility


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

Branch: refs/heads/master
Commit: 7bd57d7893ce53c389725a4536afc778dbcc5513
Parents: a34c941
Author: Ufuk Celebi <uce@apache.org>
Authored: Wed Jul 29 01:29:13 2015 +0200
Committer: Ufuk Celebi <uce@apache.org>
Committed: Wed Jul 29 18:38:49 2015 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/flink/util/InstantiationUtil.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/7bd57d78/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java b/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java
index 241e56a..6857c31 100644
--- a/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java
+++ b/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java
@@ -311,7 +311,13 @@ public class InstantiationUtil {
 	public static byte[] serializeObject(Object o) throws IOException {
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
 		ObjectOutputStream oos = new ObjectOutputStream(baos);
-		oos.writeObject(o);
+
+		try {
+			oos.writeObject(o);
+		}
+		finally {
+			oos.close();
+		}
 
 		return baos.toByteArray();
 	}


Mime
View raw message