changeset 7086:42e243c640a0 generator-refactoring

Little workaround to make diagram attribute parsing more thread safe. This is not the right solution.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 22 Sep 2013 17:15:15 +0200
parents ceec5b6541e8
children ada424214b02
files artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Sun Sep 22 17:07:17 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Sun Sep 22 17:15:15 2013 +0200
@@ -106,7 +106,10 @@
     @Override
     public void setup(Element config) {
         logger.debug("DiagramGenerator.setup");
-        diagramAttributes = new DiagramAttributes(config);
+        // TODO: XML DOM is not thread safe! We have to re-factor this.
+        synchronized (config.getOwnerDocument()) {
+            diagramAttributes = new DiagramAttributes(config);
+        }
     }
 
     /**

http://dive4elements.wald.intevation.org