commit a12af627cdb812d0ef32fb99e5383b4993ee764e Author: Karsten Loesing karsten.loesing@gmx.net Date: Wed Jul 25 09:00:33 2012 +0200
Close a few readers/streams, spotted by Eclipse. --- .../ernie/cron/ExoneraTorDatabaseImporter.java | 1 + src/org/torproject/ernie/web/RObjectGenerator.java | 1 + .../torproject/ernie/web/ResearchDataServlet.java | 1 + 3 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/org/torproject/ernie/cron/ExoneraTorDatabaseImporter.java b/src/org/torproject/ernie/cron/ExoneraTorDatabaseImporter.java index c87236e..c23b4eb 100755 --- a/src/org/torproject/ernie/cron/ExoneraTorDatabaseImporter.java +++ b/src/org/torproject/ernie/cron/ExoneraTorDatabaseImporter.java @@ -153,6 +153,7 @@ public class ExoneraTorDatabaseImporter { + "contains a corrupt entry in line " + lineNumber + ". Ignoring parse history file entirely."); lastImportHistory.clear(); + br.close(); return; } long lastModified = Long.parseLong(parts[0]); diff --git a/src/org/torproject/ernie/web/RObjectGenerator.java b/src/org/torproject/ernie/web/RObjectGenerator.java index 993bc59..1b56f31 100644 --- a/src/org/torproject/ernie/web/RObjectGenerator.java +++ b/src/org/torproject/ernie/web/RObjectGenerator.java @@ -410,6 +410,7 @@ public class RObjectGenerator implements ServletContextListener { while ((length = bis.read(buffer)) > 0) { baos.write(buffer, 0, length); } + bis.close(); this.result = baos.toByteArray(); } catch (IOException e) { return; diff --git a/src/org/torproject/ernie/web/ResearchDataServlet.java b/src/org/torproject/ernie/web/ResearchDataServlet.java index e8ae79d..8adb06c 100644 --- a/src/org/torproject/ernie/web/ResearchDataServlet.java +++ b/src/org/torproject/ernie/web/ResearchDataServlet.java @@ -54,6 +54,7 @@ public class ResearchDataServlet extends HttpServlet { dataFileUrls.add(line); } } + br.close(); } } catch (SecurityException e) { /* We're not permitted to read the file with URLs. Ignore. */
tor-commits@lists.torproject.org