Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning of use of Unsafe in JDK 23 #362

Open
Thihup opened this issue Jun 21, 2024 · 0 comments
Open

Warning of use of Unsafe in JDK 23 #362

Thihup opened this issue Jun 21, 2024 · 0 comments

Comments

@Thihup
Copy link

Thihup commented Jun 21, 2024

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.thoughtworks.xstream.converters.reflection.SunUnsafeReflectionProvider (file:/xstream-1.4.20.jar)
WARNING: Please consider reporting this to the maintainers of class com.thoughtworks.xstream.converters.reflection.SunUnsafeReflectionProvider
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

When running with --sun-misc-unsafe-memory-access=deny (the default in the future):

java.lang.ExceptionInInitializerError
        at [email protected]/com.thoughtworks.xstream.core.util.CompositeClassLoader.<clinit>(CompositeClassLoader.java:56)
        at [email protected]/com.thoughtworks.xstream.XStream.<init>(XStream.java:403)
        at [email protected]/com.thoughtworks.xstream.XStream.<init>(XStream.java:377)
Caused by: java.lang.UnsupportedOperationException: objectFieldOffset
        at jdk.unsupported/sun.misc.Unsafe.beforeMemoryAccessSlow(Unsafe.java:1826)
        at jdk.unsupported/sun.misc.Unsafe.beforeMemoryAccess(Unsafe.java:1791)
        at jdk.unsupported/sun.misc.Unsafe.objectFieldOffset(Unsafe.java:909)
        at [email protected]/com.thoughtworks.xstream.converters.reflection.SunUnsafeReflectionProvider.getFieldOffset(SunUnsafeReflectionProvider.java:105)
        at [email protected]/com.thoughtworks.xstream.converters.reflection.SunUnsafeReflectionProvider.write(SunUnsafeReflectionProvider.java:66)
        at [email protected]/com.thoughtworks.xstream.converters.reflection.SunUnsafeReflectionProvider.writeField(SunUnsafeReflectionProvider.java:56)
        at [email protected]/com.thoughtworks.xstream.core.JVM.<clinit>(JVM.java:100)
        ... 30 more

Related:
https://openjdk.org/jeps/471

@Thihup Thihup changed the title Warning of use of Unsafe in JDK 23. Warning of use of Unsafe in JDK 23 Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant