Summary
Many methods in both the foreign memory access API and the Foreign Linker API miss documentation as to what happens when nulls are passed by clients. Not only this is a problem in terms of the API documentation - the implementation is also affected, since some APIs (especially the MemoryLayout API) tolerate null values For instance, it is currently possible to create, against the API's original intent, a GroupLayout with null layout elements.
Solution
The solution is to add the required documentation to all the methods in the APIs, so that the behavior of the API with respect to null values is fully specified.
Specification
Please refer to the attached specdiff. A version of the specdiff (as of November 24th, 2020) is also available here:
http://cr.openjdk.java.net/~mcimadamore/8256865_v2/specdiff_out/overview-summary.html
- csr of
-
JDK-8256865 Foreign Memory Access and Linker API are missing NPE checks
- Resolved