[PATCH] Fixed: 'error_no_export_found' after changing calculation mode in SINFO

Wald Commits scm-commit at wald.intevation.org
Thu Apr 5 17:12:28 CEST 2018


# HG changeset patch
# User gernotbelger
# Date 1522941143 -7200
# Node ID 951a4af24a09ce09cd6f1bea6d33759f41accf19
# Parent  b5600453bb8f6a16a683ea88b7fc1d961bdd0f93
Fixed: 'error_no_export_found' after changing calculation mode in SINFO.

diff -r b5600453bb8f -r 951a4af24a09 artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Thu Apr 05 11:57:54 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Thu Apr 05 17:12:23 2018 +0200
@@ -1014,6 +1014,19 @@
         log.debug("Bound to out: " + getBoundToOut());
         log.debug("OutName: " + outName);
 
+        // REMARK: look for facets of the current state
+        final List<Facet> currentFacets = facets.get(getCurrentStateId());
+        if( currentFacets != null ) {
+            for (Facet f: currentFacets) {
+                if (f.getIndex() == index && f.getName().equals(name)) 
+                    return f;
+            }
+        }
+        
+        // REMARK: this is old code, we should never get here actually.
+        // This posed leads to a problem when the user changes the calculation-mode after one calculation was executed.
+        // If both (new and old) calculations contained the same output-facet, it could happen that an old facet was executed
+        // with the calculation results of the new calculation.
         for (List<Facet> fs: facets.values()) {
             for (Facet f: fs) {
                 if (f.getIndex() == index && f.getName().equals(name)) {


More information about the Dive4Elements-commits mailing list