[PATCH] Never ever set current km via RiverUtils

Wald Commits scm-commit at wald.intevation.org
Wed Oct 1 13:40:48 CEST 2014


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1412163630 -7200
# Node ID 0d3d018fc6321accf6217162b6dd4423a26ebee7
# Parent  427a813b1791ed95837d2ff43faba914e82a688a
Never ever set current km via RiverUtils.

diff -r 427a813b1791 -r 0d3d018fc632 artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Wed Oct 01 13:37:43 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Wed Oct 01 13:40:30 2014 +0200
@@ -48,7 +48,6 @@
 import org.dive4elements.river.jfree.XYMetaSeriesCollection;
 
 import org.dive4elements.river.themes.ThemeDocument;
-import org.dive4elements.river.utils.RiverUtils;
 
 import org.jfree.chart.ChartFactory;
 import org.jfree.chart.JFreeChart;
@@ -152,8 +151,6 @@
         CallContext  context
     ) {
         super.init(outName, request, out, context);
-
-        RiverUtils.setKMFromRequestInContext(request, context);
     }
 
     private void setInvertedFromConfig() {
diff -r 427a813b1791 -r 0d3d018fc632 artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Wed Oct 01 13:37:43 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Wed Oct 01 13:40:30 2014 +0200
@@ -890,30 +890,5 @@
         return q;
     }
 
-    /** Parses the request and checks if it contains a currentKM setting.
-     * If this is the case the currentKM is added to the context.*/
-    public static void setKMFromRequestInContext(Document request,
-            CallContext context) {
-        Double dKm;
-        String km = XMLUtils.xpathString(
-            request,
-            XPATH_CHART_CURRENTKM,
-            ArtifactNamespaceContext.INSTANCE);
-
-        if (km == null) {
-            return;
-        }
-
-        try {
-            dKm = Double.valueOf(km);
-        } catch (NumberFormatException nfe) {
-            return;
-        }
-
-        if (log.isDebugEnabled()) {
-            log.debug("currentKm = " + dKm);
-        }
-        context.putContextValue(CURRENT_KM, dKm);
-    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4Elements-commits mailing list