[Dive4elements-commits] [PATCH] Improve debugging inf FLYSArtifact

Wald Commits scm-commit at wald.intevation.org
Mon Nov 5 16:02:55 CET 2012


# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1352127772 -3600
# Node ID d4f88fda6ed38056b2887f7ef159333f479e7814
# Parent  c84630d544a1b4af5db7cbf8b8f97937b5260978
Improve debugging inf FLYSArtifact

Improve debugging inf FLYSArtifact when building filter facets.

diff -r c84630d544a1 -r d4f88fda6ed3 flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Mon Nov 05 15:17:58 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Mon Nov 05 16:02:52 2012 +0100
@@ -323,6 +323,9 @@
      * @see filterFacets
      */
     protected Map<String, List<Facet>> buildFilterFacets(Document document) {
+        if (log.isDebugEnabled()) {
+            log.debug("Building filter factes for artifact " + this.getName());
+        }
 
         NodeList nodes = (NodeList)XMLUtils.xpath(
             document,
@@ -339,7 +342,7 @@
         for (int i = 0, N = nodes.getLength(); i < N; ++i) {
             Element element = (Element)nodes.item(i);
             String oName = element.getAttribute("name");
-            if (oName.length() == 0) {
+            if (oName == null || oName.isEmpty()) {
                 continue;
             }
 
@@ -362,6 +365,10 @@
                     log.warn(nfe);
                     index = 0;
                 }
+                if (log.isDebugEnabled()) {
+                    log.debug("Creating filter facet " + fName + " with  index " + index +
+                            " for out " + oName);
+                }
                 facets.add(new DefaultFacet(index, fName, ""));
             }
 
@@ -1129,10 +1136,13 @@
                     filtered.add(nout);
                 }
             }
+            else if (debug) {
+                log.debug("No filter Factes for Output: " + outName);
+            }
         }
 
         if (debug) {
-            log.debug("All Facets after filtering = " + filtered.size());
+            log.debug("Number of outs after filtering = " + filtered.size());
         }
 
         return filtered;


More information about the Dive4elements-commits mailing list