This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: java.io.File
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 22 Oct 2003 10:54:58 +0200
- Subject: FYI: Patch: java.io.File
Hi list,
I commited the attached patch to merge java.io.File a little bit more with
classpath. It removes a redundant check in java.io.File.equals() and merges
two comments in java.io.File.createTempFile().
Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2286
diff -u -b -B -r1.2286 ChangeLog
--- ChangeLog 21 Oct 2003 13:25:45 -0000 1.2286
+++ ChangeLog 22 Oct 2003 08:44:05 -0000
@@ -1,3 +1,9 @@
+2003-10-22 Michael Koch <konqueror@gmx.de>
+
+ * java/io/File.java
+ (equals): Removed redundant obj == null check.
+ (createTempFile): Merged comments from classpath.
+
2003-10-21 Sascha Brawer <brawer@dandelis.ch>
Fix for bug #2944, reported by David Holmes <dholmes@dltech.com.au>
Index: java/io/File.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/File.java,v
retrieving revision 1.36
diff -u -b -B -r1.36 File.java
--- java/io/File.java 13 Oct 2003 05:54:42 -0000 1.36
+++ java/io/File.java 22 Oct 2003 08:44:06 -0000
@@ -246,9 +246,6 @@
*/
public boolean equals (Object obj)
{
- if (obj == null)
- return false;
-
if (! (obj instanceof File))
return false;
@@ -1006,10 +1003,11 @@
+ " is not really a directory.");
}
- // Now process the prefix and suffix.
+ // Check if prefix is at least 3 characters long
if (prefix.length() < 3)
throw new IllegalArgumentException ("Prefix too short: " + prefix);
+ // Set default value of suffix
if (suffix == null)
suffix = ".tmp";