[OpenJDK 2D-Dev] [9] RFR: JDK-8039412, , Stack overflow on Linux using DialogTypeSelection.NATIVE

Philip Race philip.race at oracle.com
Thu Nov 12 18:53:57 UTC 2015


I am 99% sure this breaks the API on Windows on Mac.
Did you test what it does there ?

Test has wild card imports again ..

Also please add evaluation and explanation of the proposed fix into a
public comment on the bug report before submitting for review.

-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



More information about the 2d-dev mailing list