<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-IN link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>The fix looks good to me.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Rajeev Chamyal<o:p></o:p></span></p><p class=MsoNormal> <o:p></o:p></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right style='text-align:right'><b>Subject: <o:p></o:p></b></p></td><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal>Re: [9] RFR: JDK-8039412,,Stack overflow on Linux using DialogTypeSelection.NATIVE<o:p></o:p></p></td></tr><tr><td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right style='text-align:right'><b>Date: <o:p></o:p></b></p></td><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal>Mon, 16 Nov 2015 12:42:06 -0800<o:p></o:p></p></td></tr><tr><td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right style='text-align:right'><b>From: <o:p></o:p></b></p></td><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal>Phil Race <a href="mailto:philip.race@oracle.com"><philip.race@oracle.com></a><o:p></o:p></p></td></tr><tr><td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right style='text-align:right'><b>To: <o:p></o:p></b></p></td><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal>prasanta sadhukhan <a href="mailto:prasanta.sadhukhan@oracle.com"><prasanta.sadhukhan@oracle.com></a><o:p></o:p></p></td></tr><tr><td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right style='text-align:right'><b>CC: <o:p></o:p></b></p></td><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal>Rajeev Chamyal <a href="mailto:rajeev.chamyal@oracle.com"><rajeev.chamyal@oracle.com></a>, <a href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a> <a href="mailto:2d-dev@openjdk.java.net"><2d-dev@openjdk.java.net></a><o:p></o:p></p></td></tr></table><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><pre>On 11/13/2015 12:24 AM, prasanta sadhukhan wrote:<o:p></o:p></pre><pre>> Hi Phil,<o:p></o:p></pre><pre>><o:p> </o:p></pre><pre>> On 11/13/2015 12:23 AM, Philip Race wrote:<o:p></o:p></pre><pre>>> I am 99% sure this breaks the API on Windows on Mac.<o:p></o:p></pre><pre>>> Did you test what it does there ?<o:p></o:p></pre><pre>>><o:p> </o:p></pre><pre>> It works on Windows as PrinterJob.pageDialog(attributes) calls <o:p></o:p></pre><pre>> pageDialog(PageFormat page) in WPrinterJob.java which overrides <o:p></o:p></pre><pre>> pageDialog(PageFormat) of RasterPrinterJob<o:p></o:p></pre><pre>> It also works on Mac as PrinterJob.pageDialog(attributes) calls <o:p></o:p></pre><pre>> pageDialog(PageFormat page) in CPrinterJob.java which overrides <o:p></o:p></pre><pre>> pageDialog(PageFormat) of RasterPrinterJob<o:p></o:p></pre><pre>><o:p> </o:p></pre><pre>> I actually mistakenly mentioned down below that the check was added in <o:p></o:p></pre><pre>> pageDialog(attributes) whereas actually<o:p></o:p></pre><pre>> the temporary removal and addition was added in pageDialog(PageFormat) <o:p></o:p></pre><pre>> so it only affects linux printing dialog.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>I see. So long as you have tested .. approved.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>-phil.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>>> Test has wild card imports again ..<o:p></o:p></pre><pre>> Corrected wild card imports. Updated webrev is here:<o:p></o:p></pre><pre>> <a href="http://cr.openjdk.java.net/~psadhukhan/8039412/webrev.01/">http://cr.openjdk.java.net/~psadhukhan/8039412/webrev.01/</a><o:p></o:p></pre><pre>><o:p> </o:p></pre><pre>>><o:p> </o:p></pre><pre>>> Also please add evaluation and explanation of the proposed fix into a<o:p></o:p></pre><pre>>> public comment on the bug report before submitting for review.<o:p></o:p></pre><pre>>><o:p> </o:p></pre><pre>> Added public comment.<o:p></o:p></pre><pre>><o:p> </o:p></pre><pre>> Regards<o:p></o:p></pre><pre>> Prasanta<o:p></o:p></pre><pre>>> -phil.<o:p></o:p></pre><pre>>><o:p> </o:p></pre><pre>>> On 11/6/15, 3:00 AM, prasanta sadhukhan wrote:<o:p></o:p></pre><pre>>>> Hi All,<o:p></o:p></pre><pre>>>><o:p> </o:p></pre><pre>>>> Please review a fix for jdk9.<o:p></o:p></pre><pre>>>><o:p> </o:p></pre><pre>>>> Bug: <a href="https://bugs.openjdk.java.net/browse/JDK-8039412">https://bugs.openjdk.java.net/browse/JDK-8039412</a><o:p></o:p></pre><pre>>>> webrev: <a href="http://cr.openjdk.java.net/~psadhukhan/8039412/webrev.00/">http://cr.openjdk.java.net/~psadhukhan/8039412/webrev.00/</a><o:p></o:p></pre><pre>>>><o:p> </o:p></pre><pre>>>> Issue was seen in linux whereby if we call PrinterJob.pageDialog() <o:p></o:p></pre><pre>>>> after PrinterJob.printDialog() it results in StackOverflowError if <o:p></o:p></pre><pre>>>> DialogSelectionType is NATIVE.<o:p></o:p></pre><pre>>>><o:p> </o:p></pre><pre>>>> This was because pageDialog(attributes) was calling <o:p></o:p></pre><pre>>>> pageDialog(pageformat) if it is DialogTypeSelection.NATIVE which <o:p></o:p></pre><pre>>>> again calls pageDialog(attributes)<o:p></o:p></pre><pre>>>> via this code<o:p></o:p></pre><pre>>>> <a href="http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java#l767">http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java#l767</a> <o:p></o:p></pre><pre>>>><o:p> </o:p></pre><pre>>>> and<o:p></o:p></pre><pre>>>> <a href="http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java#l743">http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java#l743</a> <o:p></o:p></pre><pre>>>><o:p> </o:p></pre><pre>>>><o:p> </o:p></pre><pre>>>> I added a fix whereby in pageDialog(attributes)we check if it is <o:p></o:p></pre><pre>>>> DialogTypeSelection.NATIVE and remove this attribute temporarily <o:p></o:p></pre><pre>>>> before calling pageDialog(pageformat)<o:p></o:p></pre><pre>>>> and restore the DialogTypeSelection.NATIVE after the call.<o:p></o:p></pre><pre>>>> It is similar to solution done in<o:p></o:p></pre><pre>>>> <a href="http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/PSPrinterJob.java#l443">http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/PSPrinterJob.java#l443</a> <o:p></o:p></pre><pre>>>><o:p> </o:p></pre><pre>>>><o:p> </o:p></pre><pre>>>> Regards<o:p></o:p></pre><pre>>>> Prasanta<o:p></o:p></pre><pre>><o:p> </o:p></pre><pre><o:p> </o:p></pre><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>