changeset 1084:583314dafdb6

Call State.endOfLife() in FLYSArtifact when stepping back to a previous state. flys-artifacts/trunk@2587 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 26 Aug 2011 08:07:47 +0000
parents d0db31d1f64c
children 07878836ee0d
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Aug 25 10:53:25 2011 +0000
+++ b/flys-artifacts/ChangeLog	Fri Aug 26 08:07:47 2011 +0000
@@ -1,3 +1,9 @@
+2011-08-26  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java: Call
+	  State.endOfLife() of each State that is no longer in the queue of the
+	  artifact when this artifact steps back to a previous state.
+
 2011-08-25  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Thu Aug 25 10:53:25 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Fri Aug 26 08:07:47 2011 +0000
@@ -374,9 +374,17 @@
             int targetIdx        = prevs.indexOf(targetState);
             int start            = prevs.size() - 1;
 
+            logger.debug("Remove current state: " + getCurrentStateId());
+            State cur = getCurrentState(context);
+            cur.endOfLife(this, context);
+
             for (int i = start; i >= targetIdx; i--) {
                 String prev = prevs.get(i);
                 logger.debug("Remove state id '" + prev + "'");
+
+                State s = getState(context, prev);
+                s.endOfLife(this, context);
+
                 prevs.remove(prev);
                 facets.remove(prev);
             }

http://dive4elements.wald.intevation.org