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

ImagePool uses terminally deprecated System.runFinalization method

XMLWordPrintable

    • b05

      The System.runFinalization and Runtime.runFinalization methods are terminally deprecated by JEP 421 (JDK-8274609). ImagePool.pruneCache calls System.runFinalization which results in a "removal" warning.

      $ gradle --info -PLINT=removal sdk
      ...
      modules/javafx.graphics/src/main/java/com/sun/scenario/effect/impl/ImagePool.java:259: warning: [removal] runFinalization() in System has been deprecated and marked for removal
              System.runFinalization();
                    ^
      modules/javafx.graphics/src/main/java/com/sun/scenario/effect/impl/ImagePool.java:261: warning: [removal] runFinalization() in System has been deprecated and marked for removal
              System.runFinalization();
                    ^

      The only purpose of calling runFinalization was to cause finalize to be called on JavaFX images. Since the JavaFX runtime no longer uses finalization anywhere, the calls to runFinalization are unnecessary and should be removed.

      NOTE: several tests also call System.runFinalization; I will file a separate bug for the tests.

            lkostyra Lukasz Kostyra
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: