changeset 6285:f55a99fe5ce3

Whitespace correction and cminor ruft code removal.
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 12 Jun 2013 10:43:30 +0200
parents f50d8cee3b64
children 6c0b0c6dbb76
files backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Wed Jun 12 10:34:43 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Wed Jun 12 10:43:30 2013 +0200
@@ -115,13 +115,12 @@
 
         ImportBedHeight obj = newImportBedHeight(file.getName().replaceAll("\\.csv", ""));
 
-        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 = null;
             while ((line = in.readLine()) != null) {
                 if ((line = line.trim()).length() == 0) {
@@ -140,9 +139,7 @@
             bedHeights.add(obj);
         }
         finally {
-            if (in != null) {
-                in.close();
-            }
+            in.close();
         }
     }
 
@@ -161,7 +158,7 @@
 
     public static Date getStartDateFromYear(int year) {
         Calendar cal = Calendar.getInstance();
-	cal.clear();
+	    cal.clear();
         cal.set(year, 0, 1, 0, 0, 0);
 
         return cal.getTime();
@@ -349,7 +346,7 @@
             String tmp = m.group(1).replace(";", "").trim();
 
             BedHeightType bht = BedHeightType.fetchBedHeightTypeForType(
-		tmp, ImporterSession.getInstance().getDatabaseSession());
+                tmp, ImporterSession.getInstance().getDatabaseSession());
 
             if (bht != null) {
                 obj.setType(new ImportBedHeightType(bht));

http://dive4elements.wald.intevation.org