diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2019-03-01 10:39:06 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-03-06 11:37:12 +0100 |
commit | 43f50ec573929c8674e6a65fd48fb4fb63ae8b41 (patch) | |
tree | bad710d41a95644624152004609178a837f19948 /sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpResponse.java | |
parent | 9e05ef0fb03d6f6efbba3ee4d0e9955aba00d6cd (diff) | |
download | sonarqube-43f50ec573929c8674e6a65fd48fb4fb63ae8b41.tar.gz sonarqube-43f50ec573929c8674e6a65fd48fb4fb63ae8b41.zip |
Close properly okhttp connections in ITs
Diffstat (limited to 'sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpResponse.java')
-rw-r--r-- | sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpResponse.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpResponse.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpResponse.java index 4b50d8796e5..143589d0bd4 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpResponse.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/OkHttpResponse.java @@ -77,13 +77,10 @@ class OkHttpResponse extends BaseResponse { */ @Override public String content() { - ResponseBody body = okResponse.body(); - try { + try (ResponseBody body = okResponse.body()) { return body.string(); } catch (IOException e) { throw fail(e); - } finally { - body.close(); } } |