RFR - JDK-8218650: LineNumberTable records for method invocations with arguments
Eddie Aftandilian
eaftan at google.com
Wed Feb 20 01:27:04 UTC 2019
Hi Vicente,
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:
1: class LineNumbers {
2:
3: static class T {
4: boolean b;
5: }
6:
7: static void doIt(boolean... values) {}
8:
9: public static void main(String[] args) {
10: T a = new T();
11: T b = null;
12:
13: doIt(
14: a.b,
15: b.b);
16: }
17: }
$ javac LineNumbers.java
$ java LineNumbers
Exception in thread "main" java.lang.NullPointerException
at LineNumbers.main(LineNumbers.java:13)
I would expect the exception to be at line 15, not 13.
Thanks,
Eddie
On Fri, Feb 15, 2019 at 6:46 PM Vicente Romero <vicente.romero at oracle.com>
wrote:
> Hi Eddie,
>
> Thanks for the patch. But first I'm not sure that there is a bug in the
> LNT. There is an entry in the LNT, I'm talking about the example at [1],
> for the invocation of method `id`. What we need to understand is why the
> stack trace is not referring to that line and is referring to line 12.
> In any case I don't think that the LNT should contain entries for
> accesses to fields.
>
> Thanks,
> Vicente
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8218650
>
> On 2/15/19 8:37 PM, Eddie Aftandilian wrote:
> > Hi,
> >
> > I have attached a patch for JDK-8218650, in which there are missing
> > line number table entries for field accesses. This is my first attempt
> > to contribute to OpenJDK, so I'm happy to take feedback. Please see
> > the attached patch.
> >
> > Bug report: https://bugs.openjdk.java.net/browse/JDK-8218650
> >
> > Thanks,
> > Eddie Aftandilian
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20190219/bb409a15/attachment.html>
More information about the compiler-dev
mailing list