[PATCH] Little workaround to make diagram attribute parsing more thread safe. This is not the right solution

Wald Commits scm-commit at wald.intevation.org
Sun Sep 22 17:15:21 CEST 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1379862915 -7200
# Branch generator-refactoring
# Node ID 42e243c640a095301d33e71d24194c413cf36b07
# Parent  ceec5b6541e87f6e3842aa29dd9cbca7c8be2089
Little workaround to make diagram attribute parsing more thread safe. This is not the right solution.

diff -r ceec5b6541e8 -r 42e243c640a0 artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java
--- 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);
+        }
     }
 
     /**


More information about the Dive4elements-commits mailing list