Fri, 23 Aug 2013 14:09:04 -0700
Merge
1.1 --- a/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java Thu Aug 22 09:10:08 2013 -0700 1.2 +++ b/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java Fri Aug 23 14:09:04 2013 -0700 1.3 @@ -38,6 +38,7 @@ 1.4 import com.sun.org.apache.xerces.internal.util.PropertyState; 1.5 import com.sun.org.apache.xerces.internal.util.Status; 1.6 import com.sun.org.apache.xerces.internal.util.SymbolTable; 1.7 +import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; 1.8 import com.sun.org.apache.xerces.internal.xni.XMLLocator; 1.9 import com.sun.org.apache.xerces.internal.xni.XNIException; 1.10 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; 1.11 @@ -184,6 +185,10 @@ 1.12 protected static final String LOCALE = 1.13 Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY; 1.14 1.15 + /** Property identifier: Security property manager. */ 1.16 + protected static final String XML_SECURITY_PROPERTY_MANAGER = 1.17 + Constants.XML_SECURITY_PROPERTY_MANAGER; 1.18 + 1.19 // debugging 1.20 1.21 /** Set to true and recompile to print exception stack trace. */ 1.22 @@ -328,7 +333,8 @@ 1.23 VALIDATION_MANAGER, 1.24 JAXP_SCHEMA_SOURCE, 1.25 JAXP_SCHEMA_LANGUAGE, 1.26 - LOCALE 1.27 + LOCALE, 1.28 + XML_SECURITY_PROPERTY_MANAGER 1.29 }; 1.30 addRecognizedProperties(recognizedProperties); 1.31 1.32 @@ -406,6 +412,7 @@ 1.33 // REVISIT: What is the right thing to do? -Ac 1.34 } 1.35 1.36 + setProperty(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager()); 1.37 } // <init>(SymbolTable,XMLGrammarPool) 1.38 1.39 //
2.1 --- a/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java Thu Aug 22 09:10:08 2013 -0700 2.2 +++ b/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java Fri Aug 23 14:09:04 2013 -0700 2.3 @@ -36,6 +36,7 @@ 2.4 import com.sun.org.apache.xerces.internal.util.PropertyState; 2.5 import com.sun.org.apache.xerces.internal.util.Status; 2.6 import com.sun.org.apache.xerces.internal.util.SymbolTable; 2.7 +import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; 2.8 import com.sun.org.apache.xerces.internal.xni.XMLLocator; 2.9 import com.sun.org.apache.xerces.internal.xni.XNIException; 2.10 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; 2.11 @@ -157,6 +158,10 @@ 2.12 protected static final String LOCALE = 2.13 Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY; 2.14 2.15 + /** Property identifier: Security property manager. */ 2.16 + protected static final String XML_SECURITY_PROPERTY_MANAGER = 2.17 + Constants.XML_SECURITY_PROPERTY_MANAGER; 2.18 + 2.19 // debugging 2.20 2.21 /** Set to true and recompile to print exception stack trace. */ 2.22 @@ -310,7 +315,8 @@ 2.23 XMLGRAMMAR_POOL, 2.24 DATATYPE_VALIDATOR_FACTORY, 2.25 VALIDATION_MANAGER, 2.26 - LOCALE 2.27 + LOCALE, 2.28 + XML_SECURITY_PROPERTY_MANAGER 2.29 }; 2.30 addRecognizedProperties(recognizedProperties); 2.31 2.32 @@ -367,6 +373,7 @@ 2.33 // REVISIT: What is the right thing to do? -Ac 2.34 } 2.35 2.36 + setProperty(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager()); 2.37 } // <init>(SymbolTable,XMLGrammarPool) 2.38 2.39 //
3.1 --- a/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java Thu Aug 22 09:10:08 2013 -0700 3.2 +++ b/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java Fri Aug 23 14:09:04 2013 -0700 3.3 @@ -76,6 +76,7 @@ 3.4 XMLGRAMMAR_POOL, 3.5 }; 3.6 3.7 + XMLSecurityPropertyManager securityPropertyManager; 3.8 // 3.9 // Constructors 3.10 // 3.11 @@ -129,16 +130,19 @@ 3.12 */ 3.13 public void setProperty(String name, Object value) 3.14 throws SAXNotRecognizedException, SAXNotSupportedException { 3.15 - XMLSecurityPropertyManager spm = new XMLSecurityPropertyManager(); 3.16 - int index = spm.getIndex(name); 3.17 + if (securityPropertyManager == null) { 3.18 + securityPropertyManager = new XMLSecurityPropertyManager(); 3.19 + } 3.20 + int index = securityPropertyManager.getIndex(name); 3.21 + 3.22 if (index > -1) { 3.23 /** 3.24 * this is a direct call to this parser, not a subclass since 3.25 * internally the support of this property is done through 3.26 * XMLSecurityPropertyManager 3.27 */ 3.28 - spm.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); 3.29 - super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, spm); 3.30 + securityPropertyManager.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); 3.31 + super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); 3.32 } else { 3.33 super.setProperty(name, value); 3.34 }