# HG changeset patch # User Sascha L. Teichmann # Date 1328715084 0 # Node ID da35b8a23ffb74ef269aebd1ce9f27427f1d3ba5 # Parent 300d50f74dab7d0f76174861e52ddc2a5a49c1ec Fix flys/issue468 (Fehler beim Projekt-Duplizieren) flys-artifacts/trunk@3971 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 300d50f74dab -r da35b8a23ffb flys-artifacts/ChangeLog --- 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 + + 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 * src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java: diff -r 300d50f74dab -r da35b8a23ffb flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.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; diff -r 300d50f74dab -r da35b8a23ffb flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WSPLGENCalculation.java --- 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"); diff -r 300d50f74dab -r da35b8a23ffb flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java --- 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; diff -r 300d50f74dab -r da35b8a23ffb flys-artifacts/src/main/java/de/intevation/flys/exports/ReportGenerator.java --- 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); }