Index: java/io/File.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/io/File.java,v retrieving revision 1.45 diff -u -r1.45 File.java --- java/io/File.java 5 May 2004 11:13:40 -0000 1.45 +++ java/io/File.java 7 May 2004 08:01:39 -0000 @@ -295,18 +295,20 @@ */ public File(File directory, String name) { - if (directory == null) - { - String dirname = System.getProperty("user.dir"); - if (dirname == null) - throw new IllegalArgumentException - ("Cannot determine default user directory"); + if (name == null) + throw new NullPointerException("filename is null"); - directory = new File(dirname); - } + String dirpath; + + if (directory == null) + dirpath = ""; + else if (directory.getPath() == "") + dirpath = "/"; + else + dirpath = directory.getPath(); - String dirpath = directory.path; - if (PlatformHelper.isRootDirectory(dirpath)) + if (PlatformHelper.isRootDirectory(dirpath) + || dirpath.equals("")) path = dirpath + name; else path = dirpath + separator + name;