[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-2d-dev
Subject: Re: [OpenJDK 2D-Dev] [9] RFR JDK-8034239, , PrintServiceLookup.lookupPrintServices() returns differe
From: Jennifer Godinez <jennifer.godinez () oracle ! com>
Date: 2016-03-08 17:59:52
Message-ID: 56DF1318.1060200 () oracle ! com
[Download RAW message or body]
Hi Prasanta,
Looks good.
Jennifer
On 03/08/2016 02:26 AM, prasanta sadhukhan wrote:
> Hi Phil,
>
> It's my mistake. There's no need to copy as we are not passing the
> supportedDocFlavors outside the class. I was influenced by the lines
> before this where copyFlavors was copied from supportedDocFlavors.
> Please find the updated webrev:
> http://cr.openjdk.java.net/~psadhukhan/8034239/webrev.02/
>
> Regards
> Prasanta
> On 3/8/2016 1:58 AM, Phil Race wrote:
>> Why do the copy ? Why not just add one line
>>
>> supportedDocFlavors = flavor
>>
>> -phil.
>>
>> On 03/07/2016 03:20 AM, prasanta sadhukhan wrote:
>>> Hi Phil,
>>>
>>> Please find the updated webrev:
>>> http://cr.openjdk.java.net/~psadhukhan/8034239/webrev.01/
>>>
>>> I checked JDK-8040139 also passed with this modification.
>>>
>>> Regards
>>> Prasanya
>>> On 3/5/2016 1:14 AM, Phil Race wrote:
>>>> if the class is supposed to use the return value in this way what
>>>> about these lines :-
>>>>
>>>> 1209
>>>> 1210 public boolean isIPPSupportedImages(String mimeType) {
>>>> 1211 if (supportedDocFlavors == null) {
>>>> 1212 getSupportedDocFlavors();
>>>> 1213 }
>>>>
>>>> It looks to me as if what you should really be doing is modifying
>>>> the last few lines of getSupportedDocFlavors() as you are using
>>>> the return value to update the variable which it should have
>>>> assigned itself.
>>>>
>>>> -phil
>>>>
>>>>
>>>>
>>>> On 03/04/2016 02:48 AM, prasanta sadhukhan wrote:
>>>>> Hi Phil,
>>>>>
>>>>> Please review a print service fix for jdk9
>>>>>
>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8034239
>>>>> webrev: http://cr.openjdk.java.net/~psadhukhan/8034239/webrev.00/
>>>>>
>>>>> The issue was lpstat -v was reporting 2 printer service but
>>>>> PrintServiceLookup.lookupPrintServices() list only 1.
>>>>> #lpstat -v
>>>>> device for tta_printer:
>>>>> ipp://<internal-printer-ip>/printers/tta_printer
>>>>> <ipp://st-tta-adc-02.us.oracle.com/printers/tta_printer>
>>>>> device for Xerox-WorkCentre-4250: socket://spb04p12.ru.oracle.com:9100
>>>>>
>>>>> but lookupPrintServices() listed only "Xerox" printer and not
>>>>> "tta_printer".
>>>>>
>>>>> It seems "tta_printer" was added using
>>>>> *lpadmin -pprinter-name -E -vdevice -m ppd
>>>>>
>>>>> *
>>>>> 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.
>>>>> 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.
>>>>> Although JDK-8040139 fixed this problem by adding
>>>>> DocFlavor.SERVICE_FORMATTED.PAGEABLE andDocFlavor.SERVICE_FORMATTED.PRINTABLE
>>>>>
>>>>> to the supported DocFlavors since as per spec,
>>>>> as per spec
>>>>> /https://docs.oracle.com/javase/8/docs/api/index.html?javax/print/PrintService.html//
>>>>> //it clearly says, /
>>>>> getSupportedDocFlavors()
>>>>>
>>>>> /Returns:/
>>>>> /Array of supported doc flavors, should have at least one
>>>>> element./
>>>>>
>>>>>
>>>>> the returned flavours are not populated to supported DocFlavors
>>>>> called by IPPPrintService.java#getUnsupportedAttributes() ->
>>>>> isDocFlavorSupported() so "supportedDocFlavors" was still false
>>>>> for this case.
>>>>>
>>>>> I added a fix to populate the PAGEABLE & PRINTABLE docflavor to
>>>>> "supportedDocFlavors" and tested in sqe machine and found it working.
>>>>>
>>>>> 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.
>>>>>
>>>>> Regards
>>>>> Prasanta
>>>>>
>>>>
>>>
>>
>
[Attachment #3 (text/html)]
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Prasanta,<br>
<br>
Looks good.<br>
<br>
Jennifer<br>
<div class="moz-cite-prefix">On 03/08/2016 02:26 AM, prasanta
sadhukhan wrote:<br>
</div>
<blockquote cite="mid:56DEA8E6.7000708@oracle.com" type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
Hi Phil,<br>
<br>
It's my mistake. There's no need to copy as we are not passing the
supportedDocFlavors outside the class. I was influenced by the
lines before this where copyFlavors was copied from
supportedDocFlavors.<br>
Please find the updated webrev:<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://cr.openjdk.java.net/%7Epsadhukhan/8034239/webrev.02/">http://cr.openjdk.java.net/~psadhukhan/8034239/webrev.02/</a><br>
<br>
Regards<br>
Prasanta<br>
<div class="moz-cite-prefix">On 3/8/2016 1:58 AM, Phil Race wrote:<br>
</div>
<blockquote cite="mid:56DDE458.6010605@oracle.com" type="cite">
<meta content="text/html; charset=UTF-8"
http-equiv="Content-Type">
<div class="moz-cite-prefix">Why do the copy ? Why not just add
one line<br>
<br>
supportedDocFlavors = flavor <br>
<br>
-phil.<br>
<br>
On 03/07/2016 03:20 AM, prasanta sadhukhan wrote:<br>
</div>
<blockquote cite="mid:56DD6401.2060907@oracle.com" type="cite">
<meta content="text/html; charset=UTF-8"
http-equiv="Content-Type">
Hi Phil,<br>
<br>
Please find the updated webrev:<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://cr.openjdk.java.net/%7Epsadhukhan/8034239/webrev.01/">http://cr.openjdk.java.net/~psadhukhan/8034239/webrev.01/</a><br>
<br>
I checked JDK-8040139 also passed with this modification.<br>
<br>
Regards<br>
Prasanya<br>
<div class="moz-cite-prefix">On 3/5/2016 1:14 AM, Phil Race
wrote:<br>
</div>
<blockquote cite="mid:56D9E59F.4040006@oracle.com" type="cite">
<meta content="text/html; charset=UTF-8"
http-equiv="Content-Type">
<div class="moz-cite-prefix">if the class is supposed to use
the return value in this way what about these lines :-<br>
<br>
<pre>1209
1210 public boolean isIPPSupportedImages(String mimeType) {
1211 if (supportedDocFlavors == null) {
1212 getSupportedDocFlavors();
1213 }
It looks to me as if what you should really be doing is modifying
the last few lines of getSupportedDocFlavors() as you are using
the return value to update the variable which it should have
assigned itself.
-phil
</pre>
<br>
On 03/04/2016 02:48 AM, prasanta sadhukhan wrote:<br>
</div>
<blockquote cite="mid:56D967E0.3030903@oracle.com"
type="cite">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
Hi Phil,<br>
<br>
Please review a print service fix for jdk9<br>
<br>
Bug: <a moz-do-not-send="true"
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 moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://cr.openjdk.java.net/%7Epsadhukhan/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 moz-do-not-send="true"
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
moz-do-not-send="true"
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.ht \
ml">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> </blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic