[8u] 8222108: Reduce minRefreshTime for updating remote printer list on Windows

Zhengyu Gu zgu at redhat.com
Tue Sep 3 12:56:57 UTC 2019



On 9/3/19 1:12 AM, Andrew John Hughes wrote:
> 
> 
> On 27/08/2019 14:39, Zhengyu Gu wrote:
>>
>> I would like to backport this patch to 8u, as it is in Oracle's 8u.
>>
>> The patch does not apply cleanly. In early backports, there were
>> conflicts and we kept 8u code in old styles.
>>
>> E.g. RemotePrinterChangeListener still inherits from Thread, instead of
>> implementing Runnable in new code.
>>
>> Original bug: https://bugs.openjdk.java.net/browse/JDK-8222108
>> Original code review threads:
>> Code review threads:
>> http://mail.openjdk.java.net/pipermail/2d-dev/2019-June/010153.html
>> http://mail.openjdk.java.net/pipermail/2d-dev/2019-July/010169.html
>> http://mail.openjdk.java.net/pipermail/2d-dev/2019-August/010235.html
>>
>> 8u Webrev: http://cr.openjdk.java.net/~zgu/JDK-8222108-8u/webrev.00/
>>
>> Thanks,
>>
>> -Zhengyu
> 
> This mostly looks ok, but one change seems to have been missed; the
> prevRemotePrinters variable is not removed. Was there a reason for this?

My bad.

Updated: http://cr.openjdk.java.net/~zgu/JDK-8222108-8u/webrev.01/

Retested on Windows x86_64

Thanks,

-Zhengyu

> 
> Moreover, it seems the constructor body, which uses prevRemotePrinters,
> was not removed as part of backporting JDK-8221412.
> 
> --- 8222108.11u	2019-09-03 05:59:15.876734203 +0100
> +++ 8222108.8u	2019-08-27 13:48:07.000000000 +0100
> -@@ -398,60 +400,38 @@
> +@@ -394,61 +396,40 @@
>           count of printer status changes(add\remove) and based on it
> update the printers
>           list.
>        */
> --    class RemotePrinterChangeListener implements Runnable {
> --        private String[] prevRemotePrinters;
> -+    class RemotePrinterChangeListener implements Comparator<String>,
> Runnable {
> +-    class RemotePrinterChangeListener extends Thread {
> ++    class RemotePrinterChangeListener extends Thread implements
> Comparator<String>{
> +         private String[] prevRemotePrinters;
> 
>            RemotePrinterChangeListener() {
> +             prevRemotePrinters = getRemotePrintersNames();
>            }
> 
>   -        private boolean doCompare(String[] str1, String[] str2) {
> 


More information about the jdk8u-dev mailing list