Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 91665 invoked from network); 7 Oct 2010 22:03:31 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Oct 2010 22:03:31 -0000 Received: (qmail 22516 invoked by uid 500); 7 Oct 2010 22:03:31 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 22445 invoked by uid 500); 7 Oct 2010 22:03:31 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 22438 invoked by uid 99); 7 Oct 2010 22:03:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Oct 2010 22:03:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Oct 2010 22:03:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 13C6D23889E3; Thu, 7 Oct 2010 22:03:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1005651 - /harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/lang/String.java Date: Thu, 07 Oct 2010 22:03:08 -0000 To: commits@harmony.apache.org From: hindessm@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101007220308.13C6D23889E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hindessm Date: Thu Oct 7 22:03:07 2010 New Revision: 1005651 URL: http://svn.apache.org/viewvc?rev=1005651&view=rev Log: Remove another explicit NPE. I'm not re-ordering the bounds checking here as it turns out: String s = new String((int[])null, -1, 0); and: String s = new String((int[])null, 0, -1); on the RI throw IndexOutOfBoundsException not NullPointerException. So the behaviour before did not match the RI. Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/lang/String.java Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/lang/String.java URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/lang/String.java?rev=1005651&r1=1005650&r2=1005651&view=diff ============================================================================== --- harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/lang/String.java (original) +++ harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/lang/String.java Thu Oct 7 22:03:07 2010 @@ -492,11 +492,7 @@ public final class String implements Ser */ public String(int[] codePoints, int offset, int count) { super(); - if (codePoints == null) { - throw new NullPointerException(); - } - if (offset < 0 || count < 0 - || (long) offset + (long) count > codePoints.length) { + if (offset < 0 || count < 0 || offset > codePoints.length - count) { throw new IndexOutOfBoundsException(); } this.offset = 0;