diff options
author | Tom Tromey <tromey@redhat.com> | 2001-08-31 22:31:40 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2001-08-31 22:31:40 +0000 |
commit | 4504a6554658e2b23a73856e99c50bc70ca6a324 (patch) | |
tree | 58afefccc03082c2ba80876586e2554dee250583 /libjava | |
parent | eb3ae3e105091e44f38d0b33dae7f39f1aa555a6 (diff) | |
download | gcc-4504a6554658e2b23a73856e99c50bc70ca6a324.zip gcc-4504a6554658e2b23a73856e99c50bc70ca6a324.tar.gz gcc-4504a6554658e2b23a73856e99c50bc70ca6a324.tar.bz2 |
Re-merge with Classpath:
* java/util/Comparator (equals): Added.
* java/io/PipedWriter.java (write): Changed argument to `int'.
* java/io/FileDescriptor.java (FileDescriptor()): New
constructor.
* java/io/File.java (getAbsoluteFile): Doesn't throw IOException.
From-SVN: r45337
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 8 | ||||
-rw-r--r-- | libjava/java/io/File.java | 2 | ||||
-rw-r--r-- | libjava/java/io/FileDescriptor.java | 5 | ||||
-rw-r--r-- | libjava/java/io/PipedWriter.java | 4 | ||||
-rw-r--r-- | libjava/java/util/Comparator.java | 11 |
5 files changed, 26 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 636dcc9..261aafa 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,13 @@ 2001-08-31 Tom Tromey <tromey@redhat.com> + Re-merge with Classpath: + * java/util/Comparator (equals): Added. + * java/io/PipedWriter.java (write): Changed argument to `int'. + + * java/io/FileDescriptor.java (FileDescriptor()): New + constructor. + * java/io/File.java (getAbsoluteFile): Doesn't throw IOException. + * Makefile.in: Rebuilt. * Makefile.am (ordinary_java_source_files): Removed EnumerationChain, added DoubleEnumeration. diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index 25b6fcd..12297ac 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -157,7 +157,7 @@ public class File implements Serializable, Comparable } /** @since 1.2 */ - public File getAbsoluteFile () throws IOException + public File getAbsoluteFile () { return new File (getAbsolutePath()); } diff --git a/libjava/java/io/FileDescriptor.java b/libjava/java/io/FileDescriptor.java index 8afcda4..a8bf751 100644 --- a/libjava/java/io/FileDescriptor.java +++ b/libjava/java/io/FileDescriptor.java @@ -43,6 +43,11 @@ public final class FileDescriptor static final int SET = 0; static final int CUR = 1; + // This constructor is specified to create an invalid descriptor. + public FileDescriptor () + { + } + // Open a file. MODE is a combination of the above mode flags. FileDescriptor (String path, int mode) throws FileNotFoundException { diff --git a/libjava/java/io/PipedWriter.java b/libjava/java/io/PipedWriter.java index ebcbde7..d5dd8bf 100644 --- a/libjava/java/io/PipedWriter.java +++ b/libjava/java/io/PipedWriter.java @@ -104,9 +104,9 @@ public class PipedWriter extends Writer * @exception IOException If the stream has not been connected or has * been closed. */ - public void write(char b) throws IOException + public void write(int b) throws IOException { - read_buf[0] = b; + read_buf[0] = (char) (b & 0xffff); sink.receive (read_buf, 0, 1); } diff --git a/libjava/java/util/Comparator.java b/libjava/java/util/Comparator.java index 4b09e0f..fc61fc3 100644 --- a/libjava/java/util/Comparator.java +++ b/libjava/java/util/Comparator.java @@ -1,5 +1,5 @@ /* Comparator.java -- Interface for objects that specify an ordering - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -61,4 +61,13 @@ public interface Comparator * compared by this ordering. */ int compare(Object o1, Object o2); + + /** + * Return true if the object is equal to this object. To be + * considered equal, the argument object must satisfy the constraints + * of <code>Object.equals()</code>, be a Comparator, and impose the + * same ordering as this Comparator. + * @param obj The object + */ + boolean equals(Object obj); } |