flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [2/5] flink git commit: [FLINK-3196] InputStream should be closed in EnvironmentInformation#getRevisionInformation()
Date Thu, 28 Jan 2016 15:32:17 GMT
[FLINK-3196] InputStream should be closed in EnvironmentInformation#getRevisionInformation()

This closes #1552


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

Branch: refs/heads/master
Commit: f6d2ce91eccb92ab7e4c63dd799d7e0f6a9df9bf
Parents: c4e5a55
Author: smarthi <smarthi@apache.org>
Authored: Tue Jan 26 23:42:33 2016 -0500
Committer: Stephan Ewen <sewen@apache.org>
Committed: Thu Jan 28 14:21:32 2016 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/flink/optimizer/util/Utils.java   | 4 ++--
 .../org/apache/flink/runtime/util/EnvironmentInformation.java  | 6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/f6d2ce91/flink-optimizer/src/main/java/org/apache/flink/optimizer/util/Utils.java
----------------------------------------------------------------------
diff --git a/flink-optimizer/src/main/java/org/apache/flink/optimizer/util/Utils.java b/flink-optimizer/src/main/java/org/apache/flink/optimizer/util/Utils.java
index 1099028..97dd917 100644
--- a/flink-optimizer/src/main/java/org/apache/flink/optimizer/util/Utils.java
+++ b/flink-optimizer/src/main/java/org/apache/flink/optimizer/util/Utils.java
@@ -104,10 +104,10 @@ public final class Utils {
 			throw new RuntimeException("Unrecognized type: " + typeInfo);
 		}
 
-		return new RuntimeComparatorFactory<T>(comparator);
+		return new RuntimeComparatorFactory<>(comparator);
 	}
 
-	private static final boolean[] getSortOrders(FieldList keys, boolean[] orders) {
+	private static boolean[] getSortOrders(FieldList keys, boolean[] orders) {
 		if (orders == null) {
 			orders = new boolean[keys.size()];
 			Arrays.fill(orders, true);

http://git-wip-us.apache.org/repos/asf/flink/blob/f6d2ce91/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
index 1cb403b..3b75b9f 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
@@ -60,8 +60,7 @@ public class EnvironmentInformation {
 	public static RevisionInformation getRevisionInformation() {
 		String revision = UNKNOWN;
 		String commitDate = UNKNOWN;
-		try {
-			InputStream propFile = EnvironmentInformation.class.getClassLoader().getResourceAsStream(".version.properties");
+		try (InputStream propFile = EnvironmentInformation.class.getClassLoader().getResourceAsStream(".version.properties"))
{
 			if (propFile != null) {
 				Properties properties = new Properties();
 				properties.load(propFile);
@@ -70,8 +69,7 @@ public class EnvironmentInformation {
 				revision = propRevision != null ? propRevision : UNKNOWN;
 				commitDate = propCommitDate != null ? propCommitDate : UNKNOWN;
 			}
-		}
-		catch (Throwable t) {
+		} catch (Throwable t) {
 			if (LOG.isDebugEnabled()) {
 				LOG.debug("Cannot determine code revision: Unable to read version property file.", t);
 			} else {


Mime
View raw message