diff options
author | Tom Tromey <tromey@redhat.com> | 2005-12-14 18:36:55 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2005-12-14 18:36:55 +0000 |
commit | 3ce4312613bb39d065bb5d8d578d4c7f546d9ca7 (patch) | |
tree | ac9f7c38fbc0ddb4d6d0ff7c2ceaf0e2ed64431d /libjava/java/io/File.java | |
parent | 3165dcfa178f61532f04ed9aecfebac11547d8bd (diff) | |
download | gcc-3ce4312613bb39d065bb5d8d578d4c7f546d9ca7.zip gcc-3ce4312613bb39d065bb5d8d578d4c7f546d9ca7.tar.gz gcc-3ce4312613bb39d065bb5d8d578d4c7f546d9ca7.tar.bz2 |
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
Diffstat (limited to 'libjava/java/io/File.java')
-rw-r--r-- | libjava/java/io/File.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index 06c3215..e3d59cb 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -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); } /** |