PR classpath/25389:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Dec 2005 18:36:55 +0000 (18:36 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Dec 2005 18:36:55 +0000 (18:36 +0000)
* java/io/File.java (File): Throw IllegalArgumentException if URI is
non-hierarchical.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108528 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/io/File.java

index 0f7225b..bee1eb0 100644 (file)
@@ -1,3 +1,9 @@
+2005-12-14  Tom Tromey  <tromey@redhat.com>
+
+       PR classpath/25389:
+       * java/io/File.java (File): Throw IllegalArgumentException if URI is
+       non-hierarchical.
+
 2005-12-12  Andrew Haley  <aph@redhat.com>
 
        * java/lang/VMCompiler.java: Directly generate a new instance of
index 06c3215..e3d59cb 100644 (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);
   }
 
   /**