re PR classpath/25389 (File(new URI("file:./")) -> java.lang.NullPointerException)

PR classpath/25389:
	* java/io/File.java (File): Throw IllegalArgumentException if URI is
	non-hierarchical.

From-SVN: r108528
This commit is contained in:
Tom Tromey 2005-12-14 18:36:55 +00:00 committed by Tom Tromey
parent 3165dcfa17
commit 3ce4312613
2 changed files with 11 additions and 1 deletions

View file

@ -434,7 +434,11 @@ public class File implements Serializable, Comparable
if (!uri.getScheme().equals("file"))
throw new IllegalArgumentException("invalid uri protocol");
path = normalizePath(uri.getPath());
String name = uri.getPath();
if (name == null)
throw new IllegalArgumentException("URI \"" + uri
+ "\" is not hierarchical");
path = normalizePath(name);
}
/**