]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR classpath/25389 (File(new URI("file:./")) -> java.lang.NullPointerException)
authorTom Tromey <tromey@redhat.com>
Wed, 14 Dec 2005 18:36:55 +0000 (18:36 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 14 Dec 2005 18:36:55 +0000 (18:36 +0000)
PR classpath/25389:
* java/io/File.java (File): Throw IllegalArgumentException if URI is
non-hierarchical.

From-SVN: r108528

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

index 0f7225bf335b67876815787d60b836cb6d6a1462..bee1eb0d9071e35798d482721cc5d2a63f6a6fa6 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 06c321556f29d979172ff2071e2443990c733721..e3d59cb7d2465a03a0fe9169cc447feb5cbf04f7 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);
   }
 
   /**