harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r463239 - 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 13:07:54 GMT
Author: pyang
Date: Thu Oct 12 06:07:52 2006
New Revision: 463239

URL: http://svn.apache.org/viewvc?view=rev&rev=463239
Log:
Apply patch for HARMONY-1790([classlib][io] remove duplicated exception check in RandomAccessFile#write(byte,
int, int))

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=463239&r1=463238&r2=463239
==============================================================================
--- 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 06:07:52 2006
@@ -739,16 +739,9 @@
      * @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;
-        }
-        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=463239&r1=463238&r2=463239
==============================================================================
--- 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 06:07:52 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();



Mime
View raw message