[java-xmltooling COMMIT] in /branches/REL_1: doc/RELEASE-NOTES.txt src/main/java/org/opensaml/xml/parse/BasicParserPo...

noreply at shibboleth.net noreply at shibboleth.net
Fri Mar 13 20:18:25 EDT 2015


Author: putmanb
Date: Fri Mar 13 20:18:22 2015
New Revision: 849

URL: http://svn.shibboleth.net/view/java-xmltooling?rev=849&view=rev
Log:
JXT-118: ParserPool impls are not correctly resetting builder ErrorHandler and EntityResolver on second and subsequent checkout 

Modified:
    branches/REL_1/doc/RELEASE-NOTES.txt
    branches/REL_1/src/main/java/org/opensaml/xml/parse/BasicParserPool.java
    branches/REL_1/src/main/java/org/opensaml/xml/parse/StaticBasicParserPool.java

Modified: branches/REL_1/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-xmltooling/branches/REL_1/doc/RELEASE-NOTES.txt?rev=849&r1=848&r2=849&view=diff
==============================================================================
--- branches/REL_1/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_1/doc/RELEASE-NOTES.txt Fri Mar 13 20:18:22 2015
@@ -1,3 +1,7 @@
+Changes in Release 1.4.6
+=============================================
+[JXT-118] - ParserPool impls are not correctly resetting builder ErrorHandler and EntityResolver on second and subsequent checkout 
+
 Changes in Release 1.4.5
 =============================================
 [JXT-116] - Default config for X509Credential KeyInfo generation should emit cert chain in addition to entity cert 

Modified: branches/REL_1/src/main/java/org/opensaml/xml/parse/BasicParserPool.java
URL: http://svn.shibboleth.net/view/java-xmltooling/branches/REL_1/src/main/java/org/opensaml/xml/parse/BasicParserPool.java?rev=849&r1=848&r2=849&view=diff
==============================================================================
--- branches/REL_1/src/main/java/org/opensaml/xml/parse/BasicParserPool.java (original)
+++ branches/REL_1/src/main/java/org/opensaml/xml/parse/BasicParserPool.java Fri Mar 13 20:18:22 2015
@@ -33,7 +33,6 @@
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.validation.Schema;
 
-import org.opensaml.xml.Configuration;
 import org.opensaml.xml.util.LazyMap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -166,6 +165,7 @@
         }
 
         if (builder != null) {
+            prepareBuilder(builder);
             return new DocumentBuilderProxy(builder, this, version);
         }
 
@@ -574,18 +574,25 @@
         try {
             DocumentBuilder builder = builderFactory.newDocumentBuilder();
 
-            if (entityResolver != null) {
-                builder.setEntityResolver(entityResolver);
-            }
-
-            if (errorHandler != null) {
-                builder.setErrorHandler(errorHandler);
-            }
-
             return builder;
         } catch (ParserConfigurationException e) {
             log.error("Unable to create new document builder", e);
             throw new XMLParserException("Unable to create new document builder", e);
+        }
+    }
+    
+    /**
+     * Prepare a document builder instance for use, before returning it from a checkout call.
+     * 
+     * @param builder the document builder to prepare
+     */
+    private void prepareBuilder(DocumentBuilder builder) {
+        if (entityResolver != null) {
+            builder.setEntityResolver(entityResolver);
+        }
+        
+        if (errorHandler != null) {
+            builder.setErrorHandler(errorHandler);
         }
     }
     

Modified: branches/REL_1/src/main/java/org/opensaml/xml/parse/StaticBasicParserPool.java
URL: http://svn.shibboleth.net/view/java-xmltooling/branches/REL_1/src/main/java/org/opensaml/xml/parse/StaticBasicParserPool.java?rev=849&r1=848&r2=849&view=diff
==============================================================================
--- branches/REL_1/src/main/java/org/opensaml/xml/parse/StaticBasicParserPool.java (original)
+++ branches/REL_1/src/main/java/org/opensaml/xml/parse/StaticBasicParserPool.java Fri Mar 13 20:18:22 2015
@@ -33,7 +33,6 @@
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.validation.Schema;
 
-import org.opensaml.xml.Configuration;
 import org.opensaml.xml.util.LazyMap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -179,6 +178,7 @@
         }
 
         if (builder != null) {
+            prepareBuilder(builder);
             return new DocumentBuilderProxy(builder, this);
         }
 
@@ -556,18 +556,25 @@
         try {
             DocumentBuilder builder = builderFactory.newDocumentBuilder();
 
-            if (entityResolver != null) {
-                builder.setEntityResolver(entityResolver);
-            }
-
-            if (errorHandler != null) {
-                builder.setErrorHandler(errorHandler);
-            }
-
             return builder;
         } catch (ParserConfigurationException e) {
             log.error("Unable to create new document builder", e);
             throw new XMLParserException("Unable to create new document builder", e);
+        }
+    }
+    
+    /**
+     * Prepare a document builder instance for use, before returning it from a checkout call.
+     * 
+     * @param builder the document builder to prepare
+     */
+    private void prepareBuilder(DocumentBuilder builder) {

[... 10 lines stripped ...]


More information about the commits mailing list