On Mon, 20 May 2024 09:50:17 GMT, Jens Lidestrom <d...@openjdk.org> wrote:
>> Per Minborg has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Add benchmarks for memoized IntFunction and Function >> - Add benchmark for memoized supplier > > src/java.base/share/classes/jdk/internal/lang/StableArray.java line 66: > >> 64: * @throws IllegalArgumentException if the provided {@code length} >> is {@code < 0} >> 65: */ >> 66: static <V> StableArray<V> of(int length) { > > I interpret the method name `of` as a method that creates an object that > contains the argument as some kind of member, in the way that `List.of` and > friends work. > > My intuitive interpretation of `StableArray.of(10)` is that it returns an > array with the single element 10. > > I think a method like this should be named `empty`, or `emptyOfLength` or > something like that. Stable arrays aren't supposed to be initialized with values, so I think your point is moot. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18794#discussion_r1606708916