RFR: 8350811: [JMH] test foreign.StrLenTest failed with StringIndexOutOfBoundsException for size=451

Mikhail Yankelevich duke at openjdk.org
Tue Mar 4 11:19:57 UTC 2025


On Mon, 3 Mar 2025 20:24:54 GMT, Vladimir Ivanov <vaivanov at openjdk.org> wrote:

> test setup was updated to generate data of requested size.

Looks good. Just 1 minor question

test/micro/org/openjdk/bench/java/lang/foreign/ToCStringTest.java line 100:

> 98:                  mollit anim id est laborum.
> 99:                 """;
> 100:         while (lorem.length() < size) lorem += lorem;

Minor: just out of interest, is there any particular reason you're using 
```java 
while (lorem.length() < size) lorem += lorem;
``` 
instead of
```java 
while (lorem.length() < size) {
	lorem += lorem;
}

?
It seems to me it might be harder to read, but it's fine as it is too

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

PR Review: https://git.openjdk.org/jdk/pull/23873#pullrequestreview-2657018870
PR Review Comment: https://git.openjdk.org/jdk/pull/23873#discussion_r1979206364


More information about the core-libs-dev mailing list