RFR: 8373239: Test java/awt/print/PrinterJob/PageRanges.java fails with incorrect selection of printed pages [v3]
Phil Race
prr at openjdk.org
Wed Jan 21 18:46:12 UTC 2026
On Wed, 21 Jan 2026 07:26:38 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> If same `PrinterJob `is reused to first print user-set `PageRange `pages and then print ALL pages, it prints the first print job correctly as the page range is set but 2nd job doesn't print ALL pages and reprint the same page range as `from` and `to` page are not reset and reused
>>
>> Fix is made to check if page range is not set then print all pages
>
> Prasanta Sadhukhan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits:
>
> - Merge master
> - Merge master
> - Remove PageRange attribute if range is not set
> - 8373239: Test java/awt/print/PrinterJob/PageRanges.java fails with incorrect selection of printed pages
src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java line 1737:
> 1735: setPageRange(from, to);
> 1736: } else {
> 1737: attributes.remove(PageRanges.class);
I'm a bit surprised you didn't need to still reset the page range ... is something else re-setting it ?
setPageRange(Pageable.UNKNOWN_NUMBER_OF_PAGES, Pageable.UNKNOWN_NUMBER_OF_PAGES)
src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java line 1737:
> 1735: setPageRange(from, to);
> 1736: } else {
> 1737: attributes.remove(PageRanges.class);
I'm a bit surprised you didn't need to still reset the page range ... is something else re-setting it ?
setPageRange(Pageable.UNKNOWN_NUMBER_OF_PAGES, Pageable.UNKNOWN_NUMBER_OF_PAGES)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29312#discussion_r2713845703
PR Review Comment: https://git.openjdk.org/jdk/pull/29312#discussion_r2713846544
More information about the client-libs-dev
mailing list