Author: maartenc
Date: Thu Dec  3 20:10:23 2009
New Revision: 886898

URL: http://svn.apache.org/viewvc?rev=886898&view=rev
Log:
FIX: Use of a shared DocumentBuilder causes SAXException during parallel 
resolutions (IVY-1147)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/XMLHelper.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=886898&r1=886897&r2=886898&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu Dec  3 20:10:23 2009
@@ -100,6 +100,7 @@
 - IMPROVEMENT: Trace a message when a property file referenced from the 
settings doesn't exixts (IVY-1074)
 - IMPROVEMENT: use defaultconf in combination with defaultconfmapping 
(IVY-1135) (thanks to Jon Schneider)
 
+- FIX: Use of a shared DocumentBuilder causes SAXException during parallel 
resolutions (IVY-1147)
 - FIX: metadata lock files not always deleted from cache (IVY-1145) (thanks to 
Jason Trump)
 - FIX: FileSystem resolver with m2compatible=true throws error when publishing 
modules with dotted organisation names (IVY-968)
 - FIX: ivy:retrieve sync="true" does nothing if first variable is optional 
(IVY-1142) (thanks to Andreas Axelsson)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/XMLHelper.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/XMLHelper.java?rev=886898&r1=886897&r2=886898&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/XMLHelper.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/XMLHelper.java Thu Dec  3 
20:10:23 2009
@@ -51,8 +51,6 @@
     static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";;
 
     private static boolean canUseSchemaValidation = true;
-
-    private static DocumentBuilder docBuilder;
     
     private static SAXParser newSAXParser(URL schema, InputStream schemaStream)
             throws ParserConfigurationException, SAXException {
@@ -206,19 +204,17 @@
     }
 
     public static DocumentBuilder getDocBuilder(EntityResolver entityResolver) 
{
-        if (docBuilder == null) {
-            try {
-                DocumentBuilderFactory factory = 
DocumentBuilderFactory.newInstance();
-                factory.setValidating(false);
-                docBuilder = factory.newDocumentBuilder();
-                if (entityResolver != null) {
-                    docBuilder.setEntityResolver(entityResolver);
-                }
-            } catch (ParserConfigurationException e) {
-                throw new RuntimeException(e);
-            }        
-        }
-        return docBuilder;
+        try {
+            DocumentBuilderFactory factory = 
DocumentBuilderFactory.newInstance();
+            factory.setValidating(false);
+            DocumentBuilder docBuilder = factory.newDocumentBuilder();
+            if (entityResolver != null) {
+                docBuilder.setEntityResolver(entityResolver);
+            }
+            return docBuilder;
+        } catch (ParserConfigurationException e) {
+            throw new RuntimeException(e);
+        }        
     }
 
 


Reply via email to