<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
      77                 throw new RuntimeException("Banner page is
    printed");<br>
    <br>
    that message needs to be conditionalized too.<br>
    <br>
    -phil<br>
    <br>
    On 9/23/16, 10:01 AM, Prasanta Sadhukhan wrote:
    <blockquote cite="mid:57E55FD4.6050504@oracle.com" type="cite">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      Updated the testcase:<br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
        href="http://cr.openjdk.java.net/%7Epsadhukhan/8165947/webrev.02/">http://cr.openjdk.java.net/~psadhukhan/8165947/webrev.02/</a><br>
      <br>
      Regards<br>
      Prasanta<br>
      <div class="moz-cite-prefix">On 9/23/2016 9:47 PM, Philip Race
        wrote:<br>
      </div>
      <blockquote cite="mid:57E55596.8010307@oracle.com" type="cite">
        <meta content="text/html; charset=UTF-8"
          http-equiv="Content-Type">
        The JDK changes are fine but I don't think the test is.<br>
        It assumes that the system default is no banner page.<br>
        <br>
        You need to update the test to check what the system default is<br>
        (banner or no banner) and have the tester "expect" whatever that
        happens to be.<br>
        <br>
        -phil<br>
        <br>
        On 9/23/16, 8:30 AM, Prasanta Sadhukhan wrote:
        <blockquote cite="mid:57E54A95.2020308@oracle.com" type="cite">
          <meta content="text/html; charset=UTF-8"
            http-equiv="Content-Type">
          Hi Phil,<br>
          <br>
          Please find the modified webrev:<br>
          <a moz-do-not-send="true" class="moz-txt-link-freetext"
            href="http://cr.openjdk.java.net/%7Epsadhukhan/8165947/webrev.01/">http://cr.openjdk.java.net/~psadhukhan/8165947/webrev.01/</a><br>
          <br>
          Regards<br>
          Prasanta<br>
          <div class="moz-cite-prefix">On 9/22/2016 11:10 PM, Prasanta
            Sadhukhan wrote:<br>
          </div>
          <blockquote cite="mid:57E41789.4080403@oracle.com" type="cite">
            <meta content="text/html; charset=UTF-8"
              http-equiv="Content-Type">
            <br>
            <br>
            <div class="moz-cite-prefix">On 9/22/2016 11:09 PM, Philip
              Race wrote:<br>
            </div>
            <blockquote cite="mid:57E4173C.7010900@oracle.com"
              type="cite">
              <meta content="text/html; charset=UTF-8"
                http-equiv="Content-Type">
              OK I see now. <br>
              The comment should be updated to remove mention of the
              dialog<br>
              and explain that instead.<br>
              <br>
              But in that case do you still need the "else" in
              setAttributes?<br>
              <br>
            </blockquote>
            Yes, right. we do not need the else in setAttributes. will
            update that and comment and publish new webrev.<br>
            <br>
            Regards<br>
            Prasanta<br>
            <blockquote cite="mid:57E4173C.7010900@oracle.com"
              type="cite"> -phil.<br>
              <br>
              <br>
              On 9/22/16, 10:32 AM, Prasanta Sadhukhan wrote:
              <blockquote cite="mid:57E41599.9070808@oracle.com"
                type="cite">
                <meta content="text/html; charset=UTF-8"
                  http-equiv="Content-Type">
                <br>
                <br>
                <div class="moz-cite-prefix">On 9/22/2016 10:59 PM,
                  Philip Race wrote:<br>
                </div>
                <blockquote cite="mid:57E414F2.6090202@oracle.com"
                  type="cite">
                  <meta content="text/html; charset=UTF-8"
                    http-equiv="Content-Type">
                  Your comment refers only  (and explicitly) to the
                  print dialog :-<br>
                  <meta http-equiv="content-type" content="text/html;
                    charset=UTF-8">
                  <pre>1484          * printing Banner page through print dialog via setAttributes().</pre>
                  So if we get into that code afterwards why do we need
                  this new code ?<br>
                  <br>
                </blockquote>
                The new code is needed because if we have null
                attributes, then setAttributes() will return <br>
                <pre>1177         if (attributes == null  || service == null) {
1178             return;
1179         }</pre>
                even before it reaches<br>
                <br>
                1271         JobSheets jobSheets =
                (JobSheets)attributes.get(JobSheets.class); <br>
                1272         if (jobSheets != null) { <br>
                1273             noJobSheet = jobSheets ==
                JobSheets.NONE; <br>
                1274         } else { <br>
                1275             JobSheets js =
                (JobSheets)getPrintService(). <br>
                1276 getDefaultAttributeValue(JobSheets.class); <br>
                1277             if (js != null &&
                js.equals(JobSheets.NONE)) { <br>
                1278                 noJobSheet = true; <br>
                1279             } <br>
                1280         } <br>
                <br>
                Regards<br>
                Prasanta<br>
                <blockquote cite="mid:57E414F2.6090202@oracle.com"
                  type="cite"> I do see that call to setAttributes() but
                  I am assuming it does not<br>
                  get in there, else why does it not work already for
                  this case?<br>
                  It looks identical to your new code.<br>
                  <br>
                  Put another way I don't see how the bug even manifests
                  if it works as you describe.<br>
                  <br>
                  -phil.<br>
                  <br>
                  On 9/22/16, 10:10 AM, Prasanta Sadhukhan wrote:
                  <blockquote cite="mid:57E41089.1020803@oracle.com"
                    type="cite">That's why I call the new code before
                    setAttributes() so that user's selection is not
                    overridden. I put a comment regarding that in the
                    fix. <br>
                    <br>
                    Regards <br>
                    Prasanta <br>
                    On 9/22/2016 10:38 PM, Philip Race wrote: <br>
                    <blockquote type="cite">What happens if the
                      application does not display a dialog but <br>
                      instead the application code explicitly does this:
                      <br>
                      <br>
                      aset.add(JobSheets.STANDARD); <br>
                      print(aset) <br>
                      <br>
                      ? <br>
                      <br>
                      It appears to me you will over-ride that. <br>
                      <br>
                      -phil. <br>
                      <br>
                      On 9/22/16, 9:54 AM, Prasanta Sadhukhan wrote: <br>
                      <blockquote type="cite">Hi Phil, <br>
                        <br>
                        My new code takes care of the problem when
                        attribute is not set by the user who directly
                        calls PrinterJob.print(). If no print dialog is
                        shown, then print(attr) seems to be called with
                        Null attribute <br>
                        and since noJobSheet was false, it used to print
                        the banner page. <br>
                        I now checked only the
                        PrintService.getDefaultAttributeValue(JobSheets.class)
                        and if IPP returns "none",  I change the default
                        noJobSheet to true so that no banner page is
                        printed (to honor system default). <br>
                        <br>
                        Regards <br>
                        Prasanta <br>
                        On 9/22/2016 10:16 PM, Philip Race wrote: <br>
                        <blockquote type="cite">This looks wrong to me.
                          Shouldn't the logic look like the one you have
                          earlier in <br>
                          the file ? ie this : <br>
                          <br>
                          1271         JobSheets jobSheets =
                          (JobSheets)attributes.get(JobSheets.class); <br>
                          1272         if (jobSheets != null) { <br>
                          1273             noJobSheet = jobSheets ==
                          JobSheets.NONE; <br>
                          1274         } else { <br>
                          1275             JobSheets js =
                          (JobSheets)getPrintService(). <br>
                          1276
                          getDefaultAttributeValue(JobSheets.class); <br>
                          1277             if (js != null &&
                          js.equals(JobSheets.NONE)) { <br>
                          1278                 noJobSheet = true; <br>
                          1279             } <br>
                          1280         } <br>
                          <br>
                          As it is your new code seems to completely
                          disregard any setting by <br>
                          the application in the attribute set - which
                          *does not* have anything to do with <br>
                          whether a dialog was set. <br>
                          <br>
                          Also I reject that this can be a TCK failure.
                          <br>
                          "I got a banner page" is something that can be
                          a system configuration <br>
                          parameter and is wholly outside anything JCK
                          can (or should) care about. <br>
                          You could fix this but it could then behave
                          the same on a different system. <br>
                          In fact my reading of the bug is simply that
                          they noticed this when running <br>
                          a TCK test. That does not make it a TCK
                          failure. <br>
                          I have removed the tck labels from the bug and
                          JCK can argue with me if they want to .. <br>
                          <br>
                          -phil. <br>
                          <br>
                          On 9/16/16, 3:21 AM, Prasanta Sadhukhan wrote:
                          <br>
                          <blockquote type="cite">Hi All, <br>
                            <br>
                            Please review a fix for a tck failure in
                            jdk9 whereby "banner page" (cover page) is
                            printed by default when print() is called
                            directly without any print dialog being
                            shown. <br>
                            <br>
                            Bug: <a moz-do-not-send="true"
                              class="moz-txt-link-freetext"
                              href="https://bugs.openjdk.java.net/browse/JDK-8165947">https://bugs.openjdk.java.net/browse/JDK-8165947</a>
                            <br>
                            webrev: <a moz-do-not-send="true"
                              class="moz-txt-link-freetext"
                              href="http://cr.openjdk.java.net/%7Epsadhukhan/8165947/webrev.00/">http://cr.openjdk.java.net/~psadhukhan/8165947/webrev.00/</a>
                            <br>
                            <br>
                            Issue was in RasterPrinterJob, "noJobSheet"
                            variable was set to false which when passed
                            to PSPrinterJob#printExecCmd(), it results
                            in adding "-o job-sheets=standard" to lpr
                            command and <br>
                            therefore, Banner page was getting printed
                            by default. <br>
                            Proposed fix is to check for
                            defaultAttributeValue for JobSheets
                            attribute so that we can find what is the
                            default value reported by underlying
                            platform and set "noJobSheet" value to
                            default jobsheet native value <br>
                            (like CUPS report job-sheet=none so that no
                            banner page is to be printed by default even
                            though it supports jobsheet) <br>
                            <br>
                            I tested "6575247:Banner checkbox in
                            PrinterJob print dialog doesn't work"
                            testcase in windows, solaris, linux and it
                            works as expected. <br>
                            <br>
                            JCK test
                            api/javax_swing/interactive/PrintTest.html#PrintTest
                            via command <br>
                            "/jdk-9/bin/java -showversion
                            -Dswing.defaultlaf=com.sun.java.swing.plaf.motif.MotifLookAndFeel
                            -cp /root/jck/JCK-runtime-9/classes:
                            -Djava.security.policy=/root/jck/JCK-runtime-9/lib/jck.policy
                            javasoft.sqe.tests.api.java.awt.interactive.PrintTest





                            -platform.hasPrinter true -TestCaseID ALL" <br>
                            also works ie no banner page is printed by
                            default. <br>
                            <br>
                            Regards <br>
                            Prasanta <br>
                          </blockquote>
                        </blockquote>
                        <br>
                      </blockquote>
                    </blockquote>
                    <br>
                  </blockquote>
                </blockquote>
                <br>
              </blockquote>
            </blockquote>
            <br>
          </blockquote>
          <br>
        </blockquote>
      </blockquote>
      <br>
    </blockquote>
  </body>
</html>