From 81fa5662953c54ba07e141284d3d9a717361b17b Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Wed, 10 Oct 2012 08:02:30 +0200 Subject: 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 --- .../src/org/eclipse/jgit/http/server/GitSmartHttpTools.java | 1 + 1 file changed, 1 insertion(+) (limited to 'org.eclipse.jgit.http.server/src/org/eclipse') 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(); -- cgit v1.2.3