# HG changeset patch # User Sascha L. Teichmann # Date 1307459112 0 # Node ID fdc898a134a779058a05e108f1fbe2cc21f1ba0f # Parent 627be3ca1ab61adfb0b3a16d04740dd070f63b4c Use java.util.List instead of java.util.Vector. Removed superfluous imports. flys-artifacts/trunk@2069 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 627be3ca1ab6 -r fdc898a134a7 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Jun 07 14:28:44 2011 +0000 +++ b/flys-artifacts/ChangeLog Tue Jun 07 15:05:12 2011 +0000 @@ -1,18 +1,29 @@ 2011-06-07 Sascha L. Teichmann + * src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java, + src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java: + Use java.util.List instead of java.util.Vector + + * src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java, + src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java, + src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java, + src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java: + Removed superfluous imports. + +2011-06-07 Sascha L. Teichmann * src/main/java/de/intevation/flys/artifacts/states/DefaultState.java: createItem() is not abstract any longer to avoid code repetitionin sub classes. - * src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java, - src/main/java/de/intevation/flys/artifacts/states/LocationDistanceSelect.java, - src/main/java/de/intevation/flys/artifacts/states/RiverSelect.java, - src/main/java/de/intevation/flys/artifacts/states/WQSelect.java, - src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java, - src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java, - src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java, - src/main/java/de/intevation/flys/artifacts/states/CalculationSelect.java: - Removed duplicated code, inserted default constructors and Override annotations. + * src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java, + src/main/java/de/intevation/flys/artifacts/states/LocationDistanceSelect.java, + src/main/java/de/intevation/flys/artifacts/states/RiverSelect.java, + src/main/java/de/intevation/flys/artifacts/states/WQSelect.java, + src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java, + src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java, + src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java, + src/main/java/de/intevation/flys/artifacts/states/CalculationSelect.java: + Removed duplicated code, inserted default constructors and Override annotations. 2011-06-07 Ingo Weinzierl diff -r 627be3ca1ab6 -r fdc898a134a7 flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Tue Jun 07 14:28:44 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Tue Jun 07 15:05:12 2011 +0000 @@ -7,7 +7,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.Vector; import javax.xml.xpath.XPathConstants; @@ -86,7 +85,7 @@ protected String currentStateId; /** The identifiers of previous states on a stack.*/ - protected Vector previousStateIds; + protected List previousStateIds; /** The name of the artifact.*/ protected String name; @@ -100,7 +99,7 @@ */ public FLYSArtifact() { data = new HashMap(); - previousStateIds = new Vector(); + previousStateIds = new ArrayList(); } @@ -224,7 +223,7 @@ if (isStateReachable(targetState, context)) { logger.info("Advance: Step forward"); - Vector prev = getPreviousStateIds(); + List prev = getPreviousStateIds(); prev.add(getCurrentStateId()); setCurrentStateId(targetState); @@ -234,7 +233,7 @@ else if (isPreviousState(targetState, context)) { logger.info("Advance: Step back to"); - Vector prevs = getPreviousStateIds(); + List prevs = getPreviousStateIds(); int targetIdx = prevs.indexOf(targetState); int start = prevs.size() - 1; @@ -310,7 +309,7 @@ * * @return the vector of previous state identifiers. */ - protected Vector getPreviousStateIds() { + protected List getPreviousStateIds() { return previousStateIds; } @@ -422,7 +421,7 @@ protected boolean isPreviousState(String stateId, Object context) { logger.debug("Determine if the state '" + stateId + "' is old."); - Vector prevs = getPreviousStateIds(); + List prevs = getPreviousStateIds(); if (prevs.contains(stateId)) { return true; } @@ -1020,7 +1019,7 @@ } logger.debug("------ DUMP PREVIOUS STATES ------"); - Vector stateIds = getPreviousStateIds(); + List stateIds = getPreviousStateIds(); for (String id: stateIds) { logger.debug("- State: " + id); diff -r 627be3ca1ab6 -r fdc898a134a7 flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Tue Jun 07 14:28:44 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Tue Jun 07 15:05:12 2011 +0000 @@ -3,7 +3,6 @@ import java.util.List; import java.util.Set; import java.util.HashSet; -import java.util.Vector; import java.util.ArrayList; import org.w3c.dom.Document; @@ -166,7 +165,7 @@ CallContext context, String uuid) { - Vector stateIds = getPreviousStateIds(); + List stateIds = getPreviousStateIds(); XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( doc, @@ -223,7 +222,7 @@ CallContext context, String uuid) { - Vector stateIds = getPreviousStateIds(); + List stateIds = getPreviousStateIds(); FLYSContext flysContext = getFlysContext(context); StateEngine engine = (StateEngine) flysContext.get( diff -r 627be3ca1ab6 -r fdc898a134a7 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java Tue Jun 07 14:28:44 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java Tue Jun 07 15:05:12 2011 +0000 @@ -2,14 +2,6 @@ import org.apache.log4j.Logger; -import org.w3c.dom.Element; - -import de.intevation.artifacts.Artifact; -import de.intevation.artifacts.CallContext; - -import de.intevation.artifacts.common.utils.XMLUtils; - - /** * The final state that will be reached after the discharge curve calculation * mode has been chosen. diff -r 627be3ca1ab6 -r fdc898a134a7 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java Tue Jun 07 14:28:44 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java Tue Jun 07 15:05:12 2011 +0000 @@ -2,14 +2,6 @@ import org.apache.log4j.Logger; -import org.w3c.dom.Element; - -import de.intevation.artifacts.Artifact; -import de.intevation.artifacts.CallContext; - -import de.intevation.artifacts.common.utils.XMLUtils; - - public class DischargeLongitudinalSection extends DefaultState { private static Logger logger = diff -r 627be3ca1ab6 -r fdc898a134a7 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java Tue Jun 07 14:28:44 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java Tue Jun 07 15:05:12 2011 +0000 @@ -2,14 +2,6 @@ import org.apache.log4j.Logger; -import org.w3c.dom.Element; - -import de.intevation.artifacts.Artifact; -import de.intevation.artifacts.CallContext; - -import de.intevation.artifacts.common.utils.XMLUtils; - - /** * The final state that will be reached after the duration curve calculation * mode has been chosen.