<div dir="ltr"><div dir="ltr">Hi,<br>Currently, I'm working on JDK-8343224, and want to provide some investigation results, a possible patch and ask about PR. <br>The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation.<br>After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. <br><br>For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference.<br>         *<span class="" id=":uw.1" tabindex="-1" role="menuitem" aria-haspopup="true" style="">PaperDimension</span> A4/A4:             "595 842"<br>         *<span class="" id=":uw.2" tabindex="-1" role="menuitem" aria-haspopup="true" style="">PaperDimension</span> BrA4_B/A4 (Borderless):  "595 842"<br>After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and <span class="" id=":uw.3" tabindex="-1" role="menuitem" aria-haspopup="true" style="">CustomMediaSize</span> will match the "iso_a4" standard media size.<br>After processing the second line, the MediaSize will contain the new size "BrA4_B", and <span class="" id=":uw.4" tabindex="-1" role="menuitem" aria-haspopup="true" style="">CustomMediaSize</span> 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".<br><br>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 (<span class="" id=":uw.5" tabindex="-1" role="menuitem" aria-haspopup="true" style="">CustomMediaSizeName's</span> <span class="" id=":uw.6" tabindex="-1" role="menuitem" aria-haspopup="true" style="">customMap</span> usage was updated to prevent duplicate instance creation)?<div>You can find the proposed patch on the bug's page <a href="https://bugs.openjdk.org/browse/JDK-8343224" target="_blank">https://bugs.openjdk.org/browse/JDK-8343224</a>. (0001-Create-MediaSize-only-if-<span class="" id=":uw.7" tabindex="-1" role="menuitem" aria-haspopup="true" style="">getStandardMedia</span>-is-null.patch). The patch was tested with test/jdk/java/awt/print/Dialog/<span class="" id=":uw.8" tabindex="-1" role="menuitem" aria-haspopup="true" style="">PaperSizeError</span>.java as described in the bug.<div><br></div><div>BR,</div><div>Gennadiy.</div></div></div>
</div>