Mercurial > dive4elements > river
changeset 4049:8e66293c5369
Removed dead code
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/ChangeLog Sat Oct 06 11:57:10 2012 +0200 @@ -1,3 +1,25 @@ +2012-10-06 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java, + src/main/java/de/intevation/flys/artifacts/ChartArtifact.java, + src/main/java/de/intevation/flys/artifacts/MapArtifact.java, + src/main/java/de/intevation/flys/artifacts/model/ManagedFacet.java, + src/main/java/de/intevation/flys/artifacts/services/MapInfoService.java, + src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java, + src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java, + src/main/java/de/intevation/flys/artifacts/states/ReferenceGaugeState.java, + src/main/java/de/intevation/flys/artifacts/states/RiverSelect.java, + src/main/java/de/intevation/flys/artifacts/states/ScenarioSelect.java, + src/main/java/de/intevation/flys/artifacts/states/WQSelect.java, + src/main/java/de/intevation/flys/artifacts/states/fixation/FixationSelect.java, + src/main/java/de/intevation/flys/artifacts/states/fixation/FunctionSelect.java, + src/main/java/de/intevation/flys/artifacts/states/fixation/PreprocessingSelect.java, + src/main/java/de/intevation/flys/artifacts/states/minfo/DifferenceSelect.java, + src/main/java/de/intevation/flys/artifacts/states/minfo/YearEpochSelect.java, + src/main/java/de/intevation/flys/exports/OutputHelper.java, + src/main/java/de/intevation/flys/themes/DefaultTheme.java: + Removed dead code. + 2012-10-06 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java Sat Oct 06 11:57:10 2012 +0200 @@ -110,10 +110,6 @@ dumpArtifact(); } - FLYSContext flysContext = FLYSUtils.getFlysContext(context); - StateEngine stateEngine = (StateEngine) flysContext.get( - FLYSContext.STATE_ENGINE_KEY); - Document description = XMLUtils.newDocument(); XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( description,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/ChartArtifact.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/ChartArtifact.java Sat Oct 06 11:57:10 2012 +0200 @@ -15,7 +15,6 @@ import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; -import de.intevation.artifacts.common.ArtifactNamespaceContext; import de.intevation.artifactdatabase.ProtocolUtils; import de.intevation.artifactdatabase.state.Facet; @@ -82,11 +81,6 @@ { List<String> stateIds = getPreviousStateIds(); - XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( - doc, - ArtifactNamespaceContext.NAMESPACE_URI, - ArtifactNamespaceContext.NAMESPACE_PREFIX); - FLYSContext flysContext = FLYSUtils.getFlysContext(context); StateEngine engine = (StateEngine) flysContext.get( FLYSContext.STATE_ENGINE_KEY);
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MapArtifact.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MapArtifact.java Sat Oct 06 11:57:10 2012 +0200 @@ -11,9 +11,7 @@ import de.intevation.artifacts.CallMeta; import de.intevation.artifacts.CallContext; -import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; -import de.intevation.artifacts.common.ArtifactNamespaceContext; import de.intevation.artifactdatabase.ProtocolUtils; import de.intevation.artifactdatabase.state.Facet; @@ -47,8 +45,6 @@ this.identifier = identifier; name = "new_map"; - FLYSContext flysContext = FLYSUtils.getFlysContext(context); - List<State> states = getStates(context); setCurrentState(states.get(0)); @@ -84,11 +80,6 @@ { List<String> stateIds = getPreviousStateIds(); - XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( - doc, - ArtifactNamespaceContext.NAMESPACE_URI, - ArtifactNamespaceContext.NAMESPACE_PREFIX); - FLYSContext flysContext = FLYSUtils.getFlysContext(context); StateEngine engine = (StateEngine) flysContext.get( FLYSContext.STATE_ENGINE_KEY);
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedFacet.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedFacet.java Sat Oct 06 11:57:10 2012 +0200 @@ -1,7 +1,5 @@ package de.intevation.flys.artifacts.model; -import org.apache.log4j.Logger; - import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -29,9 +27,6 @@ /** A property that determines if this facet is active or not. */ protected int active; - /** The logger that is used in this class. */ - private static Logger logger = Logger.getLogger(ManagedFacet.class); - /** A property that determines if this facet is visible or not. */ protected int visible;
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MapInfoService.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MapInfoService.java Sat Oct 06 11:57:10 2012 +0200 @@ -23,8 +23,6 @@ import de.intevation.artifactdatabase.XMLService; -import de.intevation.flys.model.River; - import de.intevation.flys.utils.GeometryUtils; /**
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java Sat Oct 06 11:57:10 2012 +0200 @@ -62,8 +62,11 @@ Element label = ProtocolUtils.createArtNode( cr, "label", null, null); + // XXX: DEAD CODE + /* Element choices = ProtocolUtils.createArtNode( cr, "choices", null, null); + */ label.setTextContent(Resources.getMsg( context.getMeta(),
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java Sat Oct 06 11:57:10 2012 +0200 @@ -32,7 +32,6 @@ String value, String type ) { - String label = ""; String[] vals = value.split(" "); for (int i = 0; i < vals.length; i++) { vals[i] = super.getLabelFor(cc, name, vals[i], type);
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ReferenceGaugeState.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ReferenceGaugeState.java Sat Oct 06 11:57:10 2012 +0200 @@ -2,13 +2,10 @@ import java.util.List; -import org.apache.log4j.Logger; - import org.w3c.dom.Element; import de.intevation.artifacts.Artifact; import de.intevation.artifacts.CallContext; -import de.intevation.artifacts.CallMeta; import de.intevation.artifacts.common.utils.XMLUtils; @@ -24,10 +21,6 @@ */ public class ReferenceGaugeState extends DefaultState { - private static final Logger logger = - Logger.getLogger(ReferenceGaugeState.class); - - public static final String DATA_NAME = "reference_gauge"; @@ -38,8 +31,6 @@ String name, CallContext context) { - CallMeta meta = context.getMeta(); - River river = FLYSUtils.getRiver((FLYSArtifact) artifact); List<Gauge> gauges = river.getGauges();
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/RiverSelect.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/RiverSelect.java Sat Oct 06 11:57:10 2012 +0200 @@ -73,8 +73,12 @@ Element label = ProtocolUtils.createArtNode( cr, "label", null, null); + + // XXX: DEAD CODE + /* Element choices = ProtocolUtils.createArtNode( cr, "choices", null, null); + */ select.appendChild(label);
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ScenarioSelect.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ScenarioSelect.java Sat Oct 06 11:57:10 2012 +0200 @@ -144,8 +144,11 @@ File artifactDir = new File(shapePath, artifact.identifier()); if (artifactDir.exists()) { - logger.info("Delete directory: " + artifactDir.getAbsolutePath()); + logger.debug("Delete directory: " + artifactDir.getAbsolutePath()); boolean success = FileTools.deleteRecursive(artifactDir); + if (!success) { + logger.warn("could not remove dir '" + artifactDir + "'"); + } } else { logger.debug("There is no directory to remove.");
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java Sat Oct 06 11:57:10 2012 +0200 @@ -217,8 +217,11 @@ Element label = ProtocolUtils.createArtNode( cr, "label", null, null); + // XXX: DEAD CODE + /* Element choices = ProtocolUtils.createArtNode( cr, "choices", null, null); + */ label.setTextContent(Resources.getMsg( context.getMeta(),
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationSelect.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationSelect.java Sat Oct 06 11:57:10 2012 +0200 @@ -1,7 +1,5 @@ package de.intevation.flys.artifacts.states.fixation; -import org.apache.log4j.Logger; - import org.w3c.dom.Element; import de.intevation.artifacts.Artifact; @@ -19,10 +17,6 @@ */ public class FixationSelect extends DefaultState { - /** The logger used in this class. */ - private static Logger logger = Logger.getLogger(FixationSelect.class); - - /** Constant value for the default fixation calculation. */ public static final String CALCULATION_DEFAULT = "calculation.analysis";
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FunctionSelect.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FunctionSelect.java Sat Oct 06 11:57:10 2012 +0200 @@ -1,9 +1,7 @@ package de.intevation.flys.artifacts.states.fixation; import java.util.Collection; -import java.util.Iterator; -import org.apache.log4j.Logger; import org.w3c.dom.Element; import de.intevation.artifacts.Artifact; @@ -18,9 +16,6 @@ */ public class FunctionSelect extends DefaultState { - /** The logger used in this class. */ - private static Logger logger = Logger.getLogger(FunctionSelect.class); - /** * The default constructor that initializes an empty State object. */ @@ -42,11 +37,9 @@ FunctionFactory ff = FunctionFactory.getInstance(); Collection<Function> fc = ff.getFunctions(); Element[] functions = new Element[fc.size()]; - Iterator<Function> i = fc.iterator(); int j = 0; - while(i.hasNext()) { - Function f = i.next(); + for (Function f: fc) { String n = f.getName(); String d = f.getDescription(); functions[j] = createItem(ec, new String[] {d, n});
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/PreprocessingSelect.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/PreprocessingSelect.java Sat Oct 06 11:57:10 2012 +0200 @@ -1,7 +1,5 @@ package de.intevation.flys.artifacts.states.fixation; -import org.apache.log4j.Logger; - import org.w3c.dom.Element; import de.intevation.artifacts.Artifact; @@ -19,10 +17,6 @@ */ public class PreprocessingSelect extends DefaultState { - /** The logger used in this class. */ - private static Logger logger = Logger.getLogger(PreprocessingSelect.class); - - /** * The default constructor that initializes an empty State object. */
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/DifferenceSelect.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/DifferenceSelect.java Sat Oct 06 11:57:10 2012 +0200 @@ -2,7 +2,6 @@ import java.util.List; -import org.apache.log4j.Logger; import org.w3c.dom.Element; import de.intevation.artifactdatabase.state.Facet; @@ -20,9 +19,6 @@ */ public class DifferenceSelect extends DefaultState { - /** The logger used in this class. */ - private static Logger logger = Logger.getLogger(DifferenceSelect.class); - /** * The default constructor that initializes an empty State object. */
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/YearEpochSelect.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/YearEpochSelect.java Sat Oct 06 11:57:10 2012 +0200 @@ -1,6 +1,5 @@ package de.intevation.flys.artifacts.states.minfo; -import org.apache.log4j.Logger; import org.w3c.dom.Element; import de.intevation.artifacts.Artifact; @@ -14,8 +13,6 @@ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ public class YearEpochSelect extends DefaultState { - /** The logger used in this class. */ - private static Logger logger = Logger.getLogger(YearEpochSelect.class); /** * The default constructor that initializes an empty State object. @@ -56,4 +53,4 @@ return elements; } } -// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/OutputHelper.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/OutputHelper.java Sat Oct 06 11:57:10 2012 +0200 @@ -153,14 +153,9 @@ + facet + ", index=" + index + ")"); } - ArtifactDatabase db = context.getDatabase(); CallMeta meta = context.getMeta(); - FLYSContext flysContext = context instanceof FLYSContext - ? (FLYSContext) context - : (FLYSContext) context.globalContext(); - Document attr = db.getCollectionItemAttribute(identifier, uuid, meta); if (attr == null) { @@ -497,8 +492,6 @@ return; } - String uri = ArtifactNamespaceContext.NAMESPACE_URI; - for (int i = 0; i < num; i++) { Element theme = (Element) themeList.item(i);
--- a/flys-artifacts/src/main/java/de/intevation/flys/themes/DefaultTheme.java Sat Oct 06 11:14:23 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/themes/DefaultTheme.java Sat Oct 06 11:57:10 2012 +0200 @@ -173,10 +173,7 @@ */ protected void appendFields(ElementCreator cr, Element theme) { - for (Map.Entry<String, ThemeField> entry: fields.entrySet()) { - String name = entry.getKey(); - ThemeField field = entry.getValue(); - + for (ThemeField field: fields.values()) { Document doc = field.toXML(); Node root = doc.getFirstChild();