This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] [JAVA] Double.parseDouble(null) throw NullPointerException
- From: Tom Tromey <tromey at redhat dot com>
- To: Jie Liu <lj8175 at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Mon, 08 Aug 2011 08:15:38 -0600
- Subject: Re: [PATCH] [JAVA] Double.parseDouble(null) throw NullPointerException
- References: <CABc96T_0THd_tKzdHSjD-xcPd7=dqoFkr0aRwrdvx-h4s2Hnxg@mail.gmail.com> <CABc96T_DNYxNsqKqdsVw7-x8uVc05_fB0BcHfJU5rv-VtFUv7A@mail.gmail.com>
>>>>> "Jie" == Jie Liu <lj8175@gmail.com> writes:
Jie> + if(str == NULL)
Jie> + throw new NullPointerException();
Jie> +
Jie> int length = str->length();
Why doesn't 'str->length()' throw the NPE?
Tom