aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/io/File.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-12-14 18:36:55 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-12-14 18:36:55 +0000
commit3ce4312613bb39d065bb5d8d578d4c7f546d9ca7 (patch)
treeac9f7c38fbc0ddb4d6d0ff7c2ceaf0e2ed64431d /libjava/java/io/File.java
parent3165dcfa178f61532f04ed9aecfebac11547d8bd (diff)
downloadgcc-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.java6
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);
}
/**