RFR: 8363889: Update sun.print.PrintJob2D to use Disposer [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Aug 1 04:14:01 UTC 2025


On Tue, 22 Jul 2025 22:10:37 GMT, Phil Race <prr at openjdk.org> wrote:

>> As laid out in the JBS issue, this updates the java.awt.PrintJob implementation to use a delegate which can be disposed instead of relying on finalize().
>> 
>> PrintJob.finalize() is not being removed, and won't be removed until there is a more definite plan for completely removing the finalize() mechanism.
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8363889

src/java.desktop/share/classes/sun/print/PrintJob2D.java line 35:

> 33: import java.awt.JobAttributes.*;
> 34: import java.awt.PageAttributes;
> 35: import java.awt.PageAttributes.*;

wildcard..probably it should be removed as it is used in Delegate class

src/java.desktop/share/classes/sun/print/PrintJob2D.java line 115:

> 113:     }
> 114: 
> 115:     private static class PrintJobDisposerRecord implements DisposerRecord {

should we also make it a final class?

src/java.desktop/share/classes/sun/print/PrintJobDelegate.java line 2:

> 1: /*
> 2:  * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.

should it be 2000? its a new class but its content is from 2000!!

src/java.desktop/share/classes/sun/print/PrintJobDelegate.java line 36:

> 34: import java.awt.JobAttributes.*;
> 35: import java.awt.PageAttributes;
> 36: import java.awt.PageAttributes.*;

wildcard

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26432#discussion_r2246853626
PR Review Comment: https://git.openjdk.org/jdk/pull/26432#discussion_r2246853391
PR Review Comment: https://git.openjdk.org/jdk/pull/26432#discussion_r2246854668
PR Review Comment: https://git.openjdk.org/jdk/pull/26432#discussion_r2246855763


More information about the client-libs-dev mailing list