: Thursday, May 9, 2019 1:04 AM
To: Coleen Phillimore ; Schmelter, Ralf
; Java Core Libs ;
hotspot-runtime-...@openjdk.java.net; Harold David Seigel
Subject: RE: RFR(L): 8218628: Add detailed message to NullPointerException
describing what is null.
Hi,
here a webrev which uses 'cannot'. No
m; Schmelter, Ralf ;
> Java Core Libs ; hotspot-runtime-
> d...@openjdk.java.net; Harold David Seigel
> Subject: RE: RFR(L): 8218628: Add detailed message to NullPointerException
> describing what is null.
>
> Hi,
>
> > Cannot is apparently preferable in English.
>
-...@openjdk.java.net; Harold David Seigel
>
> Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
> describing what is null.
>
>
>
> On 5/7/19 9:36 AM, Lindenmaier, Goetz wrote:
> > Hi,
> >
> > Please have a look at this further
a Core Libs ; hotspot-runtime-...@openjdk.java.net; Coleen
Phillimore (coleen.phillim...@oracle.com)
Subject: RE: RFR(L): 8218628: Add detailed message to NullPointerException
describing what is null.
Hi Goetz,
I've played with the messages a little bit and they generally look good. But
I've
Hi Goetz,
I've played with the messages a little bit and they generally look good. But
I've come across two which look strange:
- 'o[static Test.INDEX]' is null. Can not invoke method 'int
java.lang.Object.hashCode()'
- 'o[The return value of 'int java.lang.String.hashCode()]' is null. Can
Best regards,
Goetz.
> -Original Message-
> From: Schmelter, Ralf
> Sent: Dienstag, 7. Mai 2019 14:35
> To: Lindenmaier, Goetz ; Java Core Libs libs-...@openjdk.java.net>; hotspot-runtime-...@openjdk.java.net; Coleen
> Phillimore (coleen.phillim...@oracle.com)
> Sub
t: Donnerstag, 14. März 2019 21:56
> > To: 'Mandy Chung' ; 'Roger Riggs'
> >
> > Cc: 'Java Core Libs' ; 'hotspot-runtime-
> > d...@openjdk.java.net'
> > Subject: RE: RFR(L): 8218628: Add detailed message to NullPointerException
> > describing what is null.
&
Sent: Friday, April 12, 2019 5:33 AM
To: Mandy Chung; Roger Riggs
Cc: Java Core Libs; hotspot-runtime-...@openjdk.java.net
Subject: RE: RFR(L): 8218628: Add detailed message to NullPointerException
describing what is null.
Hi,
while waiting for progress on corresponding the JEP, I improved
-Original Message-
> From: Lindenmaier, Goetz
> Sent: Donnerstag, 14. März 2019 21:56
> To: 'Mandy Chung' ; 'Roger Riggs'
>
> Cc: 'Java Core Libs' ; 'hotspot-runtime-
> d...@openjdk.java.net'
> Subject: RE: RFR(L): 8218628: Add detailed message to NullPointerException
; hotspot-runtime-
> d...@openjdk.java.net
> Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
> describing what is null.
>
> Hi Goetz,
> please find the attached ASM-based patch. It is just a PoC, as such it
> does not provide as fine-grained message
Hi Peter,
> -Original Message-
> From: Peter Levart
> Sent: Freitag, 29. März 2019 16:44
> To: Lindenmaier, Goetz ; 'Mandy Chung'
>
> Cc: core-libs-dev@openjdk.java.net; maurizio.cimadam...@oracle.com;
> hotspot-runtime-...@openjdk.java.net
> Subject: Re: RFR(L
On 3/29/19 4:36 PM, Peter Levart wrote:
On 3/29/19 8:49 AM, Lindenmaier, Goetz wrote:
So I want to withdraw my claim that NPEs are thrown frequently.
Probably I was biased by my compiler construction background,
remembering NPE checks are all over the place in the code.
But I think I can
On 3/29/19 8:49 AM, Lindenmaier, Goetz wrote:
So I want to withdraw my claim that NPEs are thrown frequently.
Probably I was biased by my compiler construction background,
remembering NPE checks are all over the place in the code.
But I think I can still keep the claim that the message is
Hi Mandy,
I could access the JBS now, so part 2 of my reply.
Yesterday, I added tables to the JEP describing what is printed
for which bytecode. If this is too verbose for the JEP, it might
be nice in the bug implementing it.
> > This is a design decision not to make the printout too complex.
Hi Mandy,
The JBS is offline, so I'll just reply on this item for now:
> > > Since the JEP quotes that NullPointerExceptions are thrown frequently
> > > and swallowed, it would help if you can generate some numbers.
> > > This JEP will help the discussion on the proposed feature and design and
On 3/27/19 7:18 AM, Lindenmaier, Goetz wrote:
, is this example very clear to them that it won't be supported?
You probably meant that for
n().getNull().m()
it is not printed that getNull() was called on the result of n()?
Yes, I caught my error after I sent my example.
This is a
Hi Mandy,
>and also the cases when it requires to look at its caller
> frame.
>
> Never. Only the method that was executed when the exception is
> thrown is needed. I only mention the backtrace because it happens to
> store the top method and the corresponding
On 3/26/19 4:57 AM, Lindenmaier, Goetz wrote:
and also the cases when it requires to look at its caller frame.
Never. Only the method that was executed when the exception is
thrown is needed. I only mention the backtrace because it happens to
store the top method and the corresponding
Hi Mandy,
thanks for reading the JEP and giving detailed feedback!
> In the "Basic algorithm to compute the message" section:
>
> "This dataflow analysis walks the bytecodes forward simulating the execution
> stack."
>
> Please elaborate it. Given a stack trace, it starts with the most
Hi Goetz,
On 3/15/19 3:55 AM, Lindenmaier, Goetz wrote:
I followed your advice and created a JEP:
https://bugs.openjdk.java.net/browse/JDK-8220715
This is a good start. I include my comments as a reader who does not
read TrackingStackCreator and other C++ code.
In the "Basic algorithm to
On 3/20/19 1:54 AM, Lindenmaier, Goetz wrote:
Should I move the JEP to status 'submitted'?
Per the Process states section [1]
Draft --- In circulation by the author for initial review and
consensus-building
I certainly don't want to be the bottleneck. Others can help do the
initial
.
> >
> >> -Original Message-
> >> From: mark.reinh...@oracle.com
> >> Sent: Donnerstag, 14. März 2019 22:38
> >> To: maurizio.cimadam...@oracle.com; Lindenmaier, Goetz
> >>
> >> Cc: mandy.ch...@oracle.com; roger.ri...@oracle.com;
. März 2019 22:38
To: maurizio.cimadam...@oracle.com; Lindenmaier, Goetz
Cc: mandy.ch...@oracle.com; roger.ri...@oracle.com; core-libs-
d...@openjdk.java.net; hotspot-runtime-...@openjdk.java.net
Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
describing what is null.
2019
>>
> >> Other issues have been discussed in the mail thread before.
> >> Good that you point this out, I'll add it to the JEP.
> >>
> >> Best regards,
> >> Goetz
> >>
> >> ... Sorry, I missed the "reply all" o
Goetz
> >
> > ... Sorry, I missed the "reply all" on my first reply.
> >
> >
> >
> >
> >> -Original Message-----
> >> From: Maurizio Cimadamore
> >> Sent: Freitag, 15. März 2019 12:33
> >> To: Lindenmai
.. Sorry, I missed the "reply all" on my first reply.
-Original Message-
From: Maurizio Cimadamore
Sent: Freitag, 15. März 2019 12:33
To: Lindenmaier, Goetz ; Mandy Chung
; Roger Riggs
Cc: Java Core Libs ; hotspot-runtime-
d...@openjdk.java.net
Subject: Re: RFR(L): 8218
sage-
From: Maurizio Cimadamore
Sent: Freitag, 15. März 2019 12:33
To: Lindenmaier, Goetz ; Mandy Chung
; Roger Riggs
Cc: Java Core Libs ; hotspot-runtime-
d...@openjdk.java.net
Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
describing what is null.
Hi Goetz,
pl
; ; Roger Riggs
> Cc: Java Core Libs ; hotspot-runtime-
> d...@openjdk.java.net
> Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
> describing what is null.
>
> Hi Goetz,
> please find the attached ASM-based patch. It is just a PoC, as such it
>
Hi Goetz,
please find the attached ASM-based patch. It is just a PoC, as such it
does not provide as fine-grained messages as the one discussed in the
RFE/JEP, but can be enhanced to cover custom debugging attribute, I believe.
When running this:
Object o = null;
o.toString();
you get:
om; core-libs-
> d...@openjdk.java.net; hotspot-runtime-...@openjdk.java.net
> Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
> describing what is null.
>
> 2019/3/14 8:00:20 -0700, maurizio.cimadam...@oracle.com:
> > I second what Mandy say
Hi Maurizio,
>
> I second what Mandy says.
>
> First let me start by saying that this enhancement will be a great
> addition to our platform; back in the days when I was teaching some Java
> classes at the university, I was very aware of how hard it is to
> diagnose a NPE for someone novel to
2019/3/14 8:00:20 -0700, maurizio.cimadam...@oracle.com:
> I second what Mandy says.
>
> First let me start by saying that this enhancement will be a great
> addition to our platform; back in the days when I was teaching some Java
> classes at the university, I was very aware of how hard it is
Hi Coleen,
thanks for looking at my change..
> For the record, I think the C++ implementation is more straightforward
> than trying to use the Stackwalker and ASM because there's other code
> just like it right here. You have all the information you need directly
> in the Throwable.backtrace
I second what Mandy says.
First let me start by saying that this enhancement will be a great
addition to our platform; back in the days when I was teaching some Java
classes at the university, I was very aware of how hard it is to
diagnose a NPE for someone novel to Java programming. A
Hi,
> Roger, Coleen, Maurizio and I talked about this proposed feature.
> We all think that improving NPE message is a useful enhancement for
> the platform and helps developers to tell what causes NPE.
Thanks for this positive feedback :)!
> This is not a small enhancement. Diving into a
Hi Goetz,
Roger, Coleen, Maurizio and I talked about this proposed feature.
We all think that improving NPE message is a useful enhancement for
the platform and helps developers to tell what causes NPE.
This is not a small enhancement. Diving into a large code review
would not be the best way
on behalf of
Lindenmaier, Goetz
Sent: Tuesday, March 12, 2019 10:04 AM
To: Peter Levart; Roger Riggs; Java Core Libs
Cc: hotspot-runtime-...@openjdk.java.net
Subject: RE: RFR(L): 8218628: Add detailed message to NullPointerException
describing what is null.
Hi Peter,
>56 private sta
ndows/AltFocusIssueTest.java
> > is failing in a headless environment with an NPE on this line:
> > SwingUtilities.invokeAndWait(() -> frame.dispose());
> > With this change it said "while trying to invoke the method
> javax.swing.JFrame.dispose(()V) of a null object lo
Hi Andrew,
> Ok. However, if you have the appropriate method bytecodes and the BCI at
> which the exception occurred then I'm not sure why you would need ASM.
I implemented it in C++ at first. I was asked to investigate an implementation
in Java by the reviewers.
Thanks!
Goetz
> Also, it
On 21/02/2019 12:57, Lindenmaier, Goetz wrote:
> thanks for giving this advice! It confirms the problems I see.
You are welcome.
> For the context:
> The idea was to implement this in Java using StackWalker and
> ASM. If I had the right bytecodes, and the right starting point,
> ASM would be
look some more into the reconstituter code...
Thanks,
Goetz.
> -Original Message-
> From: Andrew Dinn
> Sent: Mittwoch, 20. Februar 2019 18:29
> To: Lindenmaier, Goetz
> Cc: core-libs-dev ; hotspot-runtime-
> d...@openjdk.java.net
> Subject: Re: RFR(L): 8218628:
Hi Goetz,
Forgive me for jumping in here and, possibly, misunderstanding what you
want -- I may have misunderstood what you are trying to do as I have not
been following this thread carefully.
On 20/02/2019 16:36, Lindenmaier, Goetz wrote:
> 1. As I understand, it would be simple to extend ASM
Hi Remi,
> yes, it's a feature of ASM, offer the right abstraction to do bytecode
> generation/transformation i.e. a stream of opcodes that are more abstract
> than the real bytecode, so there is no way to get a direct access to the
> bytecode at a specific BCI.
For the generation of the NPE
e-----
>> From: Peter Levart
>> Sent: Freitag, 15. Februar 2019 18:38
>> To: Lindenmaier, Goetz ; Roger Riggs
>> ; Java Core Libs
>> Cc: hotspot-runtime-...@openjdk.java.net
>> Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
>>
Levart
Sent: Freitag, 15. Februar 2019 18:38
To: Lindenmaier, Goetz ; Roger Riggs
; Java Core Libs
Cc: hotspot-runtime-...@openjdk.java.net
Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
describing what is null.
Hi Goetz,
Just a couple of things if you go that route
often is a big overhead. E.g., I look at about 50 failing jtreg
> > tests every day, I don't want to get each into the debugger every time
> > in the setup where it was running to see what is wrong ...
> >
> > E.g., com/sun/java/swing/plaf/windows/AltFocusIssueTest.java
> > is fai
2. Februar 2019 17:03
To: Lindenmaier, Goetz ; Java Core Libs
Cc: hotspot-runtime-...@openjdk.java.net
Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
describing what is null.
Hi,
On 02/12/2019 08:14 AM, Lindenmaier, Goetz wrote:
Hi Roger,
thanks for lookin
m static field
AltFocusIssueTest.frame" and I figured it's the fact we run headless that
makes the test fail without even looking at the code.
Best regards,
Goetz
From: Roger Riggs
Sent: Dienstag, 12. Februar 2019 17:03
To: Lindenmaier, Goetz ; Java Core Libs
Cc: hotspot-runtime-...@o
Riggs
Cc: Java Core Libs ; hotspot-runtime-
d...@openjdk.java.net
Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
describing what is null.
On 2/8/19 11:46 AM, Roger Riggs wrote:
Hi,
A few higher level issues should be considered, though the details
of the webrev
__
> Von: core-libs-dev im Auftrag
> von Roger Riggs
> Gesendet: Dienstag, Februar 12, 2019 8:07 PM
> An: Lindenmaier, Goetz; Java Core Libs
> Cc: hotspot-runtime-...@openjdk.java.net
> Betreff: Re: RFR(L): 8218628: Add detailed message to NullPointerException
> describing what i
webrev for that.
Best regards,
Goetz.
> -Original Message-
> From: core-libs-dev On Behalf
> Of Mandy Chung
> Sent: Tuesday, February 12, 2019 7:32 PM
> To: Roger Riggs
> Cc: Java Core Libs ; hotspot-runtime-
> d...@openjdk.java.net
> Subject: Re: RFR(L): 82186
Libs
Cc: hotspot-runtime-...@openjdk.java.net
Betreff: Re: RFR(L): 8218628: Add detailed message to NullPointerException
describing what is null.
Hi,
On 02/12/2019 08:14 AM, Lindenmaier, Goetz wrote:
> Hi Roger,
>
> thanks for looking at my change!
>
>> A few higher l
On 2/8/19 11:46 AM, Roger Riggs wrote:
Hi,
A few higher level issues should be considered, though the details
of the webrev captured my immediate attention.
Is this the right feature and is this the right level of implementation
(C++/native)?
:
How much of this can be done in Java code with
Hi,
On 02/12/2019 08:14 AM, Lindenmaier, Goetz wrote:
Hi Roger,
thanks for looking at my change!
A few higher level issues should be considered, though the details of
the webrev captured my immediate attention.
Is this the right feature
Yes!!
Maybe, that's what debuggers are for.
and
avaClasses.cpp.
Best regards,
Goetz.
> -Original Message-
> From: Daniel Fuchs
> Sent: Dienstag, 12. Februar 2019 14:55
> To: Lindenmaier, Goetz ; Roger Riggs
> ; Java Core Libs
> Cc: hotspot-runtime-...@openjdk.java.net
> Subject: Re: RFR(L): 8218628: Add detailed me
Hi Goetz,
On 12/02/2019 14:14, Lindenmaier, Goetz wrote:
StackWalker operates on the Java stack tracke, which does not contain the BCI
to my knowledge.
For what it's worth, StackWalker::StackFrame has the BCI: returned by
public int getByteCodeIndex(); [1]
But I am not sure how you
Hi Roger,
thanks for looking at my change!
> A few higher level issues should be considered, though the details of
> the webrev captured my immediate attention.
>
> Is this the right feature
Yes!!
> and is this the right level of implementation (C++/native)?
See below.
> From a security
Hi,
A few higher level issues should be considered, though the details of
the webrev
captured my immediate attention.
Is this the right feature and is this the right level of implementation
(C++/native)?
From a security perspective, adding field names to exceptions exposes
information to
Hi Goetz,
On 02/08/2019 06:51 AM, Lindenmaier, Goetz wrote:
...
though I think trying to produce signatures within the message is going
to be very awkward in the general case. The key part is the "method
NPE.b() ... returned from NPE.a()"
Actually, I have left out code that changes the
gt;
>>
>>
>>
>>
>>> -----Original Message-----
>>> From: David Holmes
>>> Sent: Freitag, 8. Februar 2019 13:31
>>> To: Lindenmaier, Goetz ; hotspot-runtime-
>>> d...@openjdk.java.net; Java Core Libs
>>> Subject: Re: RFR(L):
Goetz ; hotspot-runtime-
>> d...@openjdk.java.net; Java Core Libs
>> Subject: Re: RFR(L): 8218628: Add detailed message to
>> NullPointerException
>> describing what is null.
>>
>> Hi Goetz,
>>
>> Just one follow up for now:
>>
>
Hi Goetz,
> 91 synchronized (this) {
> -> I think this is not needed here. The transient modifier for
> lazyComputeMessage already implies the lock on the Object, I think.
please ignore this comment, I'm wrong here. I confused transient with
volatile...
/Christoph
Hi Goetz,
> ok, so here a new webrev just adding a setter for the field:
> http://cr.openjdk.java.net/~goetz/wr19/8218628-exMsg-NPE/02
>
> ... and incorporating the other comments.
Looks better
I have a few additions to
src/java.base/share/classes/java/lang/NullPointerException.java:
28
019 13:31
> To: Lindenmaier, Goetz ; hotspot-runtime-
> d...@openjdk.java.net; Java Core Libs
> Subject: Re: RFR(L): 8218628: Add detailed message to NullPointerException
> describing what is null.
>
> Hi Goetz,
>
> Just one follow up for now:
>
> > * Add pa
Hi Goetz,
Just one follow up for now:
* Add package visible "void setMessage (String msg)" to Throwable.
Yes, just use package accessibility to deal with this, no need to jump
through hoops (or the VM :) ).
Thanks,
David
On 8/02/2019 9:51 pm, Lindenmaier, Goetz wrote:
Hi David,
Hi
Hi David,
> Hi Volker,
... I assume Volker could have contributed this as well, but actually
I must mention Ralf Schmelter as the original author of this :)
> You know I'm not going to be a big fan of this :), but as long as we
> don't pay for it if we don't want it, then that's okay. (I'm
Original Message-
> > From: hotspot-runtime-dev > boun...@openjdk.java.net> On Behalf Of Lindenmaier, Goetz
> > Sent: Donnerstag, 7. Februar 2019 17:43
> > To: hotspot-runtime-...@openjdk.java.net; Java Core Libs > d...@openjdk.java.net>
> > Subject: [CAUT
> 122 private native void setDefaultMessage(String extendedMessage);
> Here, I agree with David, that you should do it in Java. Just use a shared
> secret, then you don't even need reflection...
Addition: you should not even need to use a shared secret as Throwable and NPE
are in the same
tspot-runtime-...@openjdk.java.net; Java Core Libs d...@openjdk.java.net>
> Subject: [CAUTION] RFR(L): 8218628: Add detailed message to
> NullPointerException describing what is null.
>
> Hi,
>
> since Java 5, our internal VM reports verbose null pointer except
In 8/02/2019 10:05 am, David Holmes wrote:
Hi Volker,
Aaarggh!! Sorry Volker and Goetz. No idea where that came from.
David
-
You know I'm not going to be a big fan of this :), but as long as we
don't pay for it if we don't want it, then that's okay. (I'm still
trying to gauge that)
Hi Volker,
You know I'm not going to be a big fan of this :), but as long as we
don't pay for it if we don't want it, then that's okay. (I'm still
trying to gauge that)
I have a little test for this that I ran through your patch:
public class NPE {
static class B {
C b() { return
Hi,
since Java 5, our internal VM reports verbose null pointer exception
messages. I would like to contribute this feature to OpenJDK.
With this change, messages as
"java.lang.NullPointerException: while trying to load from a null int array
loaded from local variable 'ia1'"
are printed. For
72 matches
Mail list logo