File.java (File(String, String)): For dirPath, treat an empty String the same as `null'.

2000-02-27  Bryce McKinlay  <bryce@albatross.co.nz>

       * java/io/File.java (File(String, String)): For dirPath, treat an
       empty String the same as `null'.

From-SVN: r32217
This commit is contained in:
Bryce McKinlay 2000-02-27 10:43:47 +00:00 committed by Bryce McKinlay
parent 5d112ff366
commit 91da35dbf2
2 changed files with 6 additions and 1 deletions

View file

@ -79,7 +79,7 @@ public class File implements Serializable
{
if (name == null)
throw new NullPointerException ();
if (dirPath != null)
if (dirPath != null && dirPath.length() > 0)
{
// Try to be smart about the number of separator characters.
if (dirPath.charAt(dirPath.length() - 1) == separatorChar)