On Wed, 30 Mar 2022 20:59:34 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> wrote:
>> This PR contains the API and implementation changes for JEP-424 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjdk.java.net/jeps/424 > > Maurizio Cimadamore has updated the pull request incrementally with one > additional commit since the last revision: > > Tweak FunctionDescriptor::argumentLayouts to return an immutable list src/java.base/share/classes/java/lang/foreign/FunctionDescriptor.java line 73: > 71: */ > 72: public List<MemoryLayout> argumentLayouts() { > 73: return Collections.unmodifiableList(argLayouts); This change doesn’t seem to be necessary, as `FunctionDescriptor` is already created with `List.of(…)` (or `Stream.toList()` in the case of `FunctionDescriptor.VariadicFunction`), which produce immutable lists (although `Stream.toList()` permits `null`s, which `Stream.collect(Collectors.toImmutableList())` and `List.of(…)` doesn’t). ------------- PR: https://git.openjdk.java.net/jdk/pull/7888