[OpenJDK 2D-Dev] RFR: Fix for 8032693 : javax.print.PrintService does not find any CUPS-Printers on Linux
philip.race at oracle.com
Fri Feb 7 17:30:18 UTC 2014
2nd reviewer anyone ? FWIW the external submitter of the bug report confirms
this fixes it for him too.
On 2/7/2014 9:00 AM, Jennifer Godinez wrote:
> On 02/06/2014 02:31 PM, Phil Race wrote:
>> This is a fix for https://bugs.openjdk.java.net/browse/JDK-8032693
>> It was introduced by the JDK 8 b115 fix for
>> The root of the issue is that if you do not have a default printer
>> set in CUPS then
>> we get an NPE at line 635 (original file) of
>> UnixPrintServiceLookup.java de-referencing
>> the array returned from CUPSPrinter.getDefaultPrinter().
>> This caused a failure not just locating the default but *any* printer
>> the NPE went all the way back up to javax.print implementation where
>> it calls
>> Really preventing that NPE from happening is all there is to the fix
>> But for good measure I
>> 1) Catch such an exception inside refreshServices() so we can
>> continue on
>> 2) Fix the usage of device-uri (should be printer-uri-supported)
>> 3) Add lots more debugging to make it easier to get to the bottom of
>> future problems.
>> I'm pretty confident in this fix since I was able to reproduce the
>> by updating CUPS so I had no default and this cures it.
>> I've added a regression test as best I can. Unless you have printers,
>> have also no default printer its going to pass regardless.
More information about the 2d-dev