Code Review Request: 8016576: Overrides warnings in jdi and jconsole

Kurchi Hazra kurchi.subhra.hazra at oracle.com
Mon Jun 17 11:08:35 PDT 2013


On 6/15/2013 12:25 AM, Alan Bateman wrote:
> 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().
I agree, this works just fine.

>
> 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).

Correct me if I am wrong, if we are doing the instance check on the 
argument before casting it into an XObject instance, can it every reach 
the catch block? We can then just get rid of the try-catch block here.

- Kurchi


More information about the serviceability-dev mailing list