RFR: 8316190: Improve MemorySegment::toString

Per Minborg pminborg at openjdk.org
Thu Sep 14 12:09:26 UTC 2023


On Thu, 14 Sep 2023 12:01:29 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This PR proposes to improve the MemorySegment::toString to reduce cluttering and add missing comas.

src/java.base/share/classes/jdk/internal/foreign/Utils.java line 277:

> 275:     }
> 276: 
> 277:     public static String toHexString(long value) {

We intend to use this utility method in coming PRs.

test/jdk/java/foreign/TestSegments.java line 251:

> 249:                 () -> MemorySegment.ofArray(new float[] { 1.0f, 2.0f, 3.0f, 4.0f }),
> 250:                 () -> MemorySegment.ofArray(new int[] { 1, 2, 3, 4 }),
> 251:                 () -> MemorySegment.ofArray(new long[] { 1L, 2L, 3L, 4L } ),

Drive-by fix

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15740#discussion_r1325845210
PR Review Comment: https://git.openjdk.org/jdk/pull/15740#discussion_r1325844029


More information about the core-libs-dev mailing list