Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8316971 Add Lint warning for restricted method calls
  3. JDK-8318094

Release Note: Add `lint` Warning for Restricted Method Calls

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 22
    • 22
    • tools

      Some methods in the Foreign Function & Memory API are unsafe. When used improperly, these methods can lead to loss of memory safety which can result in a JVM crash or silent memory corruption. Accordingly, the unsafe methods in the FFM API are *restricted*. This means that their use is permitted, but by default causes a warning to be issued at run time. To indicate where run time warnings may occur, a new javac lint option, `-Xlint:restricted`, causes warnings to be issued at compile time if restricted methods are called in source code. These compile-time warnings can be suppressed using `@SuppressWarnings("restricted")`.

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: