Browse Source

GitSmartHttpTools: Open OutputStream in try-with-resource

Change-Id: Ifb50b923f58f73d323cc1492950e58b6dc39f376
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.11
David Pursehouse 7 years ago
parent
commit
6722f6927a
  1. 5
      org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java

5
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();
}
}

Loading…
Cancel
Save