You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by py...@apache.org on 2006/10/13 15:58:46 UTC
svn commit: r463681 - in
/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java:
java/io/RandomAccessFile.java
org/apache/harmony/luni/platform/OSFileSystem.java
Author: pyang
Date: Fri Oct 13 06:58:43 2006
New Revision: 463681
URL: http://svn.apache.org/viewvc?view=rev&rev=463681
Log:
Apply patch with modifications for HARMONY-1790([classlib][io] remove duplicated exception check in RandomAccessFile#write(byte, int, int)), the original one made test 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=463681&r1=463680&r2=463681
==============================================================================
--- 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 Fri Oct 13 06:58:43 2006
@@ -739,16 +739,12 @@
* @see #read(byte[], int, int)
*/
public void write(byte[] buffer, int offset, int count) throws IOException {
- if (null == buffer) {
- throw new NullPointerException();
- }
- if (count < 0 || offset < 0 || count > buffer.length - offset) {
+ if (count > buffer.length - offset || count < 0 || offset < 0) {
throw new IndexOutOfBoundsException();
}
- if (0 == count){
- return;
+ if (count == 0){
+ 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=463681&r1=463680&r2=463681
==============================================================================
--- 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 Fri Oct 13 06:58:43 2006
@@ -154,9 +154,6 @@
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();