changeset 2094:22732713c54d

Made classes to merge Collection Outs more verbose for better debugging. flys-artifacts/trunk@3640 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 10 Jan 2012 11:44:46 +0000
parents ebc2aa64c1be
children 8cb679d4ec49
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java flys-artifacts/src/main/java/de/intevation/flys/collections/OutputParser.java
diffstat 3 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Jan 09 08:27:15 2012 +0000
+++ b/flys-artifacts/ChangeLog	Tue Jan 10 11:44:46 2012 +0000
@@ -1,3 +1,9 @@
+2012-01-10  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/collections/AttributeWriter.java,
+	  src/main/java/de/intevation/flys/collections/OutputParser.java: Made
+	  them more verbose for better debugging.
+
 2012-01-09  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java	Mon Jan 09 08:27:15 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java	Tue Jan 10 11:44:46 2012 +0000
@@ -94,12 +94,20 @@
             String outName = entry.getKey();
             Output a       = entry.getValue();
 
+
             Output exists = attribute.getOutput(outName);
             if (exists == null) {
                 attribute.addOutput(outName, a);
             }
 
             attribute.clearFacets(outName);
+
+            if (logger.isDebugEnabled()) {
+                logger.debug("Merge Output: " + outName);
+                logger.debug("   old Facets: " + oldFacets.size());
+                logger.debug("   new Facets: " + newFacets.size());
+            }
+
             writeOutput(a.getName(), newFacets, oldFacets);
         }
 
@@ -121,6 +129,14 @@
         List<Facet> oldOutFacets
     ) {
         List<String> compatFacets = this.compatibilities.get(outputName);
+
+        if (logger.isDebugEnabled() && compatFacets != null) {
+            logger.debug("Compabitle Facets:");
+            for (String compatible: compatFacets) {
+                logger.debug(   "- " + compatible);
+            }
+        }
+
         try {
             writeFacets(outputName, newOutFacets, oldOutFacets, compatFacets);
         }
@@ -157,6 +173,9 @@
 
         for (int i = 0; i < num; i++) {
             ManagedFacet facet = (ManagedFacet) newFacets.get(i);
+
+            logger.debug("Try to add Facet: " + facet.getName());
+
             if (!compatibleFacets.contains(facet.getName())) {
                 //logger.debug("Have incompatible facet, skip: " + facet.getName());
                 continue;
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/OutputParser.java	Mon Jan 09 08:27:15 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/OutputParser.java	Tue Jan 10 11:44:46 2012 +0000
@@ -65,8 +65,11 @@
 
         List<Output> outList = flys.getOutputs(context);
 
+        logger.debug("   has " + outList.size() + " Outputs.");
+
         for (Output out: outList) {
             String name = out.getName();
+            logger.debug("Process Output '" + name + "'");
 
             Output o = outs.get(name);
             int  pos = 1;
@@ -120,6 +123,8 @@
     {
         List<Facet> newFacets = new ArrayList<Facet>(old.size());
 
+        logger.debug("There are " + old.size() + " Facets for this Output.");
+
         for (Facet f: old) {
             newFacets.add(new ManagedFacetAdapter(f, uuid, pos++, 1, 1));
         }

http://dive4elements.wald.intevation.org