No, You Can’t Override JavaScriptObject.equals() in GWT. Not Yours.
Sigh. For reasons that may or may not be sensible, equals() and hashCode() are finalized in GWT’s JavaScriptObject.
This is an unfortunate discovery. While there is no inherent equals() or hashCode() in the Javascript language itself (unless I’ve missed something) that doesn’t mean GWT couldn’t make one for me. JavaScriptObject#equals(…) instead calls super.equals(). Which is really Object#equals(…) and that’s really just triple-equality (==). In object oriented programming, this is what is technically referred to as an absolute pain in the ass. It renders JRE emulation of java.util.Set around JSO’s almost useless. And it really highlights something that I’ve had in my head a while now:
If you can’t use GWT-RPC, you use JSON at your own peril. JavaScriptOverlay types, while nifty in concept are simply not first-class objects in GWT. They’re more akin to a struct or map.