[PATCH 5 of 7] Fixed :bed heights finder did not consider the river correctly
Wald Commits
scm-commit at wald.intevation.org
Fri May 25 10:49:54 CEST 2018
# HG changeset patch
# User gernotbelger
# Date 1527238058 -7200
# Node ID fb976ea0146363efbd685154403d9479b364ab3b
# Parent b5dbcbaed42bf0ca7603734bf7e746964dc70947
Fixed :bed heights finder did not consider the river correctly
diff -r b5dbcbaed42b -r fb976ea01463 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/DefaultBedHeights.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/DefaultBedHeights.java Fri May 25 10:47:18 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/DefaultBedHeights.java Fri May 25 10:47:38 2018 +0200
@@ -103,22 +103,17 @@
}
}
- private static List<BedHeight> loadBedHeightsByName(final River shouldBeRiver, final Collection<String> bedHeightNames, final Calculation problems) {
+ private static List<BedHeight> loadBedHeightsByName(final River river, final Collection<String> bedHeightNames, final Calculation problems) {
final List<BedHeight> bedHeights = new ArrayList<>(bedHeightNames.size());
for (final String name : bedHeightNames) {
try {
- final BedHeight bedHeight = BedHeight.getBedHeightByDescription(name);
+ final BedHeight bedHeight = BedHeight.getBedHeightByDescription(river, name);
if (bedHeight == null)
- problems.addProblem("sinfo.bedheightsfinder.missingdescription", name);
- else {
- final River river = bedHeight.getRiver();
- if (!shouldBeRiver.getId().equals(river.getId()))
- problems.addProblem("sinfo.bedheightsfinder.wrongriver", name, shouldBeRiver.getName());
- else
- bedHeights.add(bedHeight);
- }
+ problems.addProblem("sinfo.bedheightsfinder.missingdescription", river.getName(), name);
+ else
+ bedHeights.add(bedHeight);
}
catch (final Exception e) {
e.printStackTrace();
diff -r b5dbcbaed42b -r fb976ea01463 artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties Fri May 25 10:47:18 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties Fri May 25 10:47:38 2018 +0200
@@ -800,8 +800,7 @@
sinfo.bedheightsfinder.badrange = Invalid range for bed heights {0}.
sinfo.bedheightsfinder.overlappingrange = Range of bed height {0} overlaps with other ranges.
-sinfo.bedheightsfinder.missingdescription = No bed heights found with description = {0}
-sinfo.bedheightsfinder.wrongriver = Bed heights {0} does not belong to river {1}
+sinfo.bedheightsfinder.missingdescription = River {0} has no bed heights with description {1}
sinfo.bedheightsfinder.configfile.missingriver = River not defined in config file ''{0}'': {1}
sinfo.bedheightsfinder.configfile.loaderror = Failed to load config file ''{0}'': {1}
sinfo.bedheightsfinder.notfound = Failed to access sounding with id ''{0}''
diff -r b5dbcbaed42b -r fb976ea01463 artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties Fri May 25 10:47:18 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties Fri May 25 10:47:38 2018 +0200
@@ -800,8 +800,7 @@
sinfo.bedheightsfinder.badrange = Ung\u00fcltige -range- f\u00fcr Sohlh\u00f6hen {0}.
sinfo.bedheightsfinder.overlappingrange = -Range- der Sohlh\u00f6hen {0} \u00fcberlappt andere Sohlh\u00f6hen.
-sinfo.bedheightsfinder.missingdescription = Sohlh\u00f6he mit -description- {0} nicht vorhanden
-sinfo.bedheightsfinder.wrongriver = Sohlh\u00f6he {0} geh\u00f6rt nicht zum Gew\u00e4sser {1}
+sinfo.bedheightsfinder.missingdescription = Gew\u00e4sser {0} hat keine Sohlh\u00f6he mit Bezeichnung {1}
sinfo.bedheightsfinder.configfile.missingriver = Gew\u00e4sser {1} ist in Konfigurationsdatei {0} nicht definiert.
sinfo.bedheightsfinder.configfile.loaderror = Fehler beim Laden der Konfigurationsdatei ''{0}'': {1}
sinfo.bedheightsfinder.notfound = Keine Sohlh\u00f6he mit id ''{0}'' vorhanden
More information about the Dive4Elements-commits
mailing list