Hello Alan,
On 04/11/21 1:21 am, Alan Bateman wrote:
On Wed, 3 Nov 2021 03:22:40 GMT, Jaikiran Pai <[email protected]> wrote:
So I decided to stick with using the ordinal modifiers in the hashCode()
computation. However, I'm not an expert on the performance aspects of the
Collections and how much using the modifiers for hashCode() will improve the
performance in this case. Perhaps that's what you meant by it not giving a good
(enough) spread? If so, do let me know and I'll go ahead and update the PR to
remove using the modifiers in the hashCode() computation and also update the
javadoc of each of those hashCode() methods which state that the modifiers are
used in the hashCode() computation.
Okay, but we may have to re-visit this some time because summing the ordinals
won't give a good spread, e.g. STATIC+SYNTHETIC will give the same value as
TRANSITIVE. This is why I was saying it would be nearly the same to just leave
them out. So let's go with it for now.
Thanks for the update to the test. The assertNotSame to check that they aren't
the same instance looks a bit odd but at least you have a comment to explain
it. I guess we should add an assertEquals to check that the 2 descriptors are
equals too. Then I think we are done.
I intentionally didn't add the assertEquals for the 2 module descriptors
because that check will fail (with CDS enabled) until the other issue
https://bugs.openjdk.java.net/browse/JDK-8275731 is fixed.
-Jaikiran