# HG changeset patch # User Ingo Weinzierl # Date 1317201440 0 # Node ID 94732906b094d0fdef2762fdf02b4735543486b4 # Parent d251e5929860f6d075e11189fde721286f2d8729 Made feed() operation able to remove existing data items from Artifact's data pool. flys-artifacts/trunk@2850 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r d251e5929860 -r 94732906b094 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Wed Sep 28 08:20:29 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed Sep 28 09:17:20 2011 +0000 @@ -1,3 +1,10 @@ +2011-09-28 Ingo Weinzierl + + * src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java: Made + feed() able to remove existing data items from Artifact's data pool. + Therefore, the value for the item which should be removed needs to an + empty string. + 2011-09-28 Felix Wolfsteller Extracted StringUtil.unbracket from WaterlevelSelectState.strip. diff -r d251e5929860 -r 94732906b094 flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Wed Sep 28 08:20:29 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Wed Sep 28 09:17:20 2011 +0000 @@ -489,6 +489,11 @@ } + protected StateData removeData(String name) { + return this.data.remove(name); + } + + /** * This method returns a specific StateData object that is stored in the * data pool of this artifact. @@ -570,6 +575,11 @@ addData(name, current.transform(this, context, name, value)); } + else if (name.length() > 0 && value.length() == 0) { + if (removeData(name) != null) { + logger.debug("Removed data '" + name + "' successfully."); + } + } } current.validate(this);