changeset 4051:58bdf95df5e4

More dead code removal. Minor code clean ups.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sat, 06 Oct 2012 13:19:44 +0200
parents 975f608dd254
children 6d8c7a00e74e
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/context/FLYSContextFactory.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedDomFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKmsFactory.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeightFactory.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/BedKMChartService.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/BedloadKMChartService.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/OutputState.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/EventSelect.java flys-artifacts/src/main/java/de/intevation/flys/exports/BooleanAttribute.java flys-artifacts/src/main/java/de/intevation/flys/exports/ChoiceStringAttribute.java flys-artifacts/src/main/java/de/intevation/flys/exports/DoubleAttribute.java flys-artifacts/src/main/java/de/intevation/flys/exports/IntegerAttribute.java flys-artifacts/src/main/java/de/intevation/flys/exports/StringAttribute.java flys-artifacts/src/main/java/de/intevation/flys/exports/VisibleAttribute.java
diffstat 18 files changed, 30 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/ChangeLog	Sat Oct 06 13:19:44 2012 +0200
@@ -1,3 +1,24 @@
+2012-10-06	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java,
+	  src/main/java/de/intevation/flys/artifacts/context/FLYSContextFactory.java,
+	  src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java,
+	  src/main/java/de/intevation/flys/artifacts/model/ManagedDomFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java,
+	  src/main/java/de/intevation/flys/artifacts/model/WQKmsFactory.java,
+	  src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeightFactory.java,
+	  src/main/java/de/intevation/flys/artifacts/services/BedKMChartService.java,
+	  src/main/java/de/intevation/flys/artifacts/services/BedloadKMChartService.java,
+	  src/main/java/de/intevation/flys/artifacts/states/OutputState.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/EventSelect.java,
+	  src/main/java/de/intevation/flys/exports/BooleanAttribute.java,
+	  src/main/java/de/intevation/flys/exports/ChoiceStringAttribute.java,
+	  src/main/java/de/intevation/flys/exports/DoubleAttribute.java,
+	  src/main/java/de/intevation/flys/exports/IntegerAttribute.java,
+	  src/main/java/de/intevation/flys/exports/StringAttribute.java,
+	  src/main/java/de/intevation/flys/exports/VisibleAttribute.java:
+	  More dead code removal. Minor code clean ups.
+
 2012-10-06	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/CollectionMonitor.java	Sat Oct 06 13:19:44 2012 +0200
@@ -6,8 +6,6 @@
 
 import javax.xml.xpath.XPathConstants;
 
-import org.apache.log4j.Logger;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -28,10 +26,6 @@
 
     public static final String XPATH_RESULT = "/art:result";
 
-    private static final Logger logger =
-        Logger.getLogger(CollectionMonitor.class);
-
-
     @Override
     public void setup(Node cfg) {
     }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/context/FLYSContextFactory.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/context/FLYSContextFactory.java	Sat Oct 06 13:19:44 2012 +0200
@@ -119,7 +119,6 @@
         logger.info("Found " + artifacts.length + " artifacts in the config.");
 
         for (Document doc: artifacts) {
-            List<Transition> transitions = new ArrayList<Transition>();
 
             String artName = (String) XMLUtils.xpath(
                 doc, XPATH_ARTIFACT_NAME, XPathConstants.STRING);
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java	Sat Oct 06 13:19:44 2012 +0200
@@ -3,7 +3,6 @@
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
 
-import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.HashMap;
@@ -194,7 +193,8 @@
 
             // only descent if there are results
             if (!rd.isEmpty()) {
-                connectionsStack.push(new Pair(connection, rd));
+                connectionsStack.push(
+                    new Pair<NamedConnection, ResultData>(connection, rd));
                 try {
                     for (int i = 0; i < S; ++i) {
                         build(parent, subs.item(i));
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedDomFacet.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedDomFacet.java	Sat Oct 06 13:19:44 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;
@@ -22,9 +20,6 @@
 
     protected Element facet;
 
-    private static Logger logger = Logger.getLogger(ManagedDomFacet.class);
-
-
     public ManagedDomFacet(Element facet) {
         super(null, -1, null, null, -1, -1, -1);
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java	Sat Oct 06 13:19:44 2012 +0200
@@ -141,11 +141,6 @@
 
         List<Object []> results = sqlQuery.list();
 
-        double kms [] = new double[results.size()];
-        double ws  [] = new double[results.size()];
-
-        int lastColumn = Integer.MAX_VALUE;
-
         for (int i = 0, N = results.size(); i < N; i++) {
             Object[] row = results.get(i);
             wkms.add((Double) row[0], (Double) row[1]);
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKmsFactory.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKmsFactory.java	Sat Oct 06 13:19:44 2012 +0200
@@ -98,8 +98,6 @@
 
         List<Object []> results = sqlQuery.list();
 
-        int lastColumn = Integer.MAX_VALUE;
-
         for (int i = 0, N = results.size(); i < N; i++) {
             Object[] row = results.get(i);
             // add(w, q, km)
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeightFactory.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeightFactory.java	Sat Oct 06 13:19:44 2012 +0200
@@ -103,7 +103,7 @@
             return "none";
         }
         List<String> names = nameQuery.list();
-        if (names.size() >= 1) {
+        if (!names.isEmpty()) {
             name = names.get(0);
         }
 
@@ -163,13 +163,12 @@
             sqlQuery.setInteger("height_id", height_id);
             List<Object []> results = sqlQuery.list();
 
-            for (int i = 0; i < results.size(); i++) {
-                Object[] row = results.get(i);
+            for (Object [] row: results) {
                 height.add(
                     (Double) row[0],
                     (Double) row[1],
-                    (Date) row[2],
-                    (Date)row[3]);
+                    (Date)   row[2],
+                    (Date)   row[3]);
             }
             return height;
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/BedKMChartService.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/BedKMChartService.java	Sat Oct 06 13:19:44 2012 +0200
@@ -36,9 +36,6 @@
 
 public class BedKMChartService extends DefaultService {
 
-    /**
-     *
-     */
     private static final long serialVersionUID = -4946194087923870485L;
 
     private static final Logger log =
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/BedloadKMChartService.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/BedloadKMChartService.java	Sat Oct 06 13:19:44 2012 +0200
@@ -36,9 +36,6 @@
 
 public class BedloadKMChartService extends DefaultService {
 
-    /**
-     *
-     */
     private static final long serialVersionUID = 4156704841305086495L;
 
     private static final Logger log =
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/OutputState.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/OutputState.java	Sat Oct 06 13:19:44 2012 +0200
@@ -1,7 +1,5 @@
 package de.intevation.flys.artifacts.states;
 
-import org.apache.log4j.Logger;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -14,9 +12,6 @@
 
 public class OutputState extends DefaultState implements FacetTypes {
 
-    private static final Logger logger = Logger.getLogger(OutputState.class);
-
-
     @Override
     public Element describeStatic(
         Artifact    artifact,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/EventSelect.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/EventSelect.java	Sat Oct 06 13:19:44 2012 +0200
@@ -87,11 +87,9 @@
 
         IdFilter filter = new IdFilter(value);
         List<Fixing.Column> columns = overview.filter(null, filter);
-        if (!columns.isEmpty()) {
-        return columns.get(0).getDescription();
-        }
-
-        return "";
+        return  columns.isEmpty()
+            ? ""
+            : columns.get(0).getDescription();
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/BooleanAttribute.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/BooleanAttribute.java	Sat Oct 06 13:19:44 2012 +0200
@@ -1,6 +1,5 @@
 package de.intevation.flys.exports;
 
-import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -26,7 +25,6 @@
      */
     @Override
     public Node toXML(Node parent) {
-        Document owner = parent.getOwnerDocument();
 
         Element ele = (Element) super.toXML(parent);
         ele.setAttribute("type", "boolean");
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChoiceStringAttribute.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChoiceStringAttribute.java	Sat Oct 06 13:19:44 2012 +0200
@@ -1,6 +1,5 @@
 package de.intevation.flys.exports;
 
-import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -33,8 +32,6 @@
      */
     @Override
     public Node toXML(Node parent) {
-        Document owner = parent.getOwnerDocument();
-
         Element ele = (Element) super.toXML(parent);
         ele.setAttribute("type", "string");
         ele.setAttribute("choice", choiceType);
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DoubleAttribute.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DoubleAttribute.java	Sat Oct 06 13:19:44 2012 +0200
@@ -1,6 +1,5 @@
 package de.intevation.flys.exports;
 
-import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -26,8 +25,6 @@
      */
     @Override
     public Node toXML(Node parent) {
-        Document owner = parent.getOwnerDocument();
-
         Element ele = (Element) super.toXML(parent);
         ele.setAttribute("type", "double");
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/IntegerAttribute.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/IntegerAttribute.java	Sat Oct 06 13:19:44 2012 +0200
@@ -1,6 +1,5 @@
 package de.intevation.flys.exports;
 
-import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -26,8 +25,6 @@
      */
     @Override
     public Node toXML(Node parent) {
-        Document owner = parent.getOwnerDocument();
-
         Element ele = (Element) super.toXML(parent);
         ele.setAttribute("type", "integer");
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/StringAttribute.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/StringAttribute.java	Sat Oct 06 13:19:44 2012 +0200
@@ -1,6 +1,5 @@
 package de.intevation.flys.exports;
 
-import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -26,8 +25,6 @@
      */
     @Override
     public Node toXML(Node parent) {
-        Document owner = parent.getOwnerDocument();
-
         Element ele = (Element) super.toXML(parent);
         ele.setAttribute("type", "string");
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/VisibleAttribute.java	Sat Oct 06 12:27:01 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/VisibleAttribute.java	Sat Oct 06 13:19:44 2012 +0200
@@ -1,6 +1,5 @@
 package de.intevation.flys.exports;
 
-import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -31,8 +30,6 @@
      */
     @Override
     public Node toXML(Node parent) {
-        Document owner = parent.getOwnerDocument();
-
         Element ele = (Element) super.toXML(parent);
         ele.setAttribute("display", String.valueOf(visible));
 

http://dive4elements.wald.intevation.org