On Wed, 5 Nov 2025 00:22:18 GMT, Phil Race <[email protected]> wrote:
>> Synchronize WPrinterJob calls which use the printDC to avoid crash in case
>> of mis-use.
>> The printerDC is released when the job ends.
>> It is zero-ed out in the handle in which it is stored
>> The calls which expect it to be valid now all check for zero and return if
>> it is zero.
>> The calls are made synchronized as is the call to endDoc which zeroes it, so
>> that they cannot have it zeroed out whilst using it.
>>
>> The tests are the same as in the fix for JDK-8370141 which is also under
>> review.
>> Which ever is 2nd to be pushed will have to merge in the changes from the
>> first
>
> Phil Race has updated the pull request incrementally with one additional
> commit since the last revision:
>
> 8370637
Marked as reviewed by aivanov (Reviewer).
src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java line 1102:
> 1100:
> 1101: protected synchronized void fillRect(float x, float y, float width,
> float height,
> 1102: Color color) {
Suggestion:
protected synchronized void fillRect(float x, float y, float width, float
height,
Color color) {
Restore alignment for the `color` argument.
There are other similar cases which IDE could quickly update.
src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java line 1450:
> 1448: * StartPage routine.
> 1449: */
> 1450: protected synchronized native void deviceStartPage(PageFormat
> format, Printable painter,
This line is now longer than 80 columns (it's 93 to be precise).
-------------
PR Review: https://git.openjdk.org/jdk/pull/27984#pullrequestreview-3423603468
PR Review Comment: https://git.openjdk.org/jdk/pull/27984#discussion_r2495583486
PR Review Comment: https://git.openjdk.org/jdk/pull/27984#discussion_r2495595975