[Dive4elements-commits] [PATCH] Removed obsolete imports. Minor code simplifications

Wald Commits scm-commit at wald.intevation.org
Thu Mar 28 15:55:43 CET 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1364482534 -3600
# Node ID 57f802db5c5ab39f2e4116273b6caa660ccaa26c
# Parent  1b036a409575900c51cc78ed179f35322aa94211
Removed obsolete imports. Minor code simplifications.

diff -r 1b036a409575 -r 57f802db5c5a flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MeasurementStationInfoService.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MeasurementStationInfoService.java	Thu Mar 28 15:35:42 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MeasurementStationInfoService.java	Thu Mar 28 15:55:34 2013 +0100
@@ -15,7 +15,6 @@
 import de.intevation.artifacts.GlobalContext;
 
 import de.intevation.flys.model.MeasurementStation;
-import de.intevation.flys.model.Gauge;
 import de.intevation.flys.model.Range;
 import de.intevation.flys.model.TimeInterval;
 
diff -r 1b036a409575 -r 57f802db5c5a flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/sq/SQStaticState.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/sq/SQStaticState.java	Thu Mar 28 15:35:42 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/sq/SQStaticState.java	Thu Mar 28 15:55:34 2013 +0100
@@ -1,11 +1,8 @@
 package de.intevation.flys.artifacts.states.sq;
 
 import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
 import java.util.List;
 
-import javax.swing.text.DateFormatter;
 
 import org.apache.log4j.Logger;
 
@@ -44,7 +41,7 @@
 
         int ms = -1;
         try {
-            ms = Integer.valueOf(measurementStation);
+            ms = Integer.parseInt(measurementStation);
         }
         catch (NumberFormatException nfe) {
             log.error("Unparseable measurement station: " + measurementStation);
@@ -54,13 +51,12 @@
         StaticSQContainer sqRelations =
             StaticSQFactory.getSQRelations(river, ms);
 
-        for (int i = 0; i < StaticSQRelation.Parameter.values().length; i++) {
-            StaticSQRelation.Parameter p =
-                StaticSQRelation.Parameter.values()[i];
+        for (StaticSQRelation.Parameter p: StaticSQRelation.Parameter.values()) {
 
             List<StaticSQRelation> relations =
                 sqRelations.getRelationsByParameter(p);
-            if (relations.size() > 0) {
+
+            if (!relations.isEmpty()) {
                 int count = 0;
 
                 for (StaticSQRelation relation : relations) {


More information about the Dive4elements-commits mailing list