diff options
| author | Michael Koch <mkoch@gcc.gnu.org> | 2004-04-20 13:43:35 +0000 |
|---|---|---|
| committer | Michael Koch <mkoch@gcc.gnu.org> | 2004-04-20 13:43:35 +0000 |
| commit | 0fc920c8d5c613361270c60ecd4841e3af7f6a62 (patch) | |
| tree | 7e4bc2de07ebff904c9e32b5f47d40e91f0a6395 /libjava/java/io/FileDescriptor.java | |
| parent | f6d49f66ec0e0a59285d304720cc3bfa18f28141 (diff) | |
[multiple changes]
2004-04-20 Jeroen Frijters <jeroen@frijters.net>
* java/io/FileDescriptor.java: (FileDescriptor) Added public
constructor. (valid) Added null check.
2004-04-20 Guilhem Lavaux <guilhem@kaffe.org>
Reported by Nektarios Papadopoulos <npapadop@inaccessnetworks.com>
* java/io/FileOutputStream.java
(FileOutputStream) Reorganized constructors. Constructors now
check whether the given path is directory.
From-SVN: r80901
Diffstat (limited to 'libjava/java/io/FileDescriptor.java')
| -rw-r--r-- | libjava/java/io/FileDescriptor.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libjava/java/io/FileDescriptor.java b/libjava/java/io/FileDescriptor.java index be86593e76d..35a478509fc 100644 --- a/libjava/java/io/FileDescriptor.java +++ b/libjava/java/io/FileDescriptor.java @@ -83,6 +83,14 @@ public final class FileDescriptor /** * This method is used to initialize an invalid FileDescriptor object. */ + public FileDescriptor() + { + channel = null; + } + + /** + * This method is used to initialize a FileDescriptor object. + */ FileDescriptor(ByteChannel channel) { this.channel = channel; @@ -125,6 +133,6 @@ public final class FileDescriptor */ public boolean valid () { - return channel.isOpen(); + return channel != null && channel.isOpen(); } } |
