From 23f49aa90131e967da6413d91a4353e43ca5c7d9 Mon Sep 17 00:00:00 2001 From: tkellner Date: Mon, 3 Mar 2014 16:28:36 +0000 Subject: Get rid of unclosed stream warning git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1300 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'BKUOnline/src/main/java/at/gv/egiz') diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java index 67253f24..37cc213d 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java +++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java @@ -115,8 +115,8 @@ public class ResultServlet extends HttpServlet { HTTPBindingProcessor bp = (HTTPBindingProcessor) bindingProcessor; + OutputStream outputStream = null; try { - OutputStream outputStream; String redirectUrl = bp.getRedirectURL(); if (redirectUrl != null && !redirectUrl.trim().isEmpty()) { log.info("Sending (deferred) redirect to {}.", redirectUrl); @@ -141,8 +141,9 @@ public class ResultServlet extends HttpServlet { outputStream = resp.getOutputStream(); } bp.writeResultTo(outputStream, responseEncoding); - outputStream.close(); } finally { + if (outputStream != null) + outputStream.close(); bindingProcessorManager.removeBindingProcessor(id); } } -- cgit v1.2.3