Hi Sergey, It is true that if there are no printers connected to the system we 
should be getting the exception but all of windows system at least contains 
'Fax', 'Microsoft print to PDF' as default printers in the printers list. 
Ideally it is true that a null return case must have been handled. 
So I simulated this effect by setting cReturned to zero causing a NPE to 
trigger with the old code and then applied the fix and found that there is no 
NPE anymore.

Thanks and regards,
Shashi

-----Original Message-----
From: Sergey Bylokhov 
Sent: Tuesday, December 4, 2018 11:42 AM
To: Shashidhara Veerabhadraiah <shashidhara.veerabhadra...@oracle.com>; Philip 
Race <philip.r...@oracle.com>; Prasanta Sadhukhan 
<prasanta.sadhuk...@oracle.com>; 2d-dev@openjdk.java.net
Subject: Re: [OpenJDK 2D-Dev] [12] JDK-8212202: NPE in the print tests after 
JDK-8153732

Hi, Shashi.

> The big problem was that I was not able to reproduce this problem neither at 
> my end nor at the systems used for PIT testing. Only Sergey had produced this 
> NPE till now.
If you cannot reproduce this exception on the system w/o printers, then it is 
interesting what will return this code:

  259         ::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS,
  260                        NULL, 4, pPrinterEnum, cbNeeded, &cbNeeded,
  261                        &cReturned);
  262
  263         if (cReturned > 0) {....}

what will happen if you try to print something to the printer which is returned 
in the case above?

--
Best regards, Sergey.

Reply via email to