[OpenJDK 2D-Dev] JDK-8013810: UnixPrintServiceLookup not returning consistent values

Patrick Reinhart patrick at reini.net
Wed May 8 07:48:14 UTC 2013


Hi Phil,

Sorry, I can not share your point of the methods getNamedPrinterNameXX() 
always returning a UnixPrintService though. That is exactly the point of 
inconsistency shown by the test case. As far as I checked it the only 
referred places of those getNamedPrinterNameXX() is exactly the 
getServiceByName() method mentioned to place the fix.

In my opinion those method names are misleading anyway. They both called 
getNamedPrinterNameXX() even though they return a PrintService. As I 
assume that they originally did return the active printer name and the 
PrintService was created outside, as the usage of the 
getAllPrinterNamesXX() methods - that are called when creating all 
PrintService instances. You explained me before that in case of hundreds 
of printers it's faster to just lookup the printer state of one printer 
only - which is done within the getNamedPrinterNameXX()  methods.

Patrick


Am 08.05.13 01:38, schrieb Phil Race:
> I am assuming this  current webrev replaced the previous
> one:- http://reinharts.dyndns.org/webrev/
>
> getNamedPrinterNameSysV() and
>
> getNamedPrinterNameBSD()
>
> should not be changed as they should always
> create a UnixPrintService and so can do this
> directly. You are subverting the code in
> there to first check for CUPS which shouldn't
> be needed.
>
>
> I haven' t tested this out but from inspection,
> I think the problem is in getServiceByName() where
> it is ignorant of the CUPS possibility.
> It needs to have the isCUPSRunning() check and
> if so create an IPPPrintService().
>
> So that's where you should place your call.
>
> That is likely the only change here that is really necessary.
> The refactoring is OK but but not essential to the fix.
>
> -phil.
>
> On 5/7/2013 2:23 AM, Patrick Reinhart wrote:
>> Hi Jennifer,
>>
>> I have changed the test to not use non internal packages now that 
>> produces the same results for my case now.
>>
>> Now I still waiting for the feedback of Phil to get that fixed 
>> correctly..
>>
>> Best regards
>>
>> Patirck
>>
>> Quoting Jennifer Godinez <jennifer.godinez at oracle.com>:
>>
>>> Yes I have and dicussed with Phil.  It looks pretty good but there 
>>> may be a safer way to fix it since the fix is still using lpc/lpstat 
>>> commands for CUPS.  Also, the regression test should be modified to 
>>> use non internal package. Phil will give his input on this too.
>>>
>>> Jennifer
>>
>




More information about the 2d-dev mailing list