Code Review Request: 8016576: Overrides warnings in jdi and jconsole
Alan Bateman
Alan.Bateman at oracle.com
Sat Jun 15 00:25:05 PDT 2013
On 14/06/2013 22:58, Kurchi Hazra wrote:
> Apologies, corrected the subject line here.
>
> On 6/14/2013 2:51 PM, Kurchi Hazra wrote:
>>
>>
>> Hi,
>>
>> Please review this patch to implement hashCode() in two classes in
>> the serviceability area to eliminate the overrides warning.
>>
>> Bug: http://bugs.sun.com/view_bug.do?bug_id=8016576
>> Webrev: http://cr.openjdk.java.net/~khazra/8016576/webrev.00/
>> <http://cr.openjdk.java.net/%7Ekhazra/8016576/webrev.00/>
Thank you for attacking the hashCode/equals warnings, they've been
screaming to get fixed for a long time.
It's hard to judge SDE.hashCode but it looks like the straum and line
table index values are used twice (by way of computing the line number).
I agree with the multiplication to spread the bits and maybe it can be
simplified to (lineNumber() * 17) ^ refType.hashCode().
XObject.hashCode looks good but I wonder why the equals method is
catching Throwable (it might be a left-over from debugging a long time
ago but it could be masking an issue too).
-Alan.
More information about the serviceability-dev
mailing list