[Dive4elements-commits] [PATCH 1 of 2] Backend: Removed cruft code

Wald Commits scm-commit at wald.intevation.org
Fri Jun 14 12:32:33 CEST 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1371205838 -7200
# Node ID b58a71a5720c160d7d8b74dba08bf29bbb9a0b24
# Parent  f5bb53106ae82f6111825a370808eba8a93c86de
Backend: Removed cruft code

diff -r f5bb53106ae8 -r b58a71a5720c backend/src/main/java/org/dive4elements/river/importer/parsers/StaFileParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/StaFileParser.java	Thu Jun 13 17:24:56 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/StaFileParser.java	Fri Jun 14 12:30:38 2013 +0200
@@ -51,13 +51,12 @@
         File file = gauge.getStaFile();
 
         log.info("parsing STA file: " + file);
-        LineNumberReader in = null;
+        LineNumberReader in =
+            new LineNumberReader(
+            new InputStreamReader(
+            new FileInputStream(file), ENCODING));
+
         try {
-            in =
-                new LineNumberReader(
-                new InputStreamReader(
-                new FileInputStream(file), ENCODING));
-
             String line = in.readLine();
 
             if (line == null) {
@@ -188,9 +187,7 @@
             gauge.setMainValues(mainValues);
         }
         finally {
-            if (in != null) {
-                in.close();
-            }
+            in.close();
         }
         log.info("finished parsing STA file: " + file);
         return true;


More information about the Dive4elements-commits mailing list