<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hate to be the party pooper :-)</p>
    <p>What happens with method calls?</p>
    <p>class Test { <br>
      public static void main(String[] args) {<br>
      Â Â  Object o = null;<br>
      Â Â  o.<br>
      Â Â Â  toString(); <-- NPE here<br>
      }<br>
      <br>
      }</p>
    <p>So, while at some level I sympathize with the argument of not
      making LNT more bloated, I can't help noting the asymmetry between
      field and method access.</p>
    Maurizio<br>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 20/02/2019 14:20, Remi Forax wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:192583974.778153.1550672445854.JavaMail.zimbra@u-pem.fr">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div style="font-family: arial, helvetica, sans-serif; font-size:
        12pt; color: #000000">
        <div>I don't think you need to bloat the line number table for
          this case because soon the NPE error message will be more
          precise [1].<br data-mce-bogus="1">
        </div>
        <div><br data-mce-bogus="1">
        </div>
        <div>Rémi<br data-mce-bogus="1">
        </div>
        <div><br data-mce-bogus="1">
        </div>
        <div>[1] <a
            href="https://bugs.openjdk.java.net/browse/JDK-8218628"
            data-mce-href="https://bugs.openjdk.java.net/browse/JDK-8218628"
            moz-do-not-send="true">https://bugs.openjdk.java.net/browse/JDK-8218628</a><br
            data-mce-bogus="1">
        </div>
        <div><br>
        </div>
        <hr id="zwchr" data-marker="__DIVIDER__">
        <div data-marker="__HEADERS__">
          <blockquote style="border-left:2px solid
#1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De:
            </b>"Vicente Romero" <a class="moz-txt-link-rfc2396E" href="mailto:vicente.romero@oracle.com"><vicente.romero@oracle.com></a><br>
            <b>À: </b>"Eddie Aftandilian" <a class="moz-txt-link-rfc2396E" href="mailto:eaftan@google.com"><eaftan@google.com></a><br>
            <b>Cc: </b>"compiler-dev"
            <a class="moz-txt-link-rfc2396E" href="mailto:compiler-dev@openjdk.java.net"><compiler-dev@openjdk.java.net></a><br>
            <b>Envoyé: </b>Mercredi 20 Février 2019 14:38:45<br>
            <b>Objet: </b>Re: RFR - JDK-8218650: LineNumberTable
            records for method invocations with arguments<br>
          </blockquote>
        </div>
        <div data-marker="__QUOTED_TEXT__">
          <blockquote style="border-left:2px solid
#1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br>
            <br>
            <div class="moz-cite-prefix">On 2/19/19 8:27 PM, Eddie
              Aftandilian wrote:<br>
            </div>
            <blockquote
cite="mid:CA+7OGVrzuVBe5zr6hyYOdMZ6sU-V4wTAx+MGNC1YPu7ehq2q0Q@mail.gmail.com">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">Hi Vicente,
                    <div><br>
                    </div>
                    <div>Thanks for the reply.  Can I ask why you don't
                      think the LNT should contain entries for accesses
                      to fields?  It seems that results in incorrect
                      line numbers in certain cases.  For example,
                      consider the following code:</div>
                    <div><br>
                    </div>
                    <div>1: class LineNumbers {<br>
                    </div>
                    <div>
                      <div>2: </div>
                      <div>3:  Â static class T {</div>
                      <div>4:  Â  Â boolean b;</div>
                      <div>5:  Â }</div>
                      <div>6: </div>
                      <div>7:  Â static void doIt(boolean... values) {}</div>
                      <div>8: </div>
                      <div>9:  Â public static void main(String[] args) {</div>
                      <div>10:  Â  Â T a = new T();</div>
                      <div>11:  Â  Â T b = null;</div>
                      <div>12:</div>
                      <div>13:  Â  Â doIt(</div>
                      <div>14:  Â  Â  Â  Â a.b,</div>
                      <div>15:  Â  Â  Â  Â b.b);</div>
                      <div>16:  Â }</div>
                      <div>17: }</div>
                    </div>
                    <div><br>
                    </div>
                    <div>
                      <div>$ javac LineNumbers.java </div>
                      <div>$ java LineNumbers</div>
                      <div>Exception in thread "main"
                        java.lang.NullPointerException</div>
                      <div><span style="white-space:pre"> </span>at
                        LineNumbers.main(LineNumbers.java:13)</div>
                    </div>
                    <div><br>
                    </div>
                    <div>I would expect the exception to be at line 15,
                      not 13.</div>
                  </div>
                </div>
              </div>
            </blockquote>
            <br>
            having the exception at 13 is plain bad or good enough? It
            seems to me that you want to do some automation based on the
            exact line where the exception was produced. I'm just
            worried that generating LNT entries for every expression
            would produce, probably unnecessarily, fluffier class files.<br>
            <br>
            <blockquote
cite="mid:CA+7OGVrzuVBe5zr6hyYOdMZ6sU-V4wTAx+MGNC1YPu7ehq2q0Q@mail.gmail.com">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div><br>
                    </div>
                    <div>Thanks,</div>
                    <div>Eddie</div>
                  </div>
                </div>
              </div>
            </blockquote>
            <br>
            Thanks,<br>
            Vicente<br>
            <br>
            <blockquote
cite="mid:CA+7OGVrzuVBe5zr6hyYOdMZ6sU-V4wTAx+MGNC1YPu7ehq2q0Q@mail.gmail.com">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                  </div>
                </div>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Fri, Feb 15, 2019
                  at 6:46 PM Vicente Romero <<a
                    href="mailto:vicente.romero@oracle.com"
                    target="_blank" moz-do-not-send="true">vicente.romero@oracle.com</a>>
                  wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">Hi Eddie,<br>
                  <br>
                  Thanks for the patch. But first I'm not sure that
                  there is a bug in the <br>
                  LNT. There is an entry in the LNT, I'm talking about
                  the example at [1], <br>
                  for the invocation of method `id`. What we need to
                  understand is why the <br>
                  stack trace is not referring to that line and is
                  referring to line 12. <br>
                  In any case I don't think that the LNT should contain
                  entries for <br>
                  accesses to fields.<br>
                  <br>
                  Thanks,<br>
                  Vicente<br>
                  <br>
                  [1] <a
                    href="https://bugs.openjdk.java.net/browse/JDK-8218650"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">https://bugs.openjdk.java.net/browse/JDK-8218650</a><br>
                  <br>
                  On 2/15/19 8:37 PM, Eddie Aftandilian wrote:<br>
                  > Hi,<br>
                  ><br>
                  > I have attached a patch for JDK-8218650, in which
                  there are missing <br>
                  > line number table entries for field accesses.
                  This is my first attempt <br>
                  > to contribute to OpenJDK, so I'm happy to take
                  feedback.  Please see <br>
                  > the attached patch.<br>
                  ><br>
                  > Bug report: <a
                    href="https://bugs.openjdk.java.net/browse/JDK-8218650"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">https://bugs.openjdk.java.net/browse/JDK-8218650</a><br>
                  ><br>
                  > Thanks,<br>
                  > Eddie Aftandilian<br>
                  <br>
                </blockquote>
              </div>
            </blockquote>
            <br>
            <br>
          </blockquote>
        </div>
      </div>
    </blockquote>
  </body>
</html>