RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v8]
Jorn Vernee
jvernee at openjdk.org
Wed Mar 22 19:27:47 UTC 2023
On Wed, 22 Mar 2023 19:02:52 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/foreign/Linker.java line 492:
>>
>>> 490: * Finally, the returned method handle will throw an {@link IllegalArgumentException} if the {@link MemorySegment}
>>> 491: * parameter passed to it is associated with the {@link MemorySegment#NULL} address, or a {@link NullPointerException}
>>> 492: * if that parameter is {@code null}.
>>
>> I think this isn't quite correct, as it only applies to the target address parameter. Also, we don't have to mention the NPE, as that's already mentioned in the package doc
>> Suggestion:
>>
>> * Finally, the returned method handle will throw an {@link IllegalArgumentException} if the {@link MemorySegment}
>> * representing the target address of the foreign function is the {@link MemorySegment#NULL} address.
>
> Note: this text was just copied/adapted from toplevel javadoc and moved here. I think we have to say something about `null` as the text refers to `null` being passed as parameter to the returned MH, which is NOT covered by the package javadoc.
Ah. True. This is true about all the MS parameters as well.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13079#discussion_r1145303573
More information about the nio-dev
mailing list