RFR: 8264734: SA's Address subclasses could use better hashCode() implementation [v2]

Kevin Walls kevinw at openjdk.java.net
Thu Apr 29 10:39:57 UTC 2021


On Thu, 29 Apr 2021 07:05:18 GMT, Mitsuru kariya <github.com+2217224+kariya-mitsuru at openjdk.org> wrote:

>> The current `hashCode` implementation of SA's Address subclasses ignores the upper 32 bits of the long value.
>> This PR changes to use `Long.hashCode` instead.
>
> Mitsuru kariya has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update copyright

Hi -
There are a few more places where a long is cast to an int and used as the hashCode:
  
open/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java
  
  public int hashCode() {
    return (int) getThreadID();
  }
 
open/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java 
open/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shenandoah/ShenandoahHeapRegion.java

open/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java
  getThreadHashCode(long id) returns a truncated long if it caught a RemoteException.

If you have time, these could all use the same change?

-------------

PR: https://git.openjdk.java.net/jdk/pull/3522


More information about the serviceability-dev mailing list