aboutsummaryrefslogtreecommitdiff
path: root/src/com/sun/org/apache/xerces/internal/impl
diff options
context:
space:
mode:
authoraefimov <none@none>2014-07-22 22:06:30 +0400
committeraefimov <none@none>2014-07-22 22:06:30 +0400
commit74676a31bab21d54d48bc718548da29627887721 (patch)
treeaeba46d744f9405c039897fa8ef560e55eefa6f0 /src/com/sun/org/apache/xerces/internal/impl
parentf2e84505219d8fb1d031d1d893939d488190fe33 (diff)
downloadjdk8u_jaxp-74676a31bab21d54d48bc718548da29627887721.tar.gz
8029837: NPE seen in XMLDocumentFragmentScannerImpl.setProperty since 7u40b33
Reviewed-by: joehw
Diffstat (limited to 'src/com/sun/org/apache/xerces/internal/impl')
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
index d37a030..8694de8 100644
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
+++ b/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
@@ -54,6 +54,7 @@ import com.sun.org.apache.xerces.internal.util.Status;
import com.sun.org.apache.xerces.internal.util.SymbolTable;
import com.sun.org.apache.xerces.internal.util.XMLSymbols;
import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
import com.sun.org.apache.xerces.internal.xni.XNIException;
import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
@@ -983,6 +984,18 @@ XSLoader, DOMConfiguration {
*/
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException {
+ XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
+ if (spm == null) {
+ spm = new XMLSecurityPropertyManager();
+ setProperty(XML_SECURITY_PROPERTY_MANAGER, spm);
+ }
+
+ XMLSecurityManager sm = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER);
+ if (sm == null)
+ setProperty(SECURITY_MANAGER,new XMLSecurityManager(true));
+
+ faccessExternalSchema = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA);
+
fGrammarBucket.reset();
fSubGroupHandler.reset();
@@ -1066,9 +1079,6 @@ XSLoader, DOMConfiguration {
// get generate-synthetic-annotations feature
fSchemaHandler.setGenerateSyntheticAnnotations(componentManager.getFeature(GENERATE_SYNTHETIC_ANNOTATIONS, false));
fSchemaHandler.reset(componentManager);
-
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
- faccessExternalSchema = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA);
}
private void initGrammarBucket(){