changeset 6852:d02ad36115c6

issue1157: Only look at the best match for CrossSections to activate.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 19 Aug 2013 10:19:06 +0200
parents b0c88ac9f63b
children 9e81ed565095
files backend/src/main/java/org/dive4elements/river/model/CrossSection.java
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/model/CrossSection.java	Sat Aug 17 20:08:51 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/CrossSection.java	Mon Aug 19 10:19:06 2013 +0200
@@ -241,11 +241,19 @@
 
         List<Integer> results = sqlQuery.list();
 
-        for (Integer result: results) {
+        if (results.size() >= 1) {
+            Integer result = results.get(0);
             if (result == getId()) {
                 return true;
             }
         }
+        else {
+            logger.warn("No CS found that could be master.");
+        }
+
+        // TODO If there is none, might need a fallback.
+        // Formerly this was the most current CS (issue1157).
+
         return false;
     }
 }

http://dive4elements.wald.intevation.org