summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.server
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2012-10-10 08:02:30 +0200
committerShawn O. Pearce <spearce@spearce.org>2012-10-25 15:17:23 -0700
commit81fa5662953c54ba07e141284d3d9a717361b17b (patch)
tree958ada4e4c6b7b385d50fac305333c3646988dde /org.eclipse.jgit.http.server
parentbc8794eb21319c3251cd778133541d60856eb626 (diff)
downloadjgit-81fa5662953c54ba07e141284d3d9a717361b17b.tar.gz
jgit-81fa5662953c54ba07e141284d3d9a717361b17b.zip
Suppress resource warnings with Java 7
For streams that should not be closed, i.e. don't own an underlying stream, and in-memory streams that do not need to be closed we just suppress the warning. This mostly apply to test cases. GC is enough. For streams with external resources (i.e. files) we add the necessary call to close(). Change-Id: I4d883ba2e7d07f199fe57ccb3459ece00441a570
Diffstat (limited to 'org.eclipse.jgit.http.server')
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java1
1 files changed, 1 insertions, 0 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 ab4d0da345..92d575c2d0 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
@@ -297,6 +297,7 @@ 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();