From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13077 invoked by alias); 7 Aug 2011 11:00:53 -0000 Received: (qmail 13062 invoked by uid 22791); 7 Aug 2011 11:00:53 -0000 X-SWARE-Spam-Status: No, hits=-0.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_GC,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 07 Aug 2011 11:00:39 +0000 Received: by ywe9 with SMTP id 9so2548905ywe.20 for ; Sun, 07 Aug 2011 04:00:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.201.200 with SMTP id b48mr5289745yho.77.1312714839006; Sun, 07 Aug 2011 04:00:39 -0700 (PDT) Received: by 10.147.82.10 with HTTP; Sun, 7 Aug 2011 04:00:38 -0700 (PDT) In-Reply-To: References: Date: Sun, 07 Aug 2011 11:00:00 -0000 Message-ID: Subject: Re: [PATCH] [JAVA] Double.parseDouble(null) throw NullPointerException From: Jie Liu To: gcc-patches@gcc.gnu.org, java-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2011-q3/txt/msg00037.txt.bz2 Hi, When I use gcj on an RTOS(RTEMS), Double.parseDouble(null) throw NumberFormatException, but it should throw NullPointerException. So I add the patch below: Index: natVMDouble.cc =================================================================== --- natVMDouble.cc (revision 172224) +++ natVMDouble.cc (working copy) @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -162,6 +163,9 @@ jdouble java::lang::VMDouble::parseDouble(jstring str) { + if(str == NULL) + throw new NullPointerException(); + int length = str->length(); while (length > 0 The testsuite/Throw_2.java has been PASS after this patch. what do you think about this patch? Thanks, Jie