Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 49776 invoked from network); 12 Oct 2006 16:21:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Oct 2006 16:21:11 -0000 Received: (qmail 36352 invoked by uid 500); 12 Oct 2006 16:21:11 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 36328 invoked by uid 500); 12 Oct 2006 16:21:11 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 36310 invoked by uid 99); 12 Oct 2006 16:21:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 09:21:11 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 09:21:10 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 4A9A51A981A; Thu, 12 Oct 2006 09:20:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r463302 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java: java/io/RandomAccessFile.java org/apache/harmony/luni/platform/OSFileSystem.java Date: Thu, 12 Oct 2006 16:20:50 -0000 To: harmony-commits@incubator.apache.org From: pyang@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061012162050.4A9A51A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: pyang Date: Thu Oct 12 09:20:48 2006 New Revision: 463302 URL: http://svn.apache.org/viewvc?view=rev&rev=463302 Log: Roll back the patch for HARMONY-1790([classlib][io] remove duplicated exception check in RandomAccessFile#write(byte, int, int)), which caused RandomFileTest fail on Linux Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java?view=diff&rev=463302&r1=463301&r2=463302 ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java Thu Oct 12 09:20:48 2006 @@ -739,9 +739,16 @@ * @see #read(byte[], int, int) */ public void write(byte[] buffer, int offset, int count) throws IOException { - if (count > buffer.length - offset || count < 0 || offset < 0) { + if (null == buffer) { + throw new NullPointerException(); + } + if (count < 0 || offset < 0 || count > buffer.length - offset) { throw new IndexOutOfBoundsException(); } + if (0 == count){ + return; + } + openCheck(); synchronized (repositionLock) { fileSystem.write(fd.descriptor, buffer, offset, count); } Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java?view=diff&rev=463302&r1=463301&r2=463302 ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java Thu Oct 12 09:20:48 2006 @@ -154,6 +154,9 @@ public long write(long fileDescriptor, byte[] bytes, int offset, int length) throws IOException { + if (bytes == null) { + throw new NullPointerException(); + } long bytesWritten = writeImpl(fileDescriptor, bytes, offset, length); if (bytesWritten < 0) { throw new IOException();