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

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

XMLWordPrintable

      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/ThreadPoolExecutor.java (empty)

      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 (empty)
      java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java (empty)
      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 (empty)
      java.desktop/share/classes/java/awt/image/ColorModel.java (empty)
      java.desktop/share/classes/java/awt/image/IndexColorModel.java (empty)
      java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java
      java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java (empty)
      java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java (empty)
      java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java (empty)
      java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
      java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java (empty)
      java.desktop/share/classes/javax/swing/text/StringContent.java
      java.desktop/share/classes/sun/java2d/SunGraphics2D.java (empty)
      java.desktop/share/classes/sun/print/PeekGraphics.java (empty)
      java.desktop/share/classes/sun/print/PrintJob2D.java
      java.desktop/share/classes/sun/print/ProxyGraphics.java (empty)
      java.desktop/share/classes/sun/print/ProxyGraphics2D.java (empty)
      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.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.mscapi/windows/classes/sun/security/mscapi/CKey.java

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

      jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java
      (RegistryContext.finalize() and BindingEnumeration.finalize())

      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.

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

              Created:
              Updated: