Author: peterjm
Date: Tue Apr 11 14:32:29 2006
New Revision: 393314
URL: http://svn.apache.org/viewcvs?rev=393314&view=rev
Log:
Changed == to .equals() for determining if the root type definition is a
built-in type. Also updated the unit test to confirm this works.
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
xerces/java/trunk/tests/schema/config/RootSimpleTypeDefinitionTest.java
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
URL:
http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=393314&r1=393313&r2=393314&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
Apr 11 14:32:29 2006
@@ -1928,7 +1928,7 @@
if (rootTypeNamespace != null &&
rootTypeNamespace.equals(XMLConstants.NULL_NS_URI)) {
rootTypeNamespace = null;
}
- if (rootTypeNamespace == SchemaSymbols.URI_SCHEMAFORSCHEMA) {
+ if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(rootTypeNamespace)) {
fCurrentType =
SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(fRootTypeQName.getLocalPart());
}
else {
Modified:
xerces/java/trunk/tests/schema/config/RootSimpleTypeDefinitionTest.java
URL:
http://svn.apache.org/viewcvs/xerces/java/trunk/tests/schema/config/RootSimpleTypeDefinitionTest.java?rev=393314&r1=393313&r2=393314&view=diff
==============================================================================
--- xerces/java/trunk/tests/schema/config/RootSimpleTypeDefinitionTest.java
(original)
+++ xerces/java/trunk/tests/schema/config/RootSimpleTypeDefinitionTest.java Tue
Apr 11 14:32:29 2006
@@ -54,8 +54,12 @@
public RootSimpleTypeDefinitionTest(String name) {
super(name);
- typeString = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "string",
"xsd");
- typeNonNegInt = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,
"nonNegativeInteger", "xsd");
+ // This is a roundabout way of making sure that we're not using an
+ // interned string (so that == doesn't work)
+ String ns = "x" + XMLConstants.W3C_XML_SCHEMA_NS_URI;
+ ns = ns.substring(1);
+ typeString = new QName(ns, "string", "xsd");
+ typeNonNegInt = new QName(ns, "nonNegativeInteger", "xsd");
}
public void testSettingSimpleType() throws Exception {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]