8337716: ByteBuffer hashCode implementations are inconsistent

Reviewed-by: alanb, liach
This commit is contained in:
Brian Burkhalter 2024-08-04 15:42:51 +00:00
parent 367e0a6556
commit 8bd3cd5156
3 changed files with 24 additions and 14 deletions

View file

@ -29,7 +29,6 @@ package java.nio;
import java.lang.foreign.MemorySegment;
import java.util.Objects;
import jdk.internal.util.ArraysSupport;
/**
#if[rw]
@ -706,9 +705,6 @@ class Heap$Type$Buffer$RW$
addr, segment)));
}
public int hashCode() {
return ArraysSupport.hashCode(hb, ix(position()), remaining(), 1);
}
#end[byte]
@ -737,9 +733,6 @@ class Heap$Type$Buffer$RW$
offset, segment);
}
public int hashCode() {
return ArraysSupport.hashCode(hb, ix(position()), remaining(), 1);
}
#end[char]