Skip to content

Commit

Permalink
Fixing XERCESJ-1564: to intern the namespace name of QNames (using th…
Browse files Browse the repository at this point in the history
…e symbol table) before using it.

git-svn-id: https://svn.apache.org/repos/asf/xerces/java/trunk@1343961 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Shudi Gao committed May 29, 2012
1 parent 25c3960 commit aed06f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -3518,6 +3518,9 @@ else if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_ELEMENT) {

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;
}
Expand All @@ -3541,6 +3544,9 @@ void processRootTypeQName(final javax.xml.namespace.QName rootTypeQName) {

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;
}
Expand Down

0 comments on commit aed06f9

Please sign in to comment.