8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4
Gennadiy Krivoshein
gennadiy.krivoshein at bell-sw.com
Thu Nov 21 10:55:50 UTC 2024
Hi,
Currently, I'm working on JDK-8343224, and want to provide some
investigation results, a possible patch and ask about PR.
The reason for the regression bug is a missed check for the standard media
existence during CustomMediaSizeName creation.
After the JDK-7001133 new MediaSize is created, regardless of whether a
standard media size exists.
For example, if a printer's PPD has two media with the same size, close to
"iso_A4," with a small difference.
*PaperDimension A4/A4: "595 842"
*PaperDimension BrA4_B/A4 (Borderless): "595 842"
After processing the first line, the MediaSize will contain the new size
"A4" because of the missed check, and CustomMediaSize will match the
"iso_a4" standard media size.
After processing the second line, the MediaSize will contain the new size
"BrA4_B", and CustomMediaSize will match not the "iso_a4" but the
previously added "A4", because it was added by mistake and its size is
exactly the same as "BrA4_B".
Is it possible to create a PR with a patch that was provided in a comment
for the bug by Prasanta Sadhukhan with minor changes (CustomMediaSizeName's
customMap usage was updated to prevent duplicate instance creation)?
You can find the proposed patch on the bug's page
https://bugs.openjdk.org/browse/JDK-8343224. (0001-Create-MediaSize-only-if-
getStandardMedia-is-null.patch). The patch was tested
with test/jdk/java/awt/print/Dialog/PaperSizeError.java as described in the
bug.
BR,
Gennadiy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20241121/9234474d/attachment.htm>
More information about the client-libs-dev
mailing list