cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject svn commit: r1149183 - /cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
Date Thu, 21 Jul 2011 13:57:33 GMT
Author: asoldano
Date: Thu Jul 21 13:57:33 2011
New Revision: 1149183

URL: http://svn.apache.org/viewvc?rev=1149183&view=rev
Log:
[CXF-3675] Applying patch to get DocumentBuilderFactory instances from XMLUtils, which keeps
a classloader based map of them

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java?rev=1149183&r1=1149182&r2=1149183&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java Thu Jul 21
13:57:33 2011
@@ -60,21 +60,11 @@ import org.apache.cxf.common.util.String
  * @author Costin Manolache
  */
 public final class DOMUtils {
-    private static final DocumentBuilderFactory FACTORY = DocumentBuilderFactory.newInstance();
-    private static DocumentBuilder builder;
     private static final String XMLNAMESPACE = "xmlns";
 
     private DOMUtils() {
     }
 
-    private static synchronized DocumentBuilder getBuilder() throws ParserConfigurationException
{
-        if (builder == null) {
-            FACTORY.setNamespaceAware(true);
-            builder = FACTORY.newDocumentBuilder();
-        }
-        return builder;
-    }
-
     /**
      * This function is much like getAttribute, but returns null, not "", for a nonexistent
attribute.
      * 
@@ -494,7 +484,7 @@ public final class DOMUtils {
 
     public static DocumentBuilder createDocumentBuilder() {
         try {
-            return FACTORY.newDocumentBuilder();
+            return XMLUtils.getParser();
         } catch (ParserConfigurationException e) {
             throw new RuntimeException("Couldn't find a DOM parser.", e);
         }
@@ -502,7 +492,7 @@ public final class DOMUtils {
 
     public static Document createDocument() {
         try {
-            return getBuilder().newDocument();
+            return XMLUtils.getParser().newDocument();
         } catch (ParserConfigurationException e) {
             throw new RuntimeException("Couldn't find a DOM parser.", e);
         }



Mime
View raw message