classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: FYI: fix PR 25389


From: Tom Tromey
Subject: [cp-patches] Patch: FYI: fix PR 25389
Date: 14 Dec 2005 10:26:39 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

I'm checking this in to Classpath and libgcj 4.1 and trunk.

This fixes PR 25389, which was discovered by OO.o.  We were throwing
an NPE when we saw a non-hierarchical URI in the File constructor.
Instead we should be throwing an IllegalArgumentException.

I've updated the Mauve test to reflect this.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

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

Index: java/io/File.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/io/File.java,v
retrieving revision 1.59
diff -u -r1.59 File.java
--- java/io/File.java   6 Nov 2005 20:28:00 -0000       1.59
+++ java/io/File.java   14 Dec 2005 17:28:28 -0000
@@ -406,7 +406,11 @@
     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);
   }
 
   /**




reply via email to

[Prev in Thread] Current Thread [Next in Thread]