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

Andrew John Hughes gnu.andrew at redhat.com
Tue Sep 3 05:12:19 UTC 2019



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?

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) {

-- 
Andrew :)

Senior Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222
https://keybase.io/gnu_andrew



More information about the jdk8u-dev mailing list