Skip to content

Warnings about calls to sun.misc.Unsafe under Java 24 #944

@m-burst

Description

@m-burst

When running ktlint using the plugin under Java 24 and with Kotlin version 2.2.10, the following warnings appear:

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.jetbrains.kotlin.com.intellij.util.containers.Unsafe (file:/Users/m_burst/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/2.2.10/6882d39ef03b18879c1a5d2a83c2212361bed5fe/kotlin-compiler-embeddable-2.2.10.jar)
WARNING: Please consider reporting this to the maintainers of class org.jetbrains.kotlin.com.intellij.util.containers.Unsafe
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

The root cause of the warnings seems to be in the Kotlin compiler (see issue), and I can see that other projects have added workarounds to suppress these warnings (e.g. in kotlinc's own run script and in ktlint).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions