From 8c754b9197ad1c39505a47854119f64276a4b22f Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Wed, 22 Oct 2003 08:47:12 +0000 Subject: [PATCH] 2003-10-22 Michael Koch * java/io/File.java (equals): Removed redundant obj == null check. (createTempFile): Merged comments from classpath. From-SVN: r72790 --- libjava/ChangeLog | 6 ++++++ libjava/java/io/File.java | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index aa3f79ec8c39..7f53a3625640 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2003-10-22 Michael Koch + + * java/io/File.java + (equals): Removed redundant obj == null check. + (createTempFile): Merged comments from classpath. + 2003-10-21 Sascha Brawer Fix for bug #2944, reported by David Holmes diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index 4800ba15c18e..b4951ecc8067 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -111,7 +111,7 @@ public class File implements Serializable, Comparable * is taken from the path.separator system property. */ public static final char pathSeparatorChar = pathSeparator.charAt(0); - + static final String tmpdir = System.getProperty("java.io.tmpdir"); static int maxPathLen; static boolean caseSensitive; @@ -246,9 +246,6 @@ public class File implements Serializable, Comparable */ public boolean equals (Object obj) { - if (obj == null) - return false; - if (! (obj instanceof File)) return false; @@ -1006,10 +1003,11 @@ public class File implements Serializable, Comparable + " 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";