Author: sandygao
Date: Tue May 29 20:24:14 2012
New Revision: 1343961
URL: http://svn.apache.org/viewvc?rev=1343961&view=rev
Log:
Fixing XERCESJ-1564: to intern the namespace name of QNames (using the symbol
table) before using it.
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
URL:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1343961&r1=1343960&r2=1343961&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
(original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Tue
May 29 20:24:14 2012
@@ -3518,6 +3518,9 @@ public class XMLSchemaValidator
void processRootTypeQName(final javax.xml.namespace.QName rootTypeQName) {
String rootTypeNamespace = rootTypeQName.getNamespaceURI();
+ // Add namespace to symbol table, to make sure it's interned.
+ // This namespace may be later compared with other values using ==.
+ rootTypeNamespace = fSymbolTable.addSymbol(rootTypeNamespace);
if (rootTypeNamespace != null &&
rootTypeNamespace.equals(XMLConstants.NULL_NS_URI)) {
rootTypeNamespace = null;
}
@@ -3541,6 +3544,9 @@ public class XMLSchemaValidator
void processRootElementDeclQName(final javax.xml.namespace.QName
rootElementDeclQName, final QName element) {
String rootElementDeclNamespace =
rootElementDeclQName.getNamespaceURI();
+ // Add namespace to symbol table, to make sure it's interned.
+ // This namespace may be later compared with other values using ==.
+ rootElementDeclNamespace =
fSymbolTable.addSymbol(rootElementDeclNamespace);
if (rootElementDeclNamespace != null &&
rootElementDeclNamespace.equals(XMLConstants.NULL_NS_URI)) {
rootElementDeclNamespace = null;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]