[PATCH] Tidied

Wald Commits scm-commit at wald.intevation.org
Wed Dec 2 19:35:32 CET 2015


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1449081311 -3600
# Node ID 1116079e66245ceea35f00ce911301e541fee438
# Parent  76c84294c1d394c2c03d44bd9a8637356d86f960
Tidied.

diff -r 76c84294c1d3 -r 1116079e6624 artifacts/src/main/java/org/dive4elements/river/artifacts/states/ComputationRangeState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/ComputationRangeState.java	Tue Nov 24 18:52:24 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/ComputationRangeState.java	Wed Dec 02 19:35:11 2015 +0100
@@ -60,12 +60,6 @@
         Element label = ProtocolUtils.createArtNode(
             cr, "label", null, null);
 
-        // XXX: DEAD CODE
-        /*
-        Element choices = ProtocolUtils.createArtNode(
-            cr, "choices", null, null);
-        */
-
         label.setTextContent(Resources.getMsg(
             context.getMeta(),
             data.getName(),
diff -r 76c84294c1d3 -r 1116079e6624 artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java	Tue Nov 24 18:52:24 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java	Wed Dec 02 19:35:11 2015 +0100
@@ -41,11 +41,13 @@
         if (from < fromValid) {
             log.error(
                 "Invalid 'from'. " + from + " is smaller than " + fromValid);
+            // error message used in client to resolve i18n
             throw new IllegalArgumentException("error_feed_from_out_of_range");
         }
         else if (to > toValid) {
             log.error(
                 "Invalid 'to'. " + to + " is bigger than " + toValid);
+            // error message used in client to resolve i18n
             throw new IllegalArgumentException("error_feed_to_out_of_range");
         }
 
diff -r 76c84294c1d3 -r 1116079e6624 artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java	Tue Nov 24 18:52:24 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java	Wed Dec 02 19:35:11 2015 +0100
@@ -41,9 +41,12 @@
     protected double[] getMinMax(Artifact artifact) {
         D4EArtifact flysArtifact = (D4EArtifact) artifact;
         String riverName = flysArtifact.getDataAsString("river");
-        FixingsOverview overview = FixingsOverviewFactory.getOverview(riverName);
+        FixingsOverview overview = FixingsOverviewFactory
+            .getOverview(riverName);
 
-        return new double[]{overview.getExtent().getStart(), overview.getExtent().getEnd()};
+        return new double[]{
+            overview.getExtent().getStart(),
+            overview.getExtent().getEnd()};
     }
 
 
diff -r 76c84294c1d3 -r 1116079e6624 artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityDistanceSelect.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityDistanceSelect.java	Tue Nov 24 18:52:24 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityDistanceSelect.java	Wed Dec 02 19:35:11 2015 +0100
@@ -48,7 +48,8 @@
         CallContext context)
     {
         Element ele = super.createData(cr, artifact, data, context);
-        if (!data.getName().equals("ld_from") && !data.getName().equals("ld_to")) {
+        if (!data.getName().equals("ld_from")
+            && !data.getName().equals("ld_to")) {
             return ele;
         }
 
@@ -57,26 +58,31 @@
 
         /* Bit of an overkill here but it will be cached and accessed
          * in the next state anyway. */
-        BedOverview overview = BedOverviewFactory.getOverview(access.getRiverName());
+        BedOverview overview = BedOverviewFactory
+            .getOverview(access.getRiverName());
 
         if (overview == null) {
-            log.warn("No overview found for river '" + access.getRiverName() + "'");
+            log.warn("No overview found for river '"
+                + access.getRiverName() + "'");
             return ele;
         }
 
         KMIndex<List<Date>> entries = overview.filter(BedOverview.ACCEPT);
         if (entries.size() == 0) {
-            log.warn("No data found for river '" + access.getRiverName() + "'");
+            log.warn("No data found for river '"
+                + access.getRiverName() + "'");
             return ele;
         }
         entries.sort();
 
         if (data.getName().equals("ld_from")) {
             cr.addAttr(ele, "defaultLabel", data.getName(), true);
-            cr.addAttr(ele, "defaultValue", Double.toString(entries.get(0).getKm()), true);
+            cr.addAttr(ele, "defaultValue",
+                Double.toString(entries.get(0).getKm()), true);
         } else if (data.getName().equals("ld_to")) {
             cr.addAttr(ele, "defaultLabel", data.getName(), true);
-            cr.addAttr(ele, "defaultValue", Double.toString(entries.get(entries.size()-1).getKm()), true);
+            cr.addAttr(ele, "defaultValue",
+                Double.toString(entries.get(entries.size()-1).getKm()), true);
         }
 
         return ele;


More information about the Dive4Elements-commits mailing list