This content has been marked as final.
Show 5 replies
-
1. Re: UID.hashCode returning same values ( JBAS-2564 )
adrian.brock Dec 16, 2005 1:10 PM (in response to clebert.suconic)"clebert.suconic@jboss.com" wrote:
sorry, probably i fault as i did hey it explicitly.
The test is to prove that the issue exists.
Hence successful run of the test above means that it HASN'T been fixed.
(the test fails if a different hashcode is generated)
eike
I created a testcase that fails if different GUIDs/UIDs/VMIDs generate duplicated hashcodes... Different UIDS are supposed to generate different hashCodes, and the test will fail if the constraint fails.
That is not a valid test. Duplicates are allowed. It is just that the hashCode should
provide an even distribution across the "int" value space. -
2. Re: UID.hashCode returning same values ( JBAS-2564 )
clebert.suconic Dec 16, 2005 1:22 PM (in response to clebert.suconic)OK, I will improve the test...
But on a small set (100 elements), as the probability of duplicate hashes is small (and as there is a counter on the GUID generation), I thought it would be ok to have this as a rule on the test. -
3. Re: UID.hashCode returning same values ( JBAS-2564 )
adrian.brock Dec 16, 2005 1:29 PM (in response to clebert.suconic)You should test the contract, not the implementation! :-)
-
4. Re: UID.hashCode returning same values ( JBAS-2564 )
clebert.suconic Dec 16, 2005 1:43 PM (in response to clebert.suconic)Ok... I've changed the testcase.
-
5. Re: UID.hashCode returning same values ( JBAS-2564 )
adrian.brock Dec 16, 2005 1:58 PM (in response to clebert.suconic)"clebert.suconic@jboss.com" wrote:
OK, I will improve the test...
But on a small set (100 elements), as the probability of duplicate hashes is small (and as there is a counter on the GUID generation), I thought it would be ok to have this as a rule on the test.
For a single run of the testsuite the probability is small.
Eventually it will become a certainty.
leading to random unreproducable testsuite failures. :-)