8378417: Printing All pages results in NPE for 1.1 PrintJob#441
8378417: Printing All pages results in NPE for 1.1 PrintJob#441rm-gh-8 wants to merge 1 commit intoopenjdk:pr/440from
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-8378417: Printing All pages results in NPE for 1.1 PrintJob. This PR fixes a NullPointerException in PrintJobDelegate.updateAttributes() and a related issue in WPrinterJob where selecting "All Pages" after a page range caused incorrect behavior, by adding a null check for PageRanges and replacing attributes.remove() with setting a default PageRanges(1, Integer.MAX_VALUE). For parity with Oracle JDK. Low risk — the null check is a defensive guard, and replacing remove() with a default PageRanges(1, MAX_VALUE) is semantically equivalent to "all pages". The fix addresses a clear regression from JDK-8373239 with minimal code change. |
Backporting JDK-8378417: Printing All pages results in NPE for 1.1 PrintJob.
This PR fixes a NullPointerException in PrintJobDelegate.updateAttributes() and a related issue in WPrinterJob where selecting "All Pages" after a page range caused incorrect behavior, by adding a null check for PageRanges and replacing attributes.remove() with setting a default PageRanges(1, Integer.MAX_VALUE).
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/TestPrintNoException.java
Results attached:
windows-x64-specific-test.log
macos-aarch64-specific-test.log
linux-x64-specific-test.log
linux-aarch64-specific-test.log
Ran manual tests on macos-aarch64:
~/github/jtreg/build/images/jtreg/bin/jtreg -jdk build/macosx-aarch64-server-release/images/jdk -m test/jdk/java/awt/print/PrinterJob/PageRanges.javaScreenshot:
Documents:
1.pdf
2.pdf
Results:
result: Passed. Execution successfulPageRanges.jtr.txt
Progress
Integration blocker
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk25u-dev.git pull/441/head:pull/441$ git checkout pull/441Update a local copy of the PR:
$ git checkout pull/441$ git pull https://git.openjdk.org/jdk25u-dev.git pull/441/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 441View PR using the GUI difftool:
$ git pr show -t 441Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk25u-dev/pull/441.diff
Using Webrev
Link to Webrev Comment