summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.server
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2019-01-21 14:02:02 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2019-01-21 14:02:02 +0900
commitf5614e03f153757a18274723f5bb5c8a0b7a8323 (patch)
tree81f32832cee6fca78293e7d25cdae86aaa62f5de /org.eclipse.jgit.http.server
parent95d74f22fb1f4040a6c7526c76d3e6bdcba6c2ad (diff)
downloadjgit-f5614e03f153757a18274723f5bb5c8a0b7a8323.tar.gz
jgit-f5614e03f153757a18274723f5bb5c8a0b7a8323.zip
GitSmartHttpTools: Open SideBandOutputStream in try-with-resource
Change-Id: Ie7c17f98579e7241f2b5c8204435c76686eeb568 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.java9
1 files changed, 5 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 8961d1b2c8..5e09d012d7 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
@@ -299,10 +299,11 @@ public class GitSmartHttpTools {
private static void writeSideBand(OutputStream out, String textForGit)
throws IOException {
- @SuppressWarnings("resource" /* java 7 */)
- OutputStream msg = new SideBandOutputStream(CH_ERROR, SMALL_BUF, out);
- msg.write(Constants.encode("error: " + textForGit));
- msg.flush();
+ try (OutputStream msg = new SideBandOutputStream(CH_ERROR, SMALL_BUF,
+ out)) {
+ msg.write(Constants.encode("error: " + textForGit));
+ msg.flush();
+ }
}
private static void writePacket(PacketLineOut pckOut, String textForGit)