Deprecated API

Contents

  • For Removal
    Element Description
    java.activation
    java.corba
    java.io.FileInputStream.finalize()
    The finalize method has been deprecated and will be removed. Subclasses that override finalize in order to perform cleanup should be modified to use alternative cleanup mechanisms and to remove the overriding finalize method. When overriding the finalize method, its implementation must explicitly ensure that super.finalize() is invoked as described in Object.finalize(). See the specification for Object.finalize() for further information about migration options.
    java.io.FileOutputStream.finalize()
    The finalize method has been deprecated and will be removed. Subclasses that override finalize in order to perform cleanup should be modified to use alternative cleanup mechanisms and to remove the overriding finalize method. When overriding the finalize method, its implementation must explicitly ensure that super.finalize() is invoked as described in Object.finalize(). See the specification for Object.finalize() for further information about migration options.
    java.lang.Compiler
    JIT compilers and their technologies vary too widely to be controlled effectively by a standardized interface. As such, many JIT compiler implementations ignore this interface, and are instead controllable by implementation-specific mechanisms such as command-line options. This class is subject to removal in a future version of Java SE.
    java.lang.Runtime.runFinalizersOnExit​(boolean)
    This method is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock. This method is subject to removal in a future version of Java SE.
    java.lang.Runtime.traceInstructions​(boolean)
    This method was intended to control instruction tracing. It has been superseded by JVM-specific tracing mechanisms. This method is subject to removal in a future version of Java SE.
    java.lang.Runtime.traceMethodCalls​(boolean)
    This method was intended to control method call tracing. It has been superseded by JVM-specific tracing mechanisms. This method is subject to removal in a future version of Java SE.
    java.lang.SecurityManager.checkAwtEventQueueAccess()
    This method was originally used to check if the calling thread could access the AWT event queue. The method has been obsoleted and code should instead use SecurityManager.checkPermission(java.security.Permission) to check AWTPermission("accessEventQueue"). This method is subject to removal in a future version of Java SE.
    java.lang.SecurityManager.checkMemberAccess​(Class<?>, int)
    This method was originally used to check if the calling thread was allowed to access members. It relied on the caller being at a stack depth of 4 which is error-prone and cannot be enforced by the runtime. The method has been obsoleted and code should instead use SecurityManager.checkPermission(java.security.Permission) to check RuntimePermission("accessDeclaredMembers"). This method is subject to removal in a future version of Java SE.
    java.lang.SecurityManager.checkSystemClipboardAccess()
    This method was originally used to check if the calling thread could access the system clipboard. The method has been obsoleted and code should instead use SecurityManager.checkPermission(java.security.Permission) to check AWTPermission("accessClipboard"). This method is subject to removal in a future version of Java SE.
    java.lang.SecurityManager.checkTopLevelWindow​(Object)
    This method was originally used to check if the calling thread was trusted to bring up a top-level window. The method has been obsoleted and code should instead use SecurityManager.checkPermission(java.security.Permission) to check AWTPermission("showWindowWithoutWarningBanner"). This method is subject to removal in a future version of Java SE.
    java.lang.System.runFinalizersOnExit​(boolean)
    This method is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock. This method is subject to removal in a future version of Java SE.
    java.lang.Thread.countStackFrames()
    The definition of this call depends on Thread.suspend(), which is deprecated. Further, the results of this call were never well-defined. This method is subject to removal in a future version of Java SE.
    java.lang.Thread.destroy()
    This method was originally designed to destroy this thread without any cleanup. Any monitors it held would have remained locked. However, the method was never implemented. If it were to be implemented, it would be deadlock-prone in much the manner of Thread.suspend(). If the target thread held a lock protecting a critical system resource when it was destroyed, no thread could ever access this resource again. If another thread ever attempted to lock this resource, deadlock would result. Such deadlocks typically manifest themselves as "frozen" processes. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?. This method is subject to removal in a future version of Java SE.
    java.lang.Thread.stop​(Throwable)
    This method was originally designed to force a thread to stop and throw a given Throwable as an exception. It was inherently unsafe (see Thread.stop() for details), and furthermore could be used to generate exceptions that the target thread was not prepared to handle. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?. This method is subject to removal in a future version of Java SE.
    java.se.ee
    java.security.acl.Acl
    This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2.
    java.security.acl.AclEntry
    This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2.
    java.security.acl.AclNotFoundException
    This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2.
    java.security.acl.Group
    This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2.
    java.security.acl.LastOwnerException
    This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2.
    java.security.acl.NotOwnerException
    This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2.
    java.security.acl.Owner
    This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2.
    java.security.acl.Permission
    This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 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.
    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.
    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.
    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.
    java.transaction
    java.util.zip.Deflater.finalize()
    The finalize method has been deprecated and will be removed. It is implemented as a no-op. Subclasses that override finalize in order to perform cleanup should be modified to use alternative cleanup mechanisms and to remove the overriding finalize method. The recommended cleanup for compressor is to explicitly call end method when it is no longer in use. If the end is not invoked explicitly the resource of the compressor will be released when the instance becomes unreachable.
    java.util.zip.Inflater.finalize()
    The finalize method has been deprecated and will be removed. It is implemented as a no-op. Subclasses that override finalize in order to perform cleanup should be modified to use alternative cleanup mechanisms and remove the overriding finalize method. The recommended cleanup for compressor is to explicitly call end method when it is no longer in use. If the end is not invoked explicitly the resource of the compressor will be released when the instance becomes unreachable,
    java.util.zip.ZipFile.finalize()
    The finalize method has been deprecated and will be removed. It is implemented as a no-op. Subclasses that override finalize in order to perform cleanup should be modified to use alternative cleanup mechanisms and to remove the overriding finalize method. The recommended cleanup for ZipFile object is to explicitly invoke close method when it is no longer in use, or use try-with-resources. If the close is not invoked explicitly the resources held by this object will be released when the instance becomes unreachable.
    java.xml.bind
    java.xml.ws
    java.xml.ws.annotation
    javax.management.remote.rmi.RMIConnectorServer.CREDENTIAL_TYPES
    javax.security.auth.Policy
    Replaced by java.security.Policy. java.security.Policy has a method:
     public PermissionCollection getPermissions
     (java.security.ProtectionDomain pd)
     
    and ProtectionDomain has a constructor:
     public ProtectionDomain
     (CodeSource cs,
     PermissionCollection permissions,
     ClassLoader loader,
     Principal[] principals)
     
    These two APIs provide callers the means to query the Policy for Principal-based Permission entries. This class is subject to removal in a future version of Java SE.