ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (XMLSCHEMA-30) Each type from W3C base schema (http://www.w3.org/2001/XMLSchema) is equals to each other
Date Wed, 22 Jan 2014 11:00:23 GMT

    [ https://issues.apache.org/jira/browse/XMLSCHEMA-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13878521#comment-13878521
] 

Hudson commented on XMLSCHEMA-30:
---------------------------------

FAILURE: Integrated in xmlschema-trunk-jdk15 #110 (See [https://builds.apache.org/job/xmlschema-trunk-jdk15/110/])
[XMLSCHEMA-30] This commit fixes the XMLSCHEMA-30 bug.

equals/hashCode methods pairs have been added in following classes:
     - XmlSchemaNamedImpl
     - XmlSchemaNamedWithFormImpl
     - XmlSchemaType
     - XmlSchemaElement
     - XmlSchemaGroup

 NamedItemsEqualityTest unit-test has been created. (dkulp: rev 1560095)
* /webservices/xmlschema/trunk/pom.xml
* /webservices/xmlschema/trunk/xmlschema-core/pom.xml
* /webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaElement.java
* /webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaGroup.java
* /webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java
* /webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/utils/UtilObjects.java
* /webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaNamedImpl.java
* /webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaNamedWithFormImpl.java
* /webservices/xmlschema/trunk/xmlschema-core/src/test/java/tests/xmlschema30
* /webservices/xmlschema/trunk/xmlschema-core/src/test/java/tests/xmlschema30/NamedItemsEqualityTest.java
* /webservices/xmlschema/trunk/xmlschema-core/src/test/resources/XMLSCHEMA-30
* /webservices/xmlschema/trunk/xmlschema-core/src/test/resources/XMLSCHEMA-30/test.xsd


> Each type from W3C base schema (http://www.w3.org/2001/XMLSchema) is equals to each other
> -----------------------------------------------------------------------------------------
>
>                 Key: XMLSCHEMA-30
>                 URL: https://issues.apache.org/jira/browse/XMLSCHEMA-30
>             Project: XmlSchema
>          Issue Type: Bug
>    Affects Versions: 2.0.2, 2.0.3, 2.1.0
>         Environment: Oracle JDK-1.6
> Oracle JDK-1.7
>            Reporter: Alexandr Klimov
>            Assignee: Daniel Kulp
>            Priority: Critical
>              Labels: XmlSchemaType, comparison, equals, hashCode
>             Fix For: 2.1.0
>
>         Attachments: sample_proj.zip
>
>
> h2. MAIN DESCIPRTION
> At this time, all simple types of the base xml schema _( W3C Schema has namesapce http://www.w3.org/2001/XMLSchema
)_ *always equlals to each other* from point of view *Object@equals* method, but they have
different hash codes.
> I've attched a simple sample_proj.zip 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|http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode()]
> h2. DETAILS
> Comparison of a XmlSchemaType (both simple and complex) is performed by *XmlSchemaObject#equals*
method.
> This method takes in account folowing properties of a XmlSchemaObject:
> * lineNumber
> * linePosition
> * sourceURI
> But all base W3C xsd types _(namespace http://www.w3.org/2001/XMLSchema )_ 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.
> h2. SIGGESTION
> 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
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


Mime
View raw message