# HG changeset patch # User Ingo Weinzierl # Date 1314370518 0 # Node ID b1c6d945848d90f31a19ed76fd7827bc89536e11 # Parent 139e7df1787ce76faf9b68c69af725978672ef6e Added a new method to FLYSArtifact to destroy a single state (call its endOfLife). flys-artifacts/trunk@2597 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 139e7df1787c -r b1c6d945848d flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Fri Aug 26 12:45:32 2011 +0000 +++ b/flys-artifacts/ChangeLog Fri Aug 26 14:55:18 2011 +0000 @@ -1,3 +1,8 @@ +2011-08-26 Ingo Weinzierl + + * src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java: New method + to destroy a single state. + 2011-08-26 Felix Wolfsteller * src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java: diff -r 139e7df1787c -r b1c6d945848d flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Fri Aug 26 12:45:32 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Fri Aug 26 14:55:18 2011 +0000 @@ -374,7 +374,6 @@ int targetIdx = prevs.indexOf(targetState); int start = prevs.size() - 1; - prevs.add(getCurrentStateId()); destroyStates(prevs, context); for (int i = start; i >= targetIdx; i--) { @@ -385,6 +384,7 @@ facets.remove(prev); } + destroyState(getCurrentStateId(), context); setCurrentStateId(targetState); return describe(target, context); @@ -919,6 +919,12 @@ } + protected void destroyState(String id, Object context) { + State s = getState(context, id); + s.endOfLife(this, context); + } + + /** * Calls endOfLife() for each state in the list ids. * @@ -927,8 +933,7 @@ */ protected void destroyStates(List ids, Object context) { for (int i = 0, num = ids.size(); i < num; i++) { - State s = getState(context, ids.get(i)); - s.endOfLife(this, context); + destroyState(ids.get(i), context); } }