diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-06 17:41:12 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-06 17:41:12 +0900 |
commit | 6722f6927a9f5312f8872b6bd1cd73ba129b1bb3 (patch) | |
tree | b0a88419caaecfa1a14616ca6f72ea88c9dde764 /org.eclipse.jgit.http.server | |
parent | 462f04a47d48629e427c5666068f177979a8ee1a (diff) | |
download | jgit-6722f6927a9f5312f8872b6bd1cd73ba129b1bb3.tar.gz jgit-6722f6927a9f5312f8872b6bd1cd73ba129b1bb3.zip |
GitSmartHttpTools: Open OutputStream in try-with-resource
Change-Id: Ifb50b923f58f73d323cc1492950e58b6dc39f376
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.http.server')
-rw-r--r-- | org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java index d6955b4a58..b9ca12bf3d 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java @@ -314,11 +314,8 @@ public class GitSmartHttpTools { res.setStatus(HttpServletResponse.SC_OK); res.setContentType(type); res.setContentLength(buf.length); - OutputStream os = res.getOutputStream(); - try { + try (OutputStream os = res.getOutputStream()) { os.write(buf); - } finally { - os.close(); } } |