This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: fix PR 25389
- From: Tom Tromey <tromey at redhat dot com>
- To: classpath-patches at gnu dot org
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 14 Dec 2005 10:26:39 -0700
- Subject: Patch: FYI: fix PR 25389
- Reply-to: tromey at redhat dot com
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 <tromey@redhat.com>
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);
}
/**