Christian Kloner wrote:
so a fix would be:
====================================
public boolean equals(Object o) {
return ((o != null) && (o.getClass() == OMNamespaceImpl.class))
? uri.equals(((OMNamespaceImpl) o).uri)
: false;
}
====================================
Yes. But be aware that overriding java.lang.Object#equals(Object)
requires overriding java.lang.Object#hashCode():
public int hashCode() {
return uri == null ? 0 : uri.hashCode();
}
These changes affect OMNamespaceImpl's behaviour when being added to
certain collections such as java.util.HashSet. Some entries may suddenly
disappear at runtime. So think twice before doing this ;-)
--
Regards,
Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]