RFR(L): 8218628: Add detailed message to NullPointerException describing what is null.
Lindenmaier, Goetz
goetz.lindenmaier at sap.com
Thu May 9 08:04:04 UTC 2019
Hi,
here a webrev which uses 'cannot'. Nothing else changed.
http://cr.openjdk.java.net/~goetz/wr19/8218628-exMsg-NPE/10-cannot/
Best regards,
Goetz.
> -----Original Message-----
> From: Lindenmaier, Goetz
> Sent: Donnerstag, 9. Mai 2019 08:55
> To: coleen.phillimore at oracle.com; Schmelter, Ralf <ralf.schmelter at sap.com>;
> Java Core Libs <core-libs-dev at openjdk.java.net>; hotspot-runtime-
> dev at openjdk.java.net; Harold David Seigel <harold.seigel at oracle.com>
> Subject: RE: RFR(L): 8218628: Add detailed message to NullPointerException
> describing what is null.
>
> Hi,
>
> > Cannot is apparently preferable in English.
> OK, changed.
>
> Best regards,
> Goetz.
>
>
> > -----Original Message-----
> > From: coleen.phillimore at oracle.com <coleen.phillimore at oracle.com>
> > Sent: Mittwoch, 8. Mai 2019 17:32
> > To: Lindenmaier, Goetz <goetz.lindenmaier at sap.com>; Schmelter, Ralf
> > <ralf.schmelter at sap.com>; Java Core Libs <core-libs-dev at openjdk.java.net>;
> > hotspot-runtime-dev at openjdk.java.net; Harold David Seigel
> > <harold.seigel at oracle.com>
> > 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 improved webrev:
> > > http://cr.openjdk.java.net/~goetz/wr19/8218628-exMsg-NPE/09/
> > > http://cr.openjdk.java.net/~goetz/wr19/8218628-exMsg-NPE/09-
> > incremental/
> > >
> > > Harold, Coleen, thanks for pointing me to those methods.
> > > I'm using them now. This simplifies the helper methods
> > > considerably.
> > >
> > > Ralf, thanks for looking at the messages!
> > > I now suppress the "static " and
> > > "The return value of '" strings in the array subscript
> > > expressions and added corresponding test cases.
> > >
> > > About "can not" versus "cannot", what I find in the
> > > net "cannot" is to be preferred. Any comments on that?
> > > By native speakers?
> > > See example messages here:
> > > http://cr.openjdk.java.net/~goetz/wr19/8218628-exMsg-
> > NPE/09/output_with_debug_info.txt
> >
> > Cannot is apparently preferable in English. Native speaker (only
> > language) but somebody had to tell me.
> >
> > Coleen
> > >
> > > Further, I fixed a build issue with the solaris compiler.
> > > All handling of bci is now unsigned.
> > >
> > > Best regards,
> > > Goetz.
> > >
> > >
> > >
> > >
> > >> -----Original Message-----
> > >> From: Schmelter, Ralf
> > >> Sent: Dienstag, 7. Mai 2019 14:35
> > >> To: Lindenmaier, Goetz <goetz.lindenmaier at sap.com>; Java Core Libs
> > <core-
> > >> libs-dev at openjdk.java.net>; hotspot-runtime-dev at openjdk.java.net;
> > Coleen
> > >> Phillimore (coleen.phillimore at oracle.com)
> <coleen.phillimore at 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
> > >> 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 not
> > invoke
> > >> method 'int java.lang.Object.hashCode()'.
> > >>
> > >> Here is the test program to reproduce these:
> > >> public class Test {
> > >> public static int INDEX = 2;
> > >>
> > >> public static void main(String[] args) {
> > >> Object[] o = new Object[10];
> > >> try {
> > >> o[INDEX].hashCode();
> > >> } catch (Exception e) {
> > >> e.printStackTrace();
> > >> }
> > >> try {
> > >> o["".hashCode()].hashCode();
> > >> } catch (Exception e) {
> > >> e.printStackTrace();
> > >> }
> > >> }
> > >> }
> > >>
> > >> And 'Can not' should be 'Cannot'?
> > >>
> > >> Best regards,
> > >> Ralf
More information about the core-libs-dev
mailing list