Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances?

2011-05-18 Thread Jason Hsueh
Jumping in late to the thread, and I'm not really a Java person, so I may be misunderstanding something here. But as far as I can tell, you are asking for hashCode() to be a 'consistent' hash across processes. hashCode() as implemented is still useful within a single JVM, allowing you to use

Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances?

2011-05-18 Thread Jason Hsueh
Ah, I didn't get this message. How does this break use in a HashMap? Given two protobufs of the same type in the same JVM, with the same contents, does hashCode() not return the same value? On Wed, May 18, 2011 at 11:50 AM, Jay Booth jaybo...@gmail.com wrote: I'd also note that this precludes

Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances?

2011-05-18 Thread Ron Reynolds
, 2011 12:00:19 PM Subject: Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances? Jumping in late to the thread, and I'm not really a Java person, so I may be misunderstanding something here. But as far as I can tell, you are asking for hashCode() to be a 'consistent

Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances?

2011-05-18 Thread Jason Hsueh
On Wed, May 18, 2011 at 12:08 PM, Ron Reynolds tequila...@ymail.com wrote: the corner-stone of Hash* containers is: (A.equals(B)) = (A.hashCode() == B.hashCode()) for all A, B. From what Ive gathered, this invariant is true for protocol buffer's implementation of equals() and hashCode(). The

Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances?

2011-05-18 Thread Jason Hsueh
jaybo...@gmail.com Cc: Protocol Buffers protobuf@googlegroups.com Sent: Wed, May 18, 2011 12:00:19 PM Subject: Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances? Jumping in late to the thread, and I'm not really a Java person, so I may

Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances?

2011-05-18 Thread Jay Booth
Cc: Protocol Buffers protobuf@googlegroups.com Sent: Wed, May 18, 2011 12:00:19 PM Subject: Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances? Jumping in late to the thread, and I'm not really a Java person, so I may be misunderstanding something

Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances?

2011-05-18 Thread Jason Hsueh
: Protocol Buffers protobuf@googlegroups.com Sent: Wed, May 18, 2011 12:00:19 PM Subject: Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances? Jumping in late to the thread, and I'm not really a Java person, so I may be misunderstanding something

Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances?

2011-05-16 Thread Pherl Liu
We discussed internally and decided not to make the hashCode() return deterministic result. If you need consistent hashcode in different runs, use toByteString().hashCode(). Quoted from Kenton: Hashing the content of the descriptor would actually be incorrect, because two descriptors with