Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8253568

Replace and mitigate Object.finalize() uses in JDK libraries

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:
      None

      Description

      Object.finalize was deprecated in JDK 9. Existing uses of finalize in the JDK need to be replaced or removed. In some cases specification changes are necessary.

      Do a survey of open/src/<module> 'finalize()' usage:

      java.base/share/classes/java/lang/Enum.java (keep: empty, final)
      java.base/share/classes/java/lang/Object.java (keep: empty, compat)
      java.base/share/classes/java/util/concurrent/Executors.java
      java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java (empty)
      java.base/share/classes/sun/net/www/MeteredStream.java
      java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java

      java.desktop/macosx/classes/apple/laf/JRSUIControl.java
      java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java
      java.desktop/macosx/classes/sun/font/CFont.java
      java.desktop/macosx/classes/sun/font/CStrike.java
      java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java
      java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
      java.desktop/share/classes/com/sun/imageio/plugins/common/SubImageInputStream.java
      java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java
      java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java
      java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGDecompressor.java
      java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java
      java.desktop/share/classes/com/sun/imageio/stream/StreamFinalizer.java
      java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java
      java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java
      java.desktop/share/classes/java/awt/Graphics.java
      java.desktop/share/classes/java/awt/PrintJob.java
      java.desktop/share/classes/java/awt/color/ICC_Profile.java
      java.desktop/share/classes/java/awt/image/ColorModel.java
      java.desktop/share/classes/java/awt/image/IndexColorModel.java
      java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java
      java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java
      java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java
      java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java
      java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
      java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java
      java.desktop/share/classes/javax/swing/text/StringContent.java
      java.desktop/share/classes/sun/java2d/SunGraphics2D.java
      java.desktop/share/classes/sun/print/PeekGraphics.java
      java.desktop/share/classes/sun/print/PrintJob2D.java
      java.desktop/share/classes/sun/print/ProxyGraphics.java
      java.desktop/share/classes/sun/print/ProxyGraphics2D.java
      java.desktop/unix/classes/sun/awt/X11InputMethodBase.java
      java.desktop/windows/classes/sun/awt/windows/WInputMethod.java

      java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
      java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java
      java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java
      java.naming/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java

      java.rmi/share/classes/sun/rmi/log/LogInputStream.java

      java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java
      java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java
      java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java

      java.security.sasl/share/classes/com/sun/security/sasl/CramMD5Base.java
      java.security.sasl/share/classes/com/sun/security/sasl/PlainClient.java

      java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java

      jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java
      jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java

      jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java

      jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java

      jdk.jfr/share/classes/jdk/jfr/internal/ChunkInputStream.java
      jdk.jfr/share/classes/jdk/jfr/internal/ChunksChannel.java
      jdk.jfr/share/classes/jdk/jfr/internal/RepositoryChunk.java

      jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java
      jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java

      jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java

      jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java

      jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java

      Some are awaiting removal of backward compatible work arounds in a appropriate future release.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bchristi Brent Christian
              Reporter:
              rriggs Roger Riggs
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated: