On Wed, 6 Jan 2021 04:55:34 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Fix code
>
> test/jdk/java/awt/print/PrinterJob/LandscapeStackOverflow.java line 46:
> 
>> 44: 
>> 45:     public static final void main( String[] parameters ) throws 
>> Exception {
>> 46:         PrintService[] printService = PrinterJob.lookupPrintServices();
> 
> As far as I understand and comment in my previouse comment, if the 
> lookupPrintServices() return empty array then the "PrinterJob.print()" will 
> throw the same PrinterException("No print service found");
> 
> And if default printer is not set, and we have some other printers then 
> "PrinterJob.print()" will select some non-default printer already, isn't it?
> 
> I meant that we just duplicate an existed checks, and both of them wll not 
> work. If the system has some non-real printers like XPS, or "print to PDF" 
> then such printers will be count  by the "PrinterJob.lookupPrintServices()" 
> so no exception will be thrown and the test just hands suggestion the user to 
> save the printed document somewhere. The hang occur exactly where it is 
> reported in JBS "WPrinterJob._startDoc".
> 
> I can reproduce it on the freshly installed Windows.

I'm not sure we can avoid this if user selects "print to pdf" as default 
printservice or if it is the only printservice available. Maybe converting it 
to manual is the way to go.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1927

Reply via email to