RFR: 8337716: ByteBuffer hashCode implementations are inconsistent

Alan Bateman alanb at openjdk.org
Sat Aug 3 19:12:02 UTC 2024


On Sat, 3 Aug 2024 19:04:10 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Revert the changes made in #16992 and add some test coverage.

Marked as reviewed by alanb (Reviewer).

Thanks for jumping on this, it's unfortunate this issue slipped through.

test/jdk/java/nio/Buffer/EqualsCompareTest.java line 732:

> 730:         Files.write(path, bytes);
> 731:         try (FileChannel fc = FileChannel.open(path, StandardOpenOption.READ,
> 732:             StandardOpenOption.DELETE_ON_CLOSE)) {

If you statically import StandardOpenOption then it might be more readable.

test/jdk/java/nio/Buffer/EqualsCompareTest.java line 734:

> 732:             StandardOpenOption.DELETE_ON_CLOSE)) {
> 733:             MappedByteBuffer one =
> 734:                 fc.map(FileChannel.MapMode.READ_ONLY, 0, bytes.length);

Spurious line break here.

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

PR Review: https://git.openjdk.org/jdk/pull/20451#pullrequestreview-2217170884
PR Comment: https://git.openjdk.org/jdk/pull/20451#issuecomment-2267104521
PR Review Comment: https://git.openjdk.org/jdk/pull/20451#discussion_r1702862687
PR Review Comment: https://git.openjdk.org/jdk/pull/20451#discussion_r1702862733


More information about the nio-dev mailing list