This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: Minor conformance changes
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Subject: Patch: FYI: Minor conformance changes
- From: Tom Tromey <tromey at redhat dot com>
- Date: 31 Aug 2001 16:41:20 -0600
- Reply-To: tromey at redhat dot com
I'm checking this in. Built and tested on x86.
This patch makes some minor changes for better conformance with the
spec.
Tom
Index: ChangeLog
from 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.
Index: java/io/File.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/File.java,v
retrieving revision 1.19
diff -u -r1.19 File.java
--- java/io/File.java 2001/07/18 18:35:12 1.19
+++ java/io/File.java 2001/08/31 22:06:20
@@ -157,7 +157,7 @@
}
/** @since 1.2 */
- public File getAbsoluteFile () throws IOException
+ public File getAbsoluteFile ()
{
return new File (getAbsolutePath());
}
Index: java/io/FileDescriptor.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/FileDescriptor.java,v
retrieving revision 1.7
diff -u -r1.7 FileDescriptor.java
--- java/io/FileDescriptor.java 2001/08/02 23:46:39 1.7
+++ java/io/FileDescriptor.java 2001/08/31 22:06:20
@@ -43,6 +43,11 @@
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
{
Index: java/io/PipedWriter.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/PipedWriter.java,v
retrieving revision 1.6
diff -u -r1.6 PipedWriter.java
--- java/io/PipedWriter.java 2001/02/20 19:01:55 1.6
+++ java/io/PipedWriter.java 2001/08/31 22:06:21
@@ -104,9 +104,9 @@
* @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);
}
Index: java/util/Comparator.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/Comparator.java,v
retrieving revision 1.2
diff -u -r1.2 Comparator.java
--- java/util/Comparator.java 2001/02/15 06:43:00 1.2
+++ java/util/Comparator.java 2001/08/31 22:06:21
@@ -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 @@
* 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);
}