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

We don't need jdk.internal.ref.Cleaner any more - part 1

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • core-libs
    • None
    • b110

      sun.misc.Cleaner has been moved to internal package jdk.internal.ref recently [1] to clean-up sun.misc namespace. But now that:

      - we have comparable public API (java.lang.ref.Cleaner & Cleanable) [2]
      - we have an internal shared java.lang.ref.Cleaner instance (jdk.internal.ref.CleanerFactory.cleaner())
      - sun.misc.Cleaner is not a special kind of Reference any more in the JVM [3]
      - threads failing to allocate memory in NIO themselves get involved in cleaning, see JDK-6857566

      ...I think there's no reason to keep this special internal API any more. It can be replaced with public API.

      I propose to remove jdk.internal.ref.Cleaner class and replace its usages with java.lang.ref.Cleaner and friends [4].

      [1] https://bugs.openjdk.java.net/browse/JDK-8148117
      [2] https://bugs.openjdk.java.net/browse/JDK-8138696
      [3] https://bugs.openjdk.java.net/browse/JDK-8143847
      [4] http://cr.openjdk.java.net/~plevart/jdk9-dev/removeInternalCleaner/webrev.03/

            plevart Peter Levart
            plevart Peter Levart
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: