# HG changeset patch # User Sascha L. Teichmann # Date 1301325687 0 # Node ID 03362976fa0fb74faba28fe11000ada23d9fe408 # Parent c97f9bc9b642edaf971091f3427ce4bda6842416 DischargeTables: Cache the scale, too. Otherwise two calls to getValues() with different arguments will result in the same output. flys-artifacts/trunk@1591 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r c97f9bc9b642 -r 03362976fa0f flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Mon Mar 28 14:33:36 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon Mar 28 15:21:27 2011 +0000 @@ -1,3 +1,9 @@ +2011-03-28 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java: + Cache the scale, too. Otherwise two calls to getValues() with + different arguments will result in the same output. + 2011-03-28 Ingo Weinzierl * src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java: @@ -16,6 +22,11 @@ 2011-03-28 Sascha L. Teichmann + * src/main/java/de/intevation/flys/importer/PegelGltParser.java: + Fixed swap of operands. + +2011-03-28 Sascha L. Teichmann + * src/main/java/de/intevation/flys/artifacts/model/GaugesFactory.java: New. Load gauges for a river and filter them for given ranges. diff -r c97f9bc9b642 -r 03362976fa0f flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java Mon Mar 28 14:33:36 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java Mon Mar 28 15:21:27 2011 +0000 @@ -28,6 +28,8 @@ protected String riverName; + protected double scale; + protected Map values; public DischargeTables() { @@ -38,13 +40,15 @@ } public DischargeTables(String riverName, List gaugeNames) { + scale = Double.NaN; this.riverName = riverName; this.gaugeNames = gaugeNames; } public Map getValues(double scale) { - if (values == null) { + if (values == null || scale != this.scale) { values = loadValues(scale); + this.scale = scale; } return values; }