You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by John Kaputin <KA...@uk.ibm.com> on 2006/01/21 13:28:50 UTC

Bug in XmlSchemaObject.equals method

The XmlSchemaObject.equals method is:

    public boolean equals(Object what) {
        // toDO : implement this once everything completed
        return true;
    }

This is causing a problem in Woden. I have a java.util.List of XmlSchema. I
use the List.contains(object) method and the java.util.Vector
implementation calls the equals method on the XmlSchema instance, which
inherits XmlSchemaObject.equals. True is always returned, even if the
XmlSchema objects are different.

There may be some longer term plan to override the equals method in the
subclasses of XmlSchemaObject to perform equivalence checking rather than
an object reference comparison, but I can't see the purpose of the current
XmlSchemaObject.equals implementation - even as a short term measure.  I
propose either changing XmlSchemaObject.equals to perform an object
reference comparison (or just removing the method altogether), or otherwise
overriding it in XmlSchema to perform an object reference comparison.
This would allow me to move forward in Woden in the short term, even if
there is a longer term plan for equivalence checking in XmlSchema.

I am happy to make this change. Any agreement or objections?

regards,
John Kaputin