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

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

    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:

      src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java
      src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java
      src/java.desktop/share/classes/com/sun/imageio/stream/StreamFinalizer.java
      src/java.desktop/share/classes/com/sun/imageio/plugins/common/SubImageInputStream.java
      src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java
      src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java
      src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java
      src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGDecompressor.java
      src/java.desktop/share/classes/sun/font/TrueTypeFont.java
      src/java.desktop/share/classes/sun/java2d/pipe/RegionClipSpanIterator.java
      src/java.desktop/share/classes/sun/java2d/pipe/RegionSpanIterator.java
      src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java
      src/java.desktop/share/classes/sun/print/PrintJob2D.java
      src/java.desktop/share/classes/sun/print/PeekGraphics.java
      src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java
      src/java.desktop/share/classes/sun/print/ProxyGraphics.java
      src/java.desktop/share/classes/java/awt/image/ColorModel.java
      src/java.desktop/share/classes/java/awt/image/IndexColorModel.java
      src/java.desktop/share/classes/java/awt/Graphics.java
      src/java.desktop/share/classes/java/awt/PrintJob.java
      src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
      src/java.desktop/share/classes/javax/swing/text/StringContent.java
      src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java
      src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
      src/java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java
      src/java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java
      src/java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java
      src/java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java

      src/java.naming/share/classes/com/sun/jndi/ldap/EventSupport.java
      src/java.naming/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java
      src/java.naming/share/classes/com/sun/jndi/ldap/pool/ConnectionsRef.java
      src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java
      src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
      src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java

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

      src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java
      src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java
      src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java
      src/java.security.sasl/share/classes/com/sun/security/sasl/PlainClient.java
      src/java.security.sasl/share/classes/com/sun/security/sasl/CramMD5Base.java

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

      src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java

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

      src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/Stub.java
      src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java

      src/jdk.internal.le/share/classes/jdk/internal/jline/console/ConsoleReader.java
      src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java
      src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java
      src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java
      src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java

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

      src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java
      src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java
      src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java

      src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java

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

      src/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:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: