JDK-8278426 : ImagePool uses terminally deprecated System.runFinalization method
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: openjfx18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-12-08
  • Updated: 2022-11-29
  • Resolved: 2022-10-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
openjfx20 b05Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
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.
Comments
Changeset: 91e1a278 Author: Lukasz Kostyra <lukasz.kostyra@oracle.com> Committer: Ambarish Rapte <arapte@openjdk.org> Date: 2022-10-20 06:18:39 +0000 URL: https://git.openjdk.org/jfx/commit/91e1a278ac0087d7fa767342824023488e652761
20-10-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/918 Date: 2022-10-17 14:02:52 +0000
19-10-2022