<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Not sure about the exact meaning of that but anyways tried to
      make the code spec-compliant.<br>
    </p>
    <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~psadhukhan/7042497/webrev.03/">http://cr.openjdk.java.net/~psadhukhan/7042497/webrev.03/</a><br>
    <br>
    If you think it still does not adhere to spec, please suggest what
    more needs to be done.<br>
    <br>
    Regards<br>
    Prasanta<br>
    <div class="moz-cite-prefix">On 5/17/2017 8:23 PM, Semyon Sadetsky
      wrote:<br>
    </div>
    <blockquote
      cite="mid:982a8e07-7f1d-3902-a6b4-4284456b069f@oracle.com"
      type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      <p>
        <meta http-equiv="content-type" content="text/html;
          charset=utf-8">
      </p>
      It seems, !(parentComponent instanceof Frame)) is not what the
      spec means.<br>
      <br>
      --Semyon<br>
      <br>
      <div class="moz-cite-prefix">On 05/17/2017 12:55 AM, Prasanta
        Sadhukhan wrote:<br>
      </div>
      <blockquote
        cite="mid:0f9b7bd7-8705-b9a6-6ee8-d7d4154b196f@oracle.com"
        type="cite">
        <meta content="text/html; charset=utf-8"
          http-equiv="Content-Type">
        Ok, sorry. Updated code to get the default Frame when component
        has no Frame and <br>
        testcase to test that case too.<br>
        Updated webrev<br>
        <a moz-do-not-send="true" class="moz-txt-link-freetext"
          href="http://cr.openjdk.java.net/%7Epsadhukhan/7042497/webrev.02/">http://cr.openjdk.java.net/~psadhukhan/7042497/webrev.02/</a><br>
        <br>
        Regards<br>
        Prasanta<br>
        <div class="moz-cite-prefix">On 5/16/2017 8:47 PM, Semyon
          Sadetsky wrote:<br>
        </div>
        <blockquote
          cite="mid:a1efbd5c-c48b-c867-65b8-51bd9f5edce3@oracle.com"
          type="cite">
          <meta content="text/html; charset=utf-8"
            http-equiv="Content-Type">
          <p>Yes, sorry. I meant the case I've mentioned in my first
            comment : when the component has no frame.</p>
          <p>
            <meta http-equiv="content-type" content="text/html;
              charset=utf-8">
          </p>
          <pre style="background-color:#ffffff;color:#000000;font-family:'Source Code Pro';font-size:10.5pt;"><span style="color:#543246;font-weight:bold;font-style:italic;">parentComponent </span><span style="color:#2f354d;font-style:italic;">determines the </span><span style="color:#6d631f;font-style:italic;"><code></span><span style="color:#2f354d;font-style:italic;">Frame</span><span style="color:#6d631f;font-style:italic;"></code>
</span><span style="color:#2f354d;font-style:italic;">*          in which the dialog is displayed; if </span><span style="color:#6d631f;font-style:italic;"><code></span><span style="color:#2f354d;font-style:italic;">null</span><span style="color:#6d631f;font-style:italic;"></code></span><span style="color:#2f354d;font-style:italic;">,
</span><span style="color:#2f354d;font-style:italic;">*          <b><u>or if the </u></b></span><b><u><span style="color:#6d631f;font-style:italic;"><code></span></u></b><b><u><span style="color:#2f354d;font-style:italic;">parentComponent</span></u></b><b><u><span style="color:#6d631f;font-style:italic;"></code> </span></u></b><b><u><span style="color:#2f354d;font-style:italic;">has no
</span></u></b><b><u><span style="color:#2f354d;font-style:italic;">*          </span></u></b><b><u><span style="color:#6d631f;font-style:italic;"><code></span></u></b><b><u><span style="color:#2f354d;font-style:italic;">Frame</span></u></b><b><u><span style="color:#6d631f;font-style:italic;"></code></span></u></b><span style="color:#2f354d;font-style:italic;"><b><u>***</u></b>, a default </span><span style="color:#6d631f;font-style:italic;"><code></span><span style="color:#2f354d;font-style:italic;">Frame</span><span style="color:#6d631f;font-style:italic;"></code> </span><span style="color:#2f354d;font-style:italic;">is used</span></pre>
          <br>
          --Semyon<br>
          <br>
          <div class="moz-cite-prefix">On 05/15/2017 10:44 PM, Prasanta
            Sadhukhan wrote:<br>
          </div>
          <blockquote
            cite="mid:cda0c73a-c8ca-e915-d798-8af28bb1b214@oracle.com"
            type="cite">
            <meta content="text/html; charset=utf-8"
              http-equiv="Content-Type">
            <p>Not sure which testcase you are running. I do not see
              this exception when I run my testcase in the webrev. <br>
            </p>
            <p>I am using createDialog in the fix for null
              parentComponent and not createInternalFrame() which throws
              this exception.<br>
            </p>
            Regards<br>
            Prasanta<br>
            <div class="moz-cite-prefix">On 5/15/2017 11:04 PM, Semyon
              Sadetsky wrote:<br>
            </div>
            <blockquote
              cite="mid:7ba29b9d-3533-b7d1-625e-7059bc68eb70@oracle.com"
              type="cite">
              <meta content="text/html; charset=utf-8"
                http-equiv="Content-Type">
              <p>I don't see how this change fixes the issue.</p>
              <p>I still got</p>
              <p>Exception in thread "main" java.lang.RuntimeException:
                JOptionPane: parentComponent does not have a valid
                parent</p>
              <p>after applying it.<br>
              </p>
              <p>--Semyon<br>
              </p>
              <br>
              <div class="moz-cite-prefix">On 05/15/2017 03:14 AM,
                Prasanta Sadhukhan wrote:<br>
              </div>
              <blockquote
                cite="mid:c9c8cf6b-4030-6426-313e-bfb3790ad14c@oracle.com"
                type="cite">
                <meta content="text/html; charset=utf-8"
                  http-equiv="Content-Type">
                <p>Updated webrev to use getRootFrame() via
                  createDialog() to get the default Frame when a frame
                  is not provided.<br>
                </p>
                <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://cr.openjdk.java.net/%7Epsadhukhan/7042497/webrev.01/">http://cr.openjdk.java.net/~psadhukhan/7042497/webrev.01/</a><br>
                <br>
                Regards<br>
                Prasanta<br>
                <div class="moz-cite-prefix">On 5/12/2017 8:08 PM,
                  Semyon Sadetsky wrote:<br>
                </div>
                <blockquote
                  cite="mid:4c07ec59-fa8e-0549-d815-3db6aeb3af99@oracle.com"
                  type="cite">
                  <meta content="text/html; charset=utf-8"
                    http-equiv="Content-Type">
                  <p>Also the spec says to use the default frame but the
                    fix creates new frame each time. <br>
                  </p>
                  <br>
                  <div class="moz-cite-prefix">On 05/12/2017 07:32 AM,
                    Semyon Sadetsky wrote:<br>
                  </div>
                  <blockquote
                    cite="mid:65e0a26f-db9b-735a-d52e-284f15e60abe@oracle.com"
                    type="cite">
                    <meta content="text/html; charset=utf-8"
                      http-equiv="Content-Type">
                    <p>The fix covers the parentComponent=null case.<br>
                    </p>
                    <p>What about the second case when non-null
                      component is provided but it has no frame?</p>
                    <p>--Semyon<br>
                    </p>
                    <br>
                    <div class="moz-cite-prefix">On 05/12/2017 12:51 AM,
                      Prasanta Sadhukhan wrote:<br>
                    </div>
                    <blockquote
                      cite="mid:ba1c5b09-6a54-7c8a-9338-500262e081bb@oracle.com"
                      type="cite">
                      <meta http-equiv="content-type"
                        content="text/html; charset=utf-8">
                      <p>Hi All,</p>
                      Please review a spec violation issue whereby if in
                      JOptionPane.showInternalConfirmDialog(Component
                      parentComponent, Object message)<br>
                      "parentComponent" is null, we are getting
                      RuntimeException "parentComponent does not have a
                      valid parent"<br>
                      <br>
                      but as per spec, <a moz-do-not-send="true"
                        class="moz-txt-link-freetext"
href="https://docs.oracle.com/javase/8/docs/api/index.html?javax/swing/JOptionPane.html">https://docs.oracle.com/javase/8/docs/api/index.html?javax/swing/JOptionPane.html</a><br>
                      it says "<code>parentComponent</code> - determines
                      the <code>Frame</code> in which the dialog is
                      displayed; if <code>null</code>, or if the <code>parentComponent</code>
                      has no <code>Frame</code>, a default <code>Frame</code>
                      is used"<br>
                      <br>
                      This violation exists for all overridden
                      showInternalConfirmDialog methods and
                      showInternalOptionDialog.<br>
                      <br>
                      The proposed fix creates a default JFrame and
                      shows the confirm dialog in it, as stated in the
                      spec.<br>
                      <br>
                      Bug: <a moz-do-not-send="true"
                        class="moz-txt-link-freetext"
                        href="https://bugs.openjdk.java.net/browse/JDK-7042497">https://bugs.openjdk.java.net/browse/JDK-7042497</a><br>
                      webrev: <a moz-do-not-send="true"
                        class="moz-txt-link-freetext"
                        href="http://cr.openjdk.java.net/%7Epsadhukhan/7042497/webrev.00/">http://cr.openjdk.java.net/~psadhukhan/7042497/webrev.00/</a><br>
                      <br>
                      Regards<br>
                      Prasanta </blockquote>
                    <br>
                  </blockquote>
                  <br>
                </blockquote>
                <br>
              </blockquote>
              <br>
            </blockquote>
            <br>
          </blockquote>
          <br>
        </blockquote>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>