Hi All,
Please review a fix for jdk9
Bug: https://bugs.openjdk.java.net/browse/JDK-8040139
webrev: http://cr.openjdk.java.net/~jdv/prasanta/8040139/webrev.00/
It seems if a IPP printer is not accessible,
PrintServiceLookup.lookupPrintServices will return the printer service
but PrintService.getSupportedDocFlavors() will return null
since for the printer there is no way to answer the questions as to what
it supports and if after that someone tries to access flavors.length it
will cause NPE.
However, as per spec
/https://docs.oracle.com/javase/8/docs/api/index.html?javax/print/PrintService.html//
//it clearly says, //
/
/Returns:/
/Array of supported doc flavors, should have at least one element./
so returning null is a violation of spec.
I have added a fix to return DocService.SERVICE_FORMATTED flavor for
such case.
Could not add a reg testcase as it will need an inaccessible printer.
Regards
Prasanta