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

Fix javadoc for restricted methods

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: repo-panama
    • Fix Version/s: None
    • Component/s: tools

      Description

      Restricted methods have been annotated with the internal @NativeAccess annotation - this should have been used, in conjunction with javadoc to add some customary text to the method javadoc.

      Since we're not changing javadoc for the time being, we should remove the annotation, and add the customary javadoc wherever @NativeAccess is present:

      ```
      * This method is <em>restricted</em>. Restricted method are unsafe, and, if used incorrectly, their use might crash
           * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on
           * restricted methods, and use safe and supported functionalities, where possible.
      ```

      In addition, since we moved from restricting access to the linker to (e.g. CLinker::getInstance) restricting single linker calls (CLinker::downcallHandle), we should remove @NativeAccess/javadoc from CLinker::getInstance.

      Finally, it seems like LibraryLookup::lookup(String, MemoryLayout) is missing @NativeAccess/javadoc - this is an unsafe method and that should be documented.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sundar Sundararajan Athijegannathan
              Reporter:
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: