[Patch] java.io.FileInputStream and java.io.FileOutputStream merged
Michael Koch
konqueror@gmx.de
Sat Apr 23 11:23:00 GMT 2005
Hi list,
I just commited the attached patch from GNU classpath to HEAD.
It removes some redundant checks from java.io.FileInputStream and
java.io.FileOutputStream because its done by
gnu.java.nio.channels.FileChannelImpl too.
Michael
2005-04-23 Jeroen Frijters <jeroen@frijters.net>
* java/io/FileInputStream.java (FileInputStream(File)),
java/io/FileOutputStream.java (FileOutputStream(File)):
Removed unnecessary File.isDirectory() check.
-------------- next part --------------
Index: java/io/FileInputStream.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/FileInputStream.java,v
retrieving revision 1.23
diff -u -r1.23 FileInputStream.java
--- java/io/FileInputStream.java 17 Feb 2005 07:48:32 -0000 1.23
+++ java/io/FileInputStream.java 23 Apr 2005 11:19:46 -0000
@@ -105,9 +105,6 @@
if (s != null)
s.checkRead(file.getPath());
- if (file.isDirectory())
- throw new FileNotFoundException(file.getPath() + " is a directory");
-
ch = new FileChannelImpl (file.getPath(), FileChannelImpl.READ);
}
Index: java/io/FileOutputStream.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/FileOutputStream.java,v
retrieving revision 1.20
diff -u -r1.20 FileOutputStream.java
--- java/io/FileOutputStream.java 17 Feb 2005 07:48:32 -0000 1.20
+++ java/io/FileOutputStream.java 23 Apr 2005 11:19:46 -0000
@@ -155,10 +155,7 @@
if (s != null)
s.checkWrite(file.getPath());
- if (file.isDirectory())
- throw new FileNotFoundException(file.getPath() + " is a directory");
-
- ch = new FileChannelImpl (file.getPath(), (append
+ ch = new FileChannelImpl (file.getPath(), (append
? FileChannelImpl.WRITE
| FileChannelImpl.APPEND
: FileChannelImpl.WRITE));
More information about the Java-patches
mailing list