Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse2018-03-06 03:41:12 -0500
committerDavid Pursehouse2018-03-06 03:41:12 -0500
commit6722f6927a9f5312f8872b6bd1cd73ba129b1bb3 (patch)
treeb0a88419caaecfa1a14616ca6f72ea88c9dde764 /org.eclipse.jgit.http.server/src/org
parent462f04a47d48629e427c5666068f177979a8ee1a (diff)
downloadjgit-6722f6927a9f5312f8872b6bd1cd73ba129b1bb3.tar.gz
jgit-6722f6927a9f5312f8872b6bd1cd73ba129b1bb3.tar.xz
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/src/org')
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java5
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();
}
}

Back to the top