changeset 7489:3e9961dcbf9a

Removed redundant lookup for km in call context.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 01 Nov 2013 11:50:11 +0100
parents 1890bd524d27
children 5775d14b3db2
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java	Thu Oct 31 21:56:04 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java	Fri Nov 01 11:50:11 2013 +0100
@@ -115,8 +115,9 @@
             // Do we have a current km in context?
             // If so, we are likely fetching data for a navigable
             // diagram (i.e. in fixation branch).
-            if (context.getContextValue(FixChartGenerator.CURRENT_KM) != null) {
-                Double ckm = (Double) context.getContextValue(FixChartGenerator.CURRENT_KM);
+            Object xkm = context.getContextValue(FixChartGenerator.CURRENT_KM);
+            if (xkm != null) {
+                Double ckm = (Double)xkm;
                 // Return linearly interpolated values, in m if not at gauge,
                 // in cm if at gauge.
                 qs = mvArtifact.getMainValuesQ(new double[] {ckm});
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java	Thu Oct 31 21:56:04 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java	Fri Nov 01 11:50:11 2013 +0100
@@ -112,8 +112,9 @@
             // Do we have a current km in context?
             // If so, we are likely fetching data for a navigable
             // diagram (i.e. in fixation branch).
-            if (context.getContextValue(FixChartGenerator.CURRENT_KM) != null) {
-                Double ckm = (Double) context.getContextValue(FixChartGenerator.CURRENT_KM);
+            Object xkm = context.getContextValue(FixChartGenerator.CURRENT_KM);
+            if (xkm != null) {
+                Double ckm = (Double)xkm;
                 // Return linearly interpolated values, in m if not at gauge,
                 // in cm over datum if at gauge.
                 ws = mvArtifact.getMainValuesW(new double[] {ckm});

http://dive4elements.wald.intevation.org