3 ms·
Object.hashCode() typically returns the memory address of the object, obviously it won't be the same across processes. This should be common knowledge for all J
by zmb_ 14y ago
Object.hashCode() typically returns the memory address of the object, obviously it won't be the same across processes. This should be common knowledge for all Java programmers. The only way to do what the author wants is to define the serialization rules and the hash function the serialized object is fed to. Again, this should be obvious to every Java programmer.
- scott_s 14y agoAnd yet, the author claims that real distributed systems in production use make the mistake.
- zmb_ 14y agoAnd isn't that scary? It's not like this is any kind of secret or obscure detail, it's something you would learn in any half-competent Java 101 class or if you bothered to read the docs to the methods you're calling.