8363889: Update sun.print.PrintJob2D to use Disposer#440
8363889: Update sun.print.PrintJob2D to use Disposer#440rm-gh-8 wants to merge 1 commit intoopenjdk:pr/439from
Conversation
|
👋 Welcome back rmesde! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This backport pull request has now been updated with issue from the original commit. |
|
/approval request for backport of JDK-8363889: Update sun.print.PrintJob2D to use Disposer. This PR refactors PrintJob2D to use a delegate pattern with Disposer-based cleanup as a replacement for relying on finalize(), so that when the PrintJob2D object becomes unreachable, the Disposer can call end() on the delegate to release resources. This is a prerequisite for JDK-8378417 which will be added as a dependent PR (#441) for parity with Oracle JDK. Medium risk — while the refactoring is mechanically straightforward (moving code to a delegate with no logic changes), the switch from finalization to Disposer-based cleanup changes the timing and guarantees of resource cleanup. end() is now |
Backporting JDK-8363889: Update sun.print.PrintJob2D to use Disposer.
This PR refactors PrintJob2D to use a delegate pattern with Disposer-based cleanup as a replacement for relying on finalize(), so that when the PrintJob2D object becomes unreachable, the Disposer can call end() on the delegate to release resources.
This is a prerequisite for JDK-8378417 which will be added as a dependent PR (#441) for parity with Oracle JDK.
Ran related tests on linux-x64, linux-aarch64, macos-aarch64 and windows-x64:
make test TEST=test/jdk/java/awt/PrintJob
Results attached;
windows-x64-specific-test.log
macos-aarch64-specific-test.log
linux-x64-specific-test.log
linux-aarch64-specific-test.log
Progress
Integration blocker
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk25u-dev.git pull/440/head:pull/440$ git checkout pull/440Update a local copy of the PR:
$ git checkout pull/440$ git pull https://git.openjdk.org/jdk25u-dev.git pull/440/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 440View PR using the GUI difftool:
$ git pr show -t 440Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk25u-dev/pull/440.diff
Using Webrev
Link to Webrev Comment