APIdia Launch Partner
Top For Removal Deprecated By Reference
OpenJDK 27

Deprecated API


Terminally Deprecated Item Summary

SinceTerminally Deprecated Item and Description
13
com.sun.java.swing.plaf.motif.MotifLookAndFeel

The Motif Look and Feel is deprecated with the intent to remove it in some future release. It is recommended to use javax.swing.plaf.metal.MetalLookAndFeel instead.

16
25
com.sun.jdi.JDIPermission

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.

21
com.sun.nio.file.SensitivityWatchEventModifier

The sensitivity levels were historically used by polling-based WatchService implementations to configure the polling interval. They are are no longer used. The WatchService implementations in the JDK ignore these WatchEvent modifiers if they are specified when registering a directory to be watched.

25
com.sun.security.jgss.InquireSecContextPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

27

Returns:

the end position of tree
com.sun.source.util.DocSourcePositions.getEndPosition
(CompilationUnitTree
compilation unit in which to find tree
file
,
DocCommentTree
the comment tree that encloses the tree for which the position is being sought
comment
,
DocTree
tree for which a position is sought
tree
)

use getEndPosition(DocCommentTree, DocTree) instead

27

Returns:

the start position of tree
com.sun.source.util.DocSourcePositions.getStartPosition
(CompilationUnitTree
compilation unit in which to find tree
file
,
DocCommentTree
the comment tree that encloses the tree for which the position is being sought
comment
,
DocTree
tree for which a position is sought
tree
)

use getStartPosition(DocCommentTree, DocTree) instead

27

Returns:

the end position of tree
com.sun.source.util.SourcePositions.getEndPosition
(CompilationUnitTree
CompilationUnit in which to find tree
file
,
Tree
tree for which a position is sought
tree
)

use getEndPosition(Tree) instead

27

Returns:

the start position of tree
com.sun.source.util.SourcePositions.getStartPosition
(CompilationUnitTree
CompilationUnit in which to find tree
file
,
Tree
tree for which a position is sought
tree
)

use getStartPosition(Tree) instead

25
com.sun.tools.attach.AttachPermission

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.

16
24
java.awt.AWTPermission

There is no replacement for this class.

9
java.awt.Graphics.finalize()

Finalization has been deprecated for removal. See java.lang.Object#finalize for background information and details about migration options.

9
java.awt.PrintJob.finalize()

Finalization has been deprecated for removal. See java.lang.Object#finalize for background information and details about migration options.

24

Returns:

null
java.awt.Window.getWarningString
()

since JDK 24

23

Returns:

a JavaBean
java.beans.Beans.instantiate
(ClassLoader
the class-loader from which we should create the bean. If this is null, then the system class-loader is used.
cls
,
String
the name of the bean within the class-loader. For example "sun.beanbox.foobah"
beanName
,
BeanContext
The BeanContext in which to nest the new bean
beanContext
)

this method will be removed when java.beans.beancontext is removed

23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
25
java.io.FilePermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

1.4
java.io.ObjectOutputStream.PutField.write(ObjectOutput
the stream to write the data and fields to
out
)

This method does not write the values contained by this PutField object in a proper format, and may result in corruption of the serialization stream. The correct way to write PutField data is by calling the java.io.ObjectOutputStream#writeFields() method.

25
java.io.SerializablePermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

18
java.lang.Enum.finalize()

Finalization has been deprecated for removal. See java.lang.Object#finalize for background information and details about migration options.

9
java.lang.Object.finalize()

Finalization is deprecated and subject to removal in a future release. The use of finalization can lead to problems with security, performance, and reliability. See JEP 421 for discussion and alternatives.

Subclasses that override finalize to perform cleanup should use alternative cleanup mechanisms and remove the finalize method. Use java.lang.ref.Cleaner and java.lang.ref.PhantomReference as safer ways to release resources when an object becomes unreachable. Alternatively, add a close method to explicitly release resources, and implement AutoCloseable to enable use of the try-with-resources statement.

This method will remain in place until finalizers have been removed from most existing code.

18
java.lang.Runtime.runFinalization()

Finalization has been deprecated for removal. See java.lang.Object#finalize for background information and details about migration options.

When running in a JVM in which finalization has been disabled or removed, no objects will be pending finalization, so this method does nothing.

25
java.lang.RuntimePermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

17
java.lang.SecurityManager

There is no replacement for this class.

17

Returns:

null
java.lang.System.getSecurityManager
()

This method originally returned the system-wide Security Manager. Setting a Security Manager is no longer supported. There is no replacement for the Security Manager or this method.

18
java.lang.System.runFinalization()

Finalization has been deprecated for removal. See java.lang.Object#finalize for background information and details about migration options.

When running in a JVM in which finalization has been disabled or removed, no objects will be pending finalization, so this method does nothing.

17
java.lang.System.setSecurityManager(SecurityManager
ignored
sm
)

This method originally set the system-wide Security Manager. Setting a Security Manager is no longer supported. There is no replacement for the Security Manager or this method.

17
java.lang.Thread.checkAccess()

This method originally determined if the currently running thread had permission to modify this thread. This method was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.

20
java.lang.ThreadDeath

Thread originally specified a "stop" method to stop a victim thread by causing the victim thread to throw a ThreadDeath. It was inherently unsafe and deprecated in an early JDK release. The stop method has since been removed and ThreadDeath is deprecated, for removal.

17
java.lang.ThreadGroup.checkAccess()

This method originally determined if the currently running thread had permission to modify this thread group. This method was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.

16
java.lang.ThreadGroup.destroy()

This method was originally specified to destroy an empty thread group. The ability to explicitly destroy a thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.

16

Returns:

the daemon status of this thread group
java.lang.ThreadGroup.isDaemon
()

This method originally indicated if the thread group is a daemon thread group that is automatically destroyed when its last thread terminates. The concept of daemon thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.

16

Returns:

false
java.lang.ThreadGroup.isDestroyed
()

This method originally indicated if the thread group is destroyed. The ability to destroy a thread group and the concept of a destroyed thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.

16
java.lang.ThreadGroup.setDaemon(boolean
the daemon status
daemon
)

This method originally configured whether the thread group is a daemon thread group that is automatically destroyed when its last thread terminates. The concept of daemon thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.

26

Returns:

a class or interface signature
java.lang.classfile.Signature.ClassTypeSig.of
(Signature.ClassTypeSig
signature of the outer type, may be null
outerType
,
ClassDesc
the name of this class or interface
className
,
Signature.TypeArg...
the type arguments
typeArgs
)

The resulting signature does not denote the class represented by className when outerType is not null. Use of(ClassTypeSig, String, TypeArg...) instead.

25
java.lang.management.ManagementPermission

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.

25
java.lang.reflect.ReflectPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

25

Returns:

a SocketPermission object representing the permission necessary to connect to the destination host and port.
java.net.HttpURLConnection.getPermission
()

Permissions can no longer be used for controlling access to resources as the Security Manager is no longer supported.

25
java.net.NetPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

26
java.net.ServerSocket.setPerformancePreferences(int
An int expressing the relative importance of a short connection time
connectionTime
,
int
An int expressing the relative importance of low latency
latency
,
int
An int expressing the relative importance of high bandwidth
bandwidth
)

This method was intended to allow for protocols that are now obsolete.

1.1
java.net.Socket(String
the host name, or null for the loopback address.
host
,
int
the port number.
port
,
boolean
must be true, false is not allowed.
stream
)

The stream parameter provided a way in early JDK releases to create a Socket that used a datagram socket. This feature no longer exists. Instead use DatagramSocket for datagram sockets.

1.1
java.net.Socket(InetAddress
the IP address.
host
,
int
the port number.
port
,
boolean
must be true, false is not allowed.
stream
)

The stream parameter provided a way in early JDK releases to create a Socket that used a datagram socket. This feature no longer exists. Instead use DatagramSocket for datagram sockets.

26
java.net.Socket.setPerformancePreferences(int
An int expressing the relative importance of a short connection time
connectionTime
,
int
An int expressing the relative importance of low latency
latency
,
int
An int expressing the relative importance of high bandwidth
bandwidth
)

This method was intended to allow for protocols that are now obsolete.

26
java.net.SocketImpl.setPerformancePreferences(int
An int expressing the relative importance of a short connection time
connectionTime
,
int
An int expressing the relative importance of low latency
latency
,
int
An int expressing the relative importance of high bandwidth
bandwidth
)

This method was intended to allow for protocols that are now obsolete.

26
java.net.SocketPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

25

Returns:

the permission object representing the permission necessary to make the connection represented by this URLConnection.
java.net.URLConnection.getPermission
()

Permissions can no longer be used for controlling access to resources as the Security Manager is no longer supported.

25
java.net.URLPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

25
java.nio.file.LinkPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

1.8
java.rmi.RMISecurityManager

There is no replacement for the Security Manager.

17
java.security.AccessControlContext

This class was only useful in conjunction with the the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.

17
java.security.AccessControlException

This exception was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.

17
java.security.AccessController

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.

1.2
java.security.Certificate

This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.cert.Certificate and related classes.

17
java.security.DomainCombiner

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.

1.2
java.security.Identity

This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.KeyStore, the java.security.cert package, and java.security.Principal.

1.2
java.security.IdentityScope

This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.KeyStore, the java.security.cert package, and java.security.Principal.

17
java.security.Policy

This class was only useful in conjunction with the Security Manager, which is no longer supported. Installing a system-wide Policy object is no longer supported. The setPolicy method has been changed to always throw UnsupportedOperationException. The getPolicy method has been changed to always return a Policy object that grants no permissions. There is no replacement for the Security Manager or this class.

17
java.security.Policy.Parameters

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.

17
java.security.PolicySpi

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.

25
java.security.SecurityPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

1.2
java.security.Signer

This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.KeyStore, the java.security.cert package, and java.security.Principal.

25
java.security.UnresolvedPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

26
java.sql.SQLPermission

There is no replacement for this class.

25
java.util.PropertyPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

17

Returns:

a callable object
java.util.concurrent.Executors.privilegedCallable
(Callable<T>
the underlying task
callable
)

This method originally returned a Callable object that when called, executed the given callable under the current access control context. Access control contexts were only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.

17

Returns:

a callable object
java.util.concurrent.Executors.privilegedCallableUsingCurrentClassLoader
(Callable<T>
the underlying task
callable
)

This method originally returned a Callable object that when called, executed the given callable under the current access control context, with the current context class loader as the context class loader. Access control contexts were only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.

17

Returns:

a thread factory
java.util.concurrent.Executors.privilegedThreadFactory
()

This method originally returned a thread factory that created new threads that had the same access control context as the current thread. Access control contexts were only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.

17
java.util.logging.LogManager.checkAccess()

This method originally checked that the current context was trusted to modify the logging configuration. This method was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.

25
java.util.logging.LoggingPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

24
java.util.zip.ZipError

ZipError is no longer used and is obsolete. ZipException should be used instead.

25
javax.management.MBeanPermission

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.

25
javax.management.MBeanServerPermission

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.

25
javax.management.MBeanTrustPermission

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.

16
21

Returns:

an object that implements the MBeanServerConnection interface by forwarding its methods to the remote MBean server.
javax.management.remote.JMXConnector.getMBeanServerConnection
(Subject
must be null.
delegationSubject
)

This method supported the legacy Subject Delegation feature, which has been removed. There is no replacement.

25
javax.management.remote.SubjectDelegationPermission

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.

9

Returns:

an ordered array of peer X.509 certificates, with the peer's own certificate first followed by any certificate authorities. (The certificates are in the original JSSE javax.security.cert.X509Certificate format).
javax.net.ssl.HandshakeCompletedEvent.getPeerCertificateChain
()

The getPeerCertificates() method that returns an array of java.security.cert.Certificate should be used instead.

25
javax.net.ssl.SSLPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

9

Returns:

an ordered array of peer X.509 certificates, with the peer's own certificate first followed by any certificate authorities. (The certificates are in the original JSSE certificate javax.security.cert.X509Certificate format.)
javax.net.ssl.SSLSession.getPeerCertificateChain
()

The getPeerCertificates() method that returns an array of java.security.cert.Certificate should be used instead.

25
javax.security.auth.AuthPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

25
javax.security.auth.PrivateCredentialPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

18

Returns:

the value returned by the PrivilegedAction's run method.
javax.security.auth.Subject.doAs
(final Subject
the Subject that the specified action will run as. This parameter may be null.
subject
,
final PrivilegedAction<T>
the code to be run as the specified Subject.
action
)

This method originally performed the specified PrivilegedAction with privileges enabled. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to launch the action as is and bind the subject to the period of its execution. A replacement API named callAs has been added which can be used to perform the same work. There is no replacement for the Security Manager.

18

Returns:

the value returned by the PrivilegedExceptionAction's run method.
javax.security.auth.Subject.doAs
(final Subject
the Subject that the specified action will run as. This parameter may be null.
subject
,
final PrivilegedExceptionAction<T>
the code to be run as the specified Subject.
action
)

This method originally performed the specified PrivilegedExceptionAction with privileges enabled. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to launch the action as is and bind the subject to the period of its execution. A replacement API named callAs has been added which can be used to perform the same work. There is no replacement for the Security Manager.

17

Returns:

the value returned by the PrivilegedAction's run method.
javax.security.auth.Subject.doAsPrivileged
(final Subject
the Subject that the specified action will run as. This parameter may be null.
subject
,
final PrivilegedAction<T>
the code to be run as the specified Subject.
action
,
final AccessControlContext
ignored
acc
)

This method originally performed the specified PrivilegedAction with privileges enabled and restricted by the specified AccessControlContext. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to ignore the AccessControlContext and launch the action as is and bind the subject to the period of its execution. A replacement API named callAs has been added which can be used to perform the same work. There is no replacement for the Security Manager.

17

Returns:

the value returned by the PrivilegedExceptionAction's run method.
javax.security.auth.Subject.doAsPrivileged
(final Subject
the Subject that the specified action will run as. This parameter may be null.
subject
,
final PrivilegedExceptionAction<T>
the code to be run as the specified Subject.
action
,
final AccessControlContext
ignored
acc
)

This method originally performed the specified PrivilegedExceptionAction with privileges enabled and restricted by the specified AccessControlContext. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to ignore the AccessControlContext and launch the action as is and bind the subject to the period of its execution. A replacement API named callAs has been added which can be used to perform the same work. There is no replacement for the Security Manager.

17

Returns:

n/a
javax.security.auth.Subject.getSubject
(final AccessControlContext
ignored
acc
)

This method used to get the subject associated with the provided AccessControlContext, which was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to always throw UnsupportedOperationException. A replacement API named current() has been added which can be used to obtain the current subject. There is no replacement for the Security Manager.

17
javax.security.auth.SubjectDomainCombiner

This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.

25
javax.security.auth.kerberos.DelegationPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

25
javax.security.auth.kerberos.ServicePermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

9
javax.security.cert.Certificate

Use the classes in java.security.cert instead.

9
javax.security.cert.CertificateEncodingException

Use the classes in java.security.cert instead.

9
javax.security.cert.CertificateException

Use the classes in java.security.cert instead.

9
javax.security.cert.CertificateExpiredException

Use the classes in java.security.cert instead.

9
javax.security.cert.CertificateNotYetValidException

Use the classes in java.security.cert instead.

9
javax.security.cert.CertificateParsingException

Use the classes in java.security.cert instead.

9
javax.security.cert.X509Certificate

Use the classes in java.security.cert instead.

24
javax.sound.sampled.AudioPermission

There is no replacement for this class.

24
17
javax.swing.plaf.basic.BasicDirectoryModel.intervalAdded(ListDataEvent
list data event
e
)

Obsolete method, not used anymore.

17
javax.swing.plaf.basic.BasicDirectoryModel.intervalRemoved(ListDataEvent
list data event
e
)

Obsolete method, not used anymore.

17

Returns:

a comparison of the file names
javax.swing.plaf.basic.BasicDirectoryModel.lt
(File
a file
a
,
File
another file
b
)

Obsolete method, not used anymore.

17
17
17
17
17
17

Returns:

an instance of JFrame
javax.swing.plaf.basic.BasicToolBarUI.createFloatingFrame
(JToolBar
an instance of JToolBar
toolbar
)

It is recommended that BasicToolBarUI#createFloatingWindow(JToolBar) be used instead

22
25
jdk.jfr.FlightRecorderPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

0
0
0
24
25
jdk.net.NetworkPermission

This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.

16

Returns:

A set of socket options
jdk.net.Sockets.supportedOptions
(Class<?>
the type of java.net socket
socketType
)

use Socket#supportedOptions(), ServerSocket#supportedOptions(), or DatagramSocket#supportedOptions() instead.

24
24
24
sun.jvm.hotspot.HotSpotAgent.startServer(int processID, String serverID, String serverName, int rmiPort)

24
sun.jvm.hotspot.HotSpotAgent.startServer(int processID, String serverID, String serverName)

24
24
sun.jvm.hotspot.HotSpotAgent.startServer(String javaExecutableName, String coreFileName, String serverID, String serverName, int rmiPort)

24
sun.jvm.hotspot.HotSpotAgent.startServer(String javaExecutableName, String coreFileName, String serverID, String serverName)

24
sun.jvm.hotspot.HotSpotAgent.startServer(String javaExecutableName, String coreFileName)

23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
sun.misc.Unsafe.allocateMemory(long bytes)

Use java.lang.foreign to allocate off-heap memory.

23
sun.misc.Unsafe.arrayBaseOffset(Class<?> arrayClass)

Not needed when using VarHandle or java.lang.foreign.

23
sun.misc.Unsafe.arrayIndexScale(Class<?> arrayClass)

Not needed when using VarHandle or java.lang.foreign.

23

Returns:

true if successful
sun.misc.Unsafe.compareAndSwapInt
(Object o, long offset, int expected, int x)

Use VarHandle#compareAndExchange(Object...) instead.

23

Returns:

true if successful
sun.misc.Unsafe.compareAndSwapLong
(Object o, long offset, long expected, long x)

Use VarHandle#compareAndExchange(Object...) instead.

23

Returns:

true if successful
sun.misc.Unsafe.compareAndSwapObject
(Object o, long offset, Object expected, Object x)

Use VarHandle#compareAndExchange(Object...) instead.

23
sun.misc.Unsafe.copyMemory(Object srcBase, long srcOffset, Object destBase, long destOffset, long bytes)

Use MemorySegment and its bulk copy methods instead.

23
sun.misc.Unsafe.copyMemory(long srcAddress, long destAddress, long bytes)

Use MemorySegment and its bulk copy methods instead.

23
sun.misc.Unsafe.freeMemory(long address)

Use java.lang.foreign to allocate and free off-heap memory.

22
23
sun.misc.Unsafe.getAddress(long address)

Use java.lang.foreign to access off-heap memory.

23

Returns:

the previous value
sun.misc.Unsafe.getAndAddInt
(Object
object/array to update the field/element in
o
,
long
field/element offset
offset
,
int
the value to add
delta
)

Use VarHandle#getAndAdd(Object...) instead.

23

Returns:

the previous value
sun.misc.Unsafe.getAndAddLong
(Object
object/array to update the field/element in
o
,
long
field/element offset
offset
,
long
the value to add
delta
)

Use VarHandle#getAndAdd(Object...) instead.

23

Returns:

the previous value
sun.misc.Unsafe.getAndSetInt
(Object
object/array to update the field/element in
o
,
long
field/element offset
offset
,
int
new value
newValue
)

Use VarHandle#getAndAdd(Object...) instead.

23

Returns:

the previous value
sun.misc.Unsafe.getAndSetLong
(Object
object/array to update the field/element in
o
,
long
field/element offset
offset
,
long
new value
newValue
)

Use VarHandle#getAndAdd(Object...) instead.

23

Returns:

the previous value
sun.misc.Unsafe.getAndSetObject
(Object
object/array to update the field/element in
o
,
long
field/element offset
offset
,
Object
new value
newValue
)

Use VarHandle#getAndAdd(Object...) instead.

23
23
23
23
sun.misc.Unsafe.getByte(long address)

Use java.lang.foreign to access off-heap memory.

23
23
23
sun.misc.Unsafe.getChar(long address)

Use java.lang.foreign to access off-heap memory.

23
23
23
sun.misc.Unsafe.getDouble(long address)

Use java.lang.foreign to access off-heap memory.

23
23
23
sun.misc.Unsafe.getFloat(long address)

Use java.lang.foreign to access off-heap memory.

23
23

Returns:

the value fetched from the indicated Java variable
sun.misc.Unsafe.getInt
(Object
Java heap object in which the variable resides, if any, else null
o
,
long
indication of where the variable resides in a Java heap object, if any, else a memory address locating the variable statically
offset
)

Use VarHandle#get(Object...) or MemorySegment#get(ValueLayout.OfInt, long) instead.

23
sun.misc.Unsafe.getInt(long address)

Use java.lang.foreign to access off-heap memory.

23
22

Returns:

the number of samples actually retrieved; or -1 if the load average is unobtainable.
sun.misc.Unsafe.getLoadAverage
(double[]
an array of double of size nelems
loadavg
,
int
the number of samples to be retrieved and must be 1 to 3.
nelems
)

Use java.management/java.lang.management.OperatingSystemMXBean#getSystemLoadAverage() instead.

23
23
sun.misc.Unsafe.getLong(long address)

Use java.lang.foreign to access off-heap memory.

23
23
23
23
23
sun.misc.Unsafe.getShort(long address)

Use java.lang.foreign to access off-heap memory.

23
23
sun.misc.Unsafe.invokeCleaner(ByteBuffer
a direct byte buffer
directBuffer
)

Use a MemorySegment allocated in an Arena with the appropriate temporal bounds. The MemorySegment#asByteBuffer() method wraps a memory segment as a ByteBuffer to allow interop with existing code.

22
18
sun.misc.Unsafe.objectFieldOffset(Field f)

The guarantee that a field will always have the same offset and base may not be true in a future release. The ability to provide an offset and object reference to a heap memory accessor will be removed in a future release. Use VarHandle instead.

22
23
sun.misc.Unsafe.putAddress(long address, long x)

Use java.lang.foreign to access off-heap memory.

23
23
23
23
sun.misc.Unsafe.putByte(long address, byte x)

Use java.lang.foreign to access off-heap memory.

23
23
23
sun.misc.Unsafe.putChar(long address, char x)

Use java.lang.foreign to access off-heap memory.

23
23
23
sun.misc.Unsafe.putDouble(long address, double x)

Use java.lang.foreign to access off-heap memory.

23
23
23
sun.misc.Unsafe.putFloat(long address, float x)

Use java.lang.foreign to access off-heap memory.

23
23
sun.misc.Unsafe.putInt(Object
Java heap object in which the variable resides, if any, else null
o
,
long
indication of where the variable resides in a Java heap object, if any, else a memory address locating the variable statically
offset
,
int
the value to store into the indicated Java variable
x
)

Use VarHandle#set(Object...) or MemorySegment#set(ValueLayout.OfInt, long, int) instead.

23
sun.misc.Unsafe.putInt(long address, int x)

Use java.lang.foreign to access off-heap memory.

23
23
23
sun.misc.Unsafe.putLong(long address, long x)

Use java.lang.foreign to access off-heap memory.

23
23
23
23
23
23
23
23
sun.misc.Unsafe.putShort(long address, short x)

Use java.lang.foreign to access off-heap memory.

23
23
sun.misc.Unsafe.reallocateMemory(long address, long bytes)

Use java.lang.foreign to allocate off-heap memory.

23
sun.misc.Unsafe.setMemory(Object o, long offset, long bytes, byte value)

MemorySegment#fill(byte) fills the contents of a memory segment with a given value.

23
sun.misc.Unsafe.setMemory(long address, long bytes, byte value)

MemorySegment#fill(byte) fills the contents of a memory segment with a given value. Use MemorySegment and its bulk copy methods instead.

18
sun.misc.Unsafe.staticFieldBase(Field f)

The guarantee that a field will always have the same offset and base may not be true in a future release. The ability to provide an offset and object reference to a heap memory accessor will be removed in a future release. Use VarHandle instead.

18
sun.misc.Unsafe.staticFieldOffset(Field f)

The guarantee that a field will always have the same offset and base may not be true in a future release. The ability to provide an offset and object reference to a heap memory accessor will be removed in a future release. Use VarHandle instead.

22
22
25
25
25
25