flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [3/3] flink git commit: [FLINK-6530] Close response in DatadogHttpClient
Date Sat, 13 May 2017 19:46:17 GMT
[FLINK-6530] Close response in DatadogHttpClient

This closes #3892.


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

Branch: refs/heads/master
Commit: 50c88d5b14d58f138a3c95d31e3702f01c459e3f
Parents: 4d71911
Author: zentol <chesnay@apache.org>
Authored: Sat May 13 17:45:46 2017 +0200
Committer: zentol <chesnay@apache.org>
Committed: Sat May 13 18:16:45 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/flink/metrics/datadog/DatadogHttpClient.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/50c88d5b/flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpClient.java
----------------------------------------------------------------------
diff --git a/flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpClient.java
b/flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpClient.java
index dfbcee1..c94a2b7 100644
--- a/flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpClient.java
+++ b/flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpClient.java
@@ -64,8 +64,7 @@ public class DatadogHttpClient{
 	private void validateApiKey() {
 		Request r = new Request.Builder().url(validateUrl).get().build();
 
-		try {
-			Response response = client.newCall(r).execute();
+		try (Response response = client.newCall(r).execute()) {
 			if (!response.isSuccessful()) {
 				throw new IllegalArgumentException(
 					String.format("API key: %s is invalid", apiKey));


Mime
View raw message