[java-xmltooling COMMIT] /branches/REL_1/src/main/java/org/opensaml/xml/parse/StaticBasicParserPool.java
noreply at shibboleth.net
noreply at shibboleth.net
Fri Mar 13 21:51:27 EDT 2015
Author: putmanb
Date: Fri Mar 13 21:51:27 2015
New Revision: 851
URL: http://svn.shibboleth.net/view/java-xmltooling?rev=851&view=rev
Log:
Along with previous mistaken commit:
Backport JSPT-56 fixes re: ParserPool interface and impls. We don't have the @Nonnull contract here, but the issues are the same.
Modified:
branches/REL_1/src/main/java/org/opensaml/xml/parse/StaticBasicParserPool.java
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=851&r1=850&r2=851&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 21:51:27 2015
@@ -182,7 +182,7 @@
return new DocumentBuilderProxy(builder, this);
}
- return null;
+ throw new XMLParserException("Unable to obtain a DocumentBuilder");
}
/** {@inheritDoc} */
@@ -224,6 +224,9 @@
DocumentBuilder builder = getBuilder();
Document document = builder.newDocument();
returnBuilder(builder);
+ if (document == null) {
+ throw new XMLParserException("DocumentBuilder returned a null Document");
+ }
return document;
}
@@ -232,6 +235,9 @@
DocumentBuilder builder = getBuilder();
try {
Document document = builder.parse(input);
+ if (document == null) {
+ throw new XMLParserException("DocumentBuilder parsed a null Document");
+ }
return document;
} catch (SAXException e) {
throw new XMLParserException("Invalid XML", e);
@@ -247,6 +253,9 @@
DocumentBuilder builder = getBuilder();
try {
Document document = builder.parse(new InputSource(input));
+ if (document == null) {
+ throw new XMLParserException("DocumentBuilder parsed a null Document");
+ }
return document;
} catch (SAXException e) {
throw new XMLParserException("Invalid XML", e);
More information about the commits
mailing list