aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs.server
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.lfs.server')
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java
index 018102f793..36dc7606b4 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java
@@ -178,10 +178,10 @@ public class FileLfsServlet extends HttpServlet {
protected static void sendError(HttpServletResponse rsp, int status, String message)
throws IOException {
rsp.setStatus(status);
- PrintWriter writer = rsp.getWriter();
- LfsGson.toJson(message, writer);
- writer.flush();
- writer.close();
+ try (PrintWriter writer = rsp.getWriter()) {
+ LfsGson.toJson(message, writer);
+ writer.flush();
+ }
rsp.flushBuffer();
}
}