<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <pre>
<span class="new"><span class="new">+        private static final long DELAY = 1000 * 60 * 4; // 4 min pooling

I think we need a System Property that can control this.
I suggest the name "</span></span><span class="new"><span class="new">sun.java2d.print.minRefreshTime"</span> which is what we use on Unix.

and similarly to there we should have "sun.java2d.print.polling" which is a boolean
and controls whether we do this at all ..

See src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java

Lots of places where you are missing a space before "("

+            if(str1.length != str2.length) {</span></pre>
    <pre><span class="new">+                for(int i = 0;i < str1.length;i++) {
</span><span class="new">+                    for(int j = 0;j < str2.length;j++) {
</span><span class="new">+                        if(!str1[i].equals(str2[j])) {
</span>
<span class="new">+            while(true) {
</span><span class="new">+                if(doCompare(prevRemotePrinters, currentRemotePrinters)) {


There's some of that in native too</span>
<span class="new"><span class="new"> 266                 if(info4->Attributes & 0x00000010) {</span>

In <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~sveerabhadra/8153732/webrev.01/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp.sdiff.html">http://cr.openjdk.java.net/~sveerabhadra/8153732/webrev.01/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp.sdiff.html</a>

you seem to have moved all the existing and (I think) unchanged related functions so the DIFF appears
much bigger than it really is. Please move them back and re-generate.

The test really needs to provide an "out" for someone running the test who has no way
to add a network printer .. they don't want to have to fail the test.

As well as that, arguably this should be an @ignore test, so it is not run unless
you are trying to run all the tests.

-phil.
</span></pre>
    <div class="moz-cite-prefix">On 06/21/2018 12:08 PM, Shashidhara
      Veerabhadraiah wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:86134fcd-e550-4e5b-aa65-8e79b4e3f6ff@default">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:PMingLiU;
        panose-1:2 1 6 1 0 1 1 1 1 1;}
@font-face
        {font-family:Tunga;
        panose-1:0 0 4 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@PMingLiU";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Hi Phil, Here
            is the new Webrev. I chose 4 mins because I think it takes
            around 2 mins to add a new network printer, hence I felt 4
            mins is a good time.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">The windows *<b>PrinterChangeNotifications</b>*
            calls are a blocking function calls hence I could not add
            the remote printers monitor to the existing thread. Hence
            there is a new thread being added to listen to remote
            printers status changes.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><a
              href="http://cr.openjdk.java.net/%7Esveerabhadra/8153732/webrev.01/"
              moz-do-not-send="true">http://cr.openjdk.java.net/~sveerabhadra/8153732/webrev.01/</a><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Thanks and
            regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Shashi<o:p></o:p></span></p>
        <p class="MsoNormal"><a name="_MailEndCompose"
            moz-do-not-send="true"><span style="color:#1F497D"><o:p> </o:p></span></a></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span
                style="color:windowtext"> Philip Race <br>
                <b>Sent:</b> Thursday, June 21, 2018 5:38 AM<br>
                <b>To:</b> 2d-dev <a class="moz-txt-link-rfc2396E" href="mailto:2d-dev@openjdk.java.net"><2d-dev@openjdk.java.net></a>;
                Shashidhara Veerabhadraiah
                <a class="moz-txt-link-rfc2396E" href="mailto:shashidhara.veerabhadraiah@oracle.com"><shashidhara.veerabhadraiah@oracle.com></a><br>
                <b>Subject:</b> Fwd: Re: <Swing Dev> [11]
                JDK-8153732: Windows remote printer changes do not
                reflect in lookupPrintServices()<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The main concern I have is we now have a
          busy thread burning CPU ..<br>
          bad for laptops .. and if we add a delay we have less prompt
          notification<br>
          of a new local printer.<br>
          <br>
          I think the compromise is that the existing thread maybe kept
          as is,<br>
          and we add a new thread that pools every 10 minutes for a
          remote printer.<br>
          <br>
          If we can make the existing thread wake up from its wait and
          do that, even better.<br>
          <br>
          -phil.<br>
          <br>
          -------- Original Message -------- <span
            style="font-size:12.0pt"><o:p></o:p></span></p>
        <table class="MsoNormalTable" cellspacing="0" cellpadding="0"
          border="0">
          <tbody>
            <tr>
              <td style="padding:0in 0in 0in 0in" valign="top"
                nowrap="nowrap">
                <p class="MsoNormal" style="text-align:right"
                  align="right"><b>Subject: <o:p></o:p></b></p>
              </td>
              <td style="padding:0in 0in 0in 0in">
                <p class="MsoNormal">Re: [11] JDK-8153732: Windows
                  remote printer changes do not reflect in
                  lookupPrintServices()<o:p></o:p></p>
              </td>
            </tr>
            <tr>
              <td style="padding:0in 0in 0in 0in" valign="top"
                nowrap="nowrap">
                <p class="MsoNormal" style="text-align:right"
                  align="right"><b>Date: <o:p></o:p></b></p>
              </td>
              <td style="padding:0in 0in 0in 0in">
                <p class="MsoNormal">Wed, 20 Jun 2018 17:03:56 -0700<o:p></o:p></p>
              </td>
            </tr>
            <tr>
              <td style="padding:0in 0in 0in 0in" valign="top"
                nowrap="nowrap">
                <p class="MsoNormal" style="text-align:right"
                  align="right"><b>From: <o:p></o:p></b></p>
              </td>
              <td style="padding:0in 0in 0in 0in">
                <p class="MsoNormal">Philip Race <a
                    href="mailto:philip.race@oracle.com"
                    moz-do-not-send="true"><philip.race@oracle.com></a><o:p></o:p></p>
              </td>
            </tr>
            <tr>
              <td style="padding:0in 0in 0in 0in" valign="top"
                nowrap="nowrap">
                <p class="MsoNormal" style="text-align:right"
                  align="right"><b>Organization: <o:p></o:p></b></p>
              </td>
              <td style="padding:0in 0in 0in 0in">
                <p class="MsoNormal">Oracle Corporation<o:p></o:p></p>
              </td>
            </tr>
            <tr>
              <td style="padding:0in 0in 0in 0in" valign="top"
                nowrap="nowrap">
                <p class="MsoNormal" style="text-align:right"
                  align="right"><b>To: <o:p></o:p></b></p>
              </td>
              <td style="padding:0in 0in 0in 0in">
                <p class="MsoNormal">Shashidhara Veerabhadraiah <a
                    href="mailto:shashidhara.veerabhadraiah@oracle.com"
                    moz-do-not-send="true"><shashidhara.veerabhadraiah@oracle.com></a><o:p></o:p></p>
              </td>
            </tr>
            <tr>
              <td style="padding:0in 0in 0in 0in" valign="top"
                nowrap="nowrap">
                <p class="MsoNormal" style="text-align:right"
                  align="right"><b>CC: <o:p></o:p></b></p>
              </td>
              <td style="padding:0in 0in 0in 0in">
                <p class="MsoNormal"><a
                    href="mailto:awt-dev@openjdk.java.net"
                    moz-do-not-send="true">awt-dev@openjdk.java.net</a>,
                  <a href="mailto:swing-dev@openjdk.java.net"
                    moz-do-not-send="true">swing-dev@openjdk.java.net</a><o:p></o:p></p>
              </td>
            </tr>
          </tbody>
        </table>
        <p class="MsoNormal"><br>
          <br>
          This is on the wrong lists. Not Swing. Not AWT. Should be 2d.<br>
          I'll forward it there and continue there. Consider the
          AWT+Swing threads dead.<br>
          <br>
          -phil.<br>
          <br>
          On 6/20/18, 3:12 AM, Shashidhara Veerabhadraiah wrote: <o:p></o:p></p>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal">Hi All, Please review this code changes
            for the below enhancement.<o:p></o:p></p>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal">Enhancement: <a
              href="https://bugs.openjdk.java.net/browse/JDK-8153732"
              moz-do-not-send="true">https://bugs.openjdk.java.net/browse/JDK-8153732</a><o:p></o:p></p>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal">Webrev: <a
              href="http://cr.openjdk.java.net/%7Esveerabhadra/8153732/webrev.00/"
              moz-do-not-send="true">http://cr.openjdk.java.net/~sveerabhadra/8153732/webrev.00/</a><o:p></o:p></p>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal">Details of the changes: Windows provides
            *PrinterChangeNotification* functions that provides
            information about printer status changes of the local
            printers(subset) but not network printers. <br>
            Alternatively, Windows provides a way thro' which one can
            get the network printer status changes by using WMI,
            RegistryKeyChange combination, which is a slightly complex
            mechanism. <br>
            The Windows WMI offers an async and sync method to read
            thro' registry via the WQL query. The async method is
            considered dangerous as it leaves open a channel until we
            close it. But the async method has the advantage of being
            notified of a change in registry by calling callback without
            polling for it. The sync method uses the polling mechanism
            to notify. <br>
            RegistryValueChange cannot be used in combination with WMI
            to get registry value change notification because of an
            error that may be generated because the scope of the query
            would be too big to handle(at times). <br>
            Hence an alternative mechanism is choosen via the
            EnumPrinters by polling for the count of printer status
            changes(add\remove) and based on it update the printers
            list(both local and remote printers - superset).<o:p></o:p></p>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal">Thanks and regards,<o:p></o:p></p>
          <p class="MsoNormal">Shashi<o:p></o:p></p>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>