[jdom-interest] DocType equals()-hashCode() contract violation

Alex Rosen arosen at silverstream.com
Wed Apr 17 09:49:32 PDT 2002

Good point. Currently, only on DocType and Namespace does equals() do an
actual equivalency check - everything else does an identity check (an ==
check), as explained in the JDOM FAQ. Basically it does this because for
Element, an equivalency check would be slow, and is not 100% well-defined.
Your point about the internal subset indicates that it's not very
well-defined for DocType either, which makes me think we should changes its
equals() instead of its hashCode(). And if we did that would it imply that
we should change Namespace too?


More information about the jdom-interest mailing list