<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Phil,<br>
<br>
Please review a print service fix for jdk9<br>
<br>
Bug: <a class="moz-txt-link-freetext" href="https://bugs.openjdk.java.net/browse/JDK-8034239">https://bugs.openjdk.java.net/browse/JDK-8034239</a><br>
webrev: <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~psadhukhan/8034239/webrev.00/">http://cr.openjdk.java.net/~psadhukhan/8034239/webrev.00/</a><br>
<br>
The issue was lpstat -v was reporting 2 printer service but
PrintServiceLookup.lookupPrintServices() list only 1. <br>
#lpstat -v
<br>
device for tta_printer: <a
href="ipp://st-tta-adc-02.us.oracle.com/printers/tta_printer">ipp://<internal-printer-ip>/printers/tta_printer</a>
<br>
device for Xerox-WorkCentre-4250: <a
href="socket://spb04p12.ru.oracle.com:9100">socket://spb04p12.ru.oracle.com:9100</a><br>
<br>
but lookupPrintServices() listed only "Xerox" printer and not
"tta_printer". <br>
<br>
It seems "tta_printer" was added using <br>
<pre><b>lpadmin -p <var>printer-name</var> -E -v <var>device</var> -m ppd
</b></pre>
so it becomes a "Remote Printer" and even though Java sees that
printer, it calls getUnsupportedAttributes() on that printer service
to see if that printer matches the DocFlavor. <br>
In this case, this remote printer does not have any supported doc
flavor listed so when getSupportedDocFlavors() is called, it does
not see any "document-format-supported" attribute.<br>
Although JDK-8040139 fixed this problem by adding <br>
<pre class="sourcelines wrap"><span id="l1.9" class="plusline">DocFlavor.SERVICE_FORMATTED.PAGEABLE and </span><span id="l1.10" class="plusline">DocFlavor.SERVICE_FORMATTED.PRINTABLE
</span><span id="l1.10" class="plusline"></span></pre>
to the supported DocFlavors since as per spec, <br>
as per spec<br>
<i><a moz-do-not-send="true" class="moz-txt-link-freetext"
href="https://docs.oracle.com/javase/8/docs/api/index.html?javax/print/PrintService.html">https://docs.oracle.com/javase/8/docs/api/index.html?javax/print/PrintService.html</a></i><i><br>
</i><i>it clearly says, </i><br>
getSupportedDocFlavors()
<dl>
<dt><i><span class="returnLabel">Returns:</span></i></dt>
<dd><i>Array of supported doc flavors, should have at least one
element.</i></dd>
</dl>
<br>
the returned flavours are not populated to supported DocFlavors
called by IPPPrintService.java#getUnsupportedAttributes() ->
isDocFlavorSupported() so "supportedDocFlavors" was still false for
this case.<br>
<br>
I added a fix to populate the PAGEABLE & PRINTABLE docflavor to
"supportedDocFlavors" and tested in sqe machine and found it
working.<br>
<br>
I could not add a regression testcase as it involves adding a
"remote printer" using lpadmin command. I would add "noreg-sqe" to
the bug.<br>
<br>
Regards<br>
Prasanta<br>
<br>
<pre class="sourcelines wrap"><span id="l1.10" class="plusline"></span></pre>
</body>
</html>