Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8256866

Foreign Memory Access and Linker API are missing NPE checks

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P2
    • 16
    • core-libs
    • None
    • behavioral
    • minimal
    • Hide
      While most of the methods should behave as before (in fact, despite the lack of explicit null testing, most methods were already failing with NPE) - a small percentage of methods were allowing null values (especially in the memory layout API), and are now failing as a result of the changes described in this CR.
      Show
      While most of the methods should behave as before (in fact, despite the lack of explicit null testing, most methods were already failing with NPE) - a small percentage of methods were allowing null values (especially in the memory layout API), and are now failing as a result of the changes described in this CR.
    • Java API
    • JDK

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              mcimadamore Maurizio Cimadamore
              mcimadamore Maurizio Cimadamore
              Chris Hegarty, Jorn Vernee, Vladimir Ivanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: