The fix looks good to me.
Regards, Rajeev Chamyal Subject: Re: [9] RFR: JDK-8039412,,Stack overflow on Linux using DialogTypeSelection.NATIVE Date: Mon, 16 Nov 2015 12:42:06 -0800 From: Phil Race HYPERLINK "mailto:philip.r...@oracle.com"<philip.r...@oracle.com> To: prasanta sadhukhan HYPERLINK "mailto:prasanta.sadhuk...@oracle.com"<prasanta.sadhuk...@oracle.com> CC: Rajeev Chamyal HYPERLINK "mailto:rajeev.cham...@oracle.com"<rajeev.cham...@oracle.com>, HYPERLINK "mailto:2d-dev@openjdk.java.net"2d-dev@openjdk.java.net HYPERLINK "mailto:2d-dev@openjdk.java.net"<2d-dev@openjdk.java.net> On 11/13/2015 12:24 AM, prasanta sadhukhan wrote: > Hi Phil, > > On 11/13/2015 12:23 AM, Philip Race wrote: >> I am 99% sure this breaks the API on Windows on Mac. >> Did you test what it does there ? >> > It works on Windows as PrinterJob.pageDialog(attributes) calls > pageDialog(PageFormat page) in WPrinterJob.java which overrides > pageDialog(PageFormat) of RasterPrinterJob > It also works on Mac as PrinterJob.pageDialog(attributes) calls > pageDialog(PageFormat page) in CPrinterJob.java which overrides > pageDialog(PageFormat) of RasterPrinterJob > > I actually mistakenly mentioned down below that the check was added in > pageDialog(attributes) whereas actually > the temporary removal and addition was added in pageDialog(PageFormat) > so it only affects linux printing dialog. I see. So long as you have tested .. approved. -phil. >> Test has wild card imports again .. > Corrected wild card imports. Updated webrev is here: > http://cr.openjdk.java.net/~psadhukhan/8039412/webrev.01/ > >> >> Also please add evaluation and explanation of the proposed fix into a >> public comment on the bug report before submitting for review. >> > Added public comment. > > Regards > Prasanta >> -phil. >> >> On 11/6/15, 3:00 AM, prasanta sadhukhan wrote: >>> Hi All, >>> >>> Please review a fix for jdk9. >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8039412 >>> webrev: http://cr.openjdk.java.net/~psadhukhan/8039412/webrev.00/ >>> >>> Issue was seen in linux whereby if we call PrinterJob.pageDialog() >>> after PrinterJob.printDialog() it results in StackOverflowError if >>> DialogSelectionType is NATIVE. >>> >>> This was because pageDialog(attributes) was calling >>> pageDialog(pageformat) if it is DialogTypeSelection.NATIVE which >>> again calls pageDialog(attributes) >>> via this code >>> http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java#l767 >>> >>> >>> and >>> http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java#l743 >>> >>> >>> >>> I added a fix whereby in pageDialog(attributes)we check if it is >>> DialogTypeSelection.NATIVE and remove this attribute temporarily >>> before calling pageDialog(pageformat) >>> and restore the DialogTypeSelection.NATIVE after the call. >>> It is similar to solution done in >>> http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/PSPrinterJob.java#l443 >>> >>> >>> >>> Regards >>> Prasanta >