Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903898

JMH: Unsafe deprecation warnings are printed in JDK 24

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • tools
    • None
    • jmh

      This is printed for every benchmark running with JDK 24 now:

      ```
      WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
      WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.openjdk.jmh.util.Utils (file:/Users/shipilev/Work/shipilev-jmh/jmh-samples/target/benchmarks.jar)
      WARNING: Please consider reporting this to the maintainers of class org.openjdk.jmh.util.Utils
      WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
      ```

      This is part of our checks that padding works at runtime. We need to either fix it to avoid Unsafe (probably impractical), or remove it (it did not fail for a long time).

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: