ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandr Klimov (JIRA)" <>
Subject [jira] [Created] (XMLSCHEMA-30) Each type from W3C base schema ( is equals to each other
Date Mon, 06 Jan 2014 14:55:50 GMT
Alexandr Klimov created XMLSCHEMA-30:

             Summary: Each type from W3C base schema ( is
equals to each other
                 Key: XMLSCHEMA-30
             Project: XmlSchema
          Issue Type: Bug
    Affects Versions: 2.0.2, 2.0.3, 2.0.4
         Environment: Oracle JDK-1.6
Oracle JDK-1.7
            Reporter: Alexandr Klimov
            Priority: Critical

At this time, all simple types of the base xml schema _( W3C Schema has namesapce
)_ *always equlals to each other* from point of view *Object@equals* method, but they have
different hash codes.
I've attched a simple project to be more clean.

Such situation *may lead to wrong behaviour* of some Set or Map implementations.
F.e. ImmutableSet of Guava project doesn't copy all items from java.util.HashSet over creation
operation _( ImmutableSet#copyOf )_

*Moreover*, such behaviuor isn't in accordance with [Oracle rules|]

Comparison of a XmlSchemaType (both simple and complex) is performed by *XmlSchemaObject#equals*
This method takes in account folowing properties of a XmlSchemaObject:
* lineNumber
* linePosition
* sourceURI

But all base W3C xsd types _(namespace )_ has one peculiarity:
all the above properties is not set throughout base W3C schema creation.

*XmlSchemaCollection#addSimpletype* method is responsible for creation all these base schema
simple types.

In result, all these "synthatic" types may be distinguished by they QNames only.

I suggest to override *equals* method on *XmlSchemaType* class with taking in account its
*namedDelegate* field comparison result.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message