changeset 2303:da35b8a23ffb

Fix flys/issue468 (Fehler beim Projekt-Duplizieren) flys-artifacts/trunk@3971 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 08 Feb 2012 15:31:24 +0000
parents 300d50f74dab
children abb390101595
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WSPLGENCalculation.java flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/ReportGenerator.java
diffstat 5 files changed, 26 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Feb 08 14:45:53 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Feb 08 15:31:24 2012 +0000
@@ -1,3 +1,20 @@
+2012-02-08	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	Fix flys/issue468 (Fehler beim Projekt-Duplizieren)
+
+	* src/main/java/de/intevation/flys/exports/ReportGenerator.java:
+	  Always create a new XML document when calling report generation.
+	  XXX: There is a bug somewhere which calls error reporting twice
+	  when cloning a collection. Speculation: It has something to do with
+	  the settings stuff.
+
+	* src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java,
+	  src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java:
+	  Remove superfluous imports.
+
+	* src/main/java/de/intevation/flys/artifacts/model/WSPLGENCalculation.java:
+	  Added missing Override annotation.
+
 2012-02-08  Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java	Wed Feb 08 14:45:53 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java	Wed Feb 08 15:31:24 2012 +0000
@@ -8,7 +8,6 @@
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.CallContext;
 
-import de.intevation.artifactdatabase.state.DefaultFacet;
 import de.intevation.artifactdatabase.state.Facet;
 
 import de.intevation.flys.artifacts.CrossSectionArtifact;
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WSPLGENCalculation.java	Wed Feb 08 14:45:53 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WSPLGENCalculation.java	Wed Feb 08 15:31:24 2012 +0000
@@ -48,6 +48,7 @@
     }
 
 
+    @Override
     public void toXML(Document document, CallMeta meta) {
         Element root = document.createElement("problems");
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java	Wed Feb 08 14:45:53 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java	Wed Feb 08 15:31:24 2012 +0000
@@ -16,7 +16,6 @@
 
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.WW;
-import de.intevation.flys.artifacts.model.WWQQ;
 import de.intevation.flys.artifacts.model.WW.ApplyFunctionIterator;
 import de.intevation.flys.artifacts.model.WWAxisTypes;
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ReportGenerator.java	Wed Feb 08 14:45:53 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ReportGenerator.java	Wed Feb 08 15:31:24 2012 +0000
@@ -35,7 +35,7 @@
         logger.debug("init");
         this.out     = out;
         this.context = context;
-        result = XMLUtils.newDocument();
+        result       = null;
     }
 
     @Override
@@ -53,14 +53,19 @@
         Facet facet = artifactFacet.getFacet();
         if (facet != null) {
             Calculation report = (Calculation) artifactFacet.getData(context);
-            report.toXML(result, context.getMeta());
+            if (result == null) {
+                result = XMLUtils.newDocument();
+                report.toXML(result, context.getMeta());
+            }
         }
     }
 
     @Override
     public void generate() throws IOException {
         logger.debug("generate");
-        XMLUtils.toStream(result, out);
+        XMLUtils.toStream(result != null
+            ? result
+            : XMLUtils.newDocument(), out);
     }
 
 

http://dive4elements.wald.intevation.org