changeset 1890:9144e5a5027b

(Picky) cosmetics. flys-artifacts/trunk@3250 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 15 Nov 2011 14:15:31 +0000
parents ad22fc70bdab
children 99ca3b686dd1
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedFacetAdapter.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/QRangeTree.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java
diffstat 5 files changed, 33 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Nov 15 14:10:21 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Nov 15 14:15:31 2011 +0000
@@ -1,3 +1,13 @@
+2011-11-15  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	Picky cosmetics.
+
+	* src/main/java/de/intevation/flys/artifacts/model/QRangeTree.java,
+	  src/main/java/de/intevation/flys/artifacts/model/ManagedFacetAdapter.java,
+	  src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java,
+	  src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java:
+	  Cosmetics, docs.
+
 2011-11-15  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	Added translations for Mosel, Elbe and Saar.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java	Tue Nov 15 14:10:21 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java	Tue Nov 15 14:15:31 2011 +0000
@@ -130,6 +130,9 @@
             statements.clear();
         }
 
+        /**
+         * Handle a \<context\> node.
+         */
         protected void context(Node parent, Element current)
         throws SQLException
         {
@@ -144,7 +147,7 @@
                 Node node = subs.item(i);
                 String ns;
                 if (node.getNodeType() == Node.ELEMENT_NODE
-                &&  node.getLocalName().equals("statement")
+                && node.getLocalName().equals("statement")
                 && (ns = node.getNamespaceURI()) != null
                 && ns.equals(DC_NAMESPACE_URI)) {
                     stmntNode = node;
@@ -157,10 +160,10 @@
                 return;
             }
 
+            String stmntText = stmntNode.getTextContent();
+
             String con = current.getAttribute("connection");
 
-            String stmntText = stmntNode.getTextContent();
-
             String key = con + "-" + stmntText;
 
             CompiledStatement.Instance csi = statements.get(key);
@@ -203,6 +206,9 @@
             }
         }
 
+        /**
+         * Kind of foreach over results of a statement within a context.
+         */
         protected void elements(Node parent, Element current) 
         throws SQLException
         {
@@ -247,6 +253,9 @@
             }
         }
 
+        /**
+         * Create element.
+         */
         protected void element(Node parent, Element current)
         throws SQLException
         {
@@ -279,7 +288,10 @@
             parent.appendChild(owner.createTextNode(value));
         }
 
-
+        /**
+         * Add attribute to an element
+         * @see element
+         */
         protected void attribute(Node parent, Element current) {
 
             if (parent.getNodeType() != Node.ELEMENT_NODE) {
@@ -309,7 +321,7 @@
                 DC_NAMESPACE_URI, "macro");
 
             for (int i = 0, N = macros.getLength(); i < N; ++i) {
-                Element macro = (Element)macros.item(i);
+                Element macro = (Element) macros.item(i);
                 if (name.equals(macro.getAttribute("name"))) {
                     NodeList subs = macro.getChildNodes();
                     for (int j = 0, M = subs.getLength(); j < M; ++j) {
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedFacetAdapter.java	Tue Nov 15 14:10:21 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedFacetAdapter.java	Tue Nov 15 14:15:31 2011 +0000
@@ -1,5 +1,7 @@
 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;
@@ -19,6 +21,9 @@
     public ManagedFacetAdapter() {
     }
 
+
+    protected Logger logger = Logger.getLogger(ManagedFacetAdapter.class);
+
     public ManagedFacetAdapter(
         Facet   facet,
         String  uuid,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/QRangeTree.java	Tue Nov 15 14:10:21 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/QRangeTree.java	Tue Nov 15 14:15:31 2011 +0000
@@ -114,7 +114,7 @@
 
         Node [] nodes = new Node[stop-start];
         for (int i = 0; i < nodes.length; ++i) {
-            Object [] qRange = qRanges.get(i + start);
+            Object [] qRange = qRanges.get(start + i);
             Double q = (Double)qRange[1];
             Double a = (Double)qRange[2];
             Double b = (Double)qRange[3];
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java	Tue Nov 15 14:10:21 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputationRangeState.java	Tue Nov 15 14:15:31 2011 +0000
@@ -41,7 +41,6 @@
     private static Logger logger =
         Logger.getLogger(ComputationRangeState.class);
 
-
     /** The name of the 'from' field. */
     public static final String FROM = "ld_from";
 
@@ -55,7 +54,6 @@
     public static final int DEFAULT_STEP = 100;
 
 
-
     public ComputationRangeState() {
     }
 

http://dive4elements.wald.intevation.org