Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8277863 Deprecate sun.misc.Unsafe methods that return offsets
  3. JDK-8278432

Release Note: Deprecated sun.misc.Unsafe Methods That Return Offsets

    XMLWordPrintable

    Details

    • Verification:
      Verified

      Description

      Developers that use the unsupported `sun.misc.Unsafe` API should be aware that the methods that return base and field offsets have been deprecated in this release. The methods `objectFieldOffset`, `staticFieldOffset`, and `staticFieldBase` methods are an
      impediment to future changes. A future release will eventually degrade or remove these methods along with the heap accessor methods.

      The `java.lang.invoke.VarHandle` API (added in Java 9) provides a strongly typed reference to a variable that is safe and a replacement to many cases that use field offsets and the heap accessor methods. It is strongly recommended to migrate to the `VarHandle` API where possible. Multi-Release JARs can be used by libraries and frameworks that continue to support JDK 8 or older.

        Attachments

          Activity

            People

            Assignee:
            alanb Alan Bateman
            Reporter:
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: