DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20359>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20359

PrefixedQName violates equals contract

           Summary: PrefixedQName violates equals contract
           Product: Axis
           Version: 1.1rc2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Basic Architecture
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


In its equals() method, org.apache.axis.message.PrefixedQName tests the prefix
field. However, this violates the contract of the QName class. According to the
JavaDoc (one link here:
http://www.systinet.com/doc/wasp_jserver/api/javax/xml/namespace/QName.html#equals(java.lang.Object)
) QNames are equal if the URI and localname are equal; the prefix should not be
considered. This causes severe problems when comparing two Names from different
sources. 

Besides the JavaDoc contract, this behavior fails the common sense test. Two xml
elements are equal if the local name and the namespace are the same, regardless
of what
prefix they have; they might not even have a prefix. The prefix is arbitrary. 

Even though PrefixedQName no longer extends QName, this is still a contract
violation.

Reply via email to