[kaffe] CVS kaffe (dalibor): Resynced with GNU Classpath: URLStreamHandler

Kaffe CVS cvs-commits at kaffe.org
Sun Jul 11 21:27:43 PDT 2004


PatchSet 4945 
Date: 2004/07/12 04:21:57
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: URLStreamHandler

2004-07-11  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/java/net/URLStreamHandler.java:
        Resynced with GNU Classpath.

        2004-07-11  Mohan Embar  <gnustuff at thisiscool.com>

        * java/net/URLStreamHandler.java (parseURL): Canonicalize
        file portion of URL in addition to spec for file: protocol.

        2004-07-01  Mark Wielaard  <mark at klomp.org>

        Reported by Roman Kennke <roman at ontographics.com> (bug #9331)
        * java/net/URLStreamHandler.java (parseURL): When url file part
        doesn't contain a '/' just ignore context.

Members: 
	ChangeLog:1.2510->1.2511 
	libraries/javalib/java/net/URLStreamHandler.java:1.18->1.19 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2510 kaffe/ChangeLog:1.2511
--- kaffe/ChangeLog:1.2510	Mon Jul 12 04:11:27 2004
+++ kaffe/ChangeLog	Mon Jul 12 04:21:57 2004
@@ -14,6 +14,22 @@
 
 2004-07-11  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/java/net/URLStreamHandler.java:
+	Resynced with GNU Classpath.
+
+	2004-07-11  Mohan Embar  <gnustuff at thisiscool.com>
+
+        * java/net/URLStreamHandler.java (parseURL): Canonicalize
+        file portion of URL in addition to spec for file: protocol.
+
+	2004-07-01  Mark Wielaard  <mark at klomp.org>
+
+        Reported by Roman Kennke <roman at ontographics.com> (bug #9331)
+        * java/net/URLStreamHandler.java (parseURL): When url file part
+        doesn't contain a '/' just ignore context.
+
+2004-07-11  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/javalib/java/io/FilePermission.java:
 	Resynced with GNU Classpath.
 
Index: kaffe/libraries/javalib/java/net/URLStreamHandler.java
diff -u kaffe/libraries/javalib/java/net/URLStreamHandler.java:1.18 kaffe/libraries/javalib/java/net/URLStreamHandler.java:1.19
--- kaffe/libraries/javalib/java/net/URLStreamHandler.java:1.18	Mon May 17 22:25:08 2004
+++ kaffe/libraries/javalib/java/net/URLStreamHandler.java	Mon Jul 12 04:22:00 2004
@@ -1,5 +1,5 @@
 /* URLStreamHandler.java -- Abstract superclass for all protocol handlers
-   Copyright (C) 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -131,8 +131,12 @@
     String query = null;
     
     // On Windows we need to change \ to / for file URLs
-    if (url.getProtocol().equals("file"))
-      spec = spec.replace(File.separatorChar, '/');
+    char separator = File.separatorChar;
+    if (url.getProtocol().equals("file") && separator != '/')
+      {
+	file = file.replace(separator, '/');
+	spec = spec.replace(separator, '/');
+      }
 
     if (spec.regionMatches(start, "//", 0, 2))
       {
@@ -204,9 +208,11 @@
       {
 	// Context is available, but only override it if there is a new file.
 	int lastSlash = file.lastIndexOf('/');
-
-	file =
-	  file.substring(0, lastSlash) + '/' + spec.substring(start, end);
+	if (lastSlash < 0)
+	  file = spec.substring(start, end);
+	else
+	  file = (file.substring(0, lastSlash)
+		  + '/' + spec.substring(start, end));
 
 	if (url.getProtocol().equals("file"))
 	  {
@@ -216,7 +222,7 @@
 	      {
 		boolean endsWithSlash = file.charAt(file.length() - 1) == '/';
 		file = new File(file).getCanonicalPath();
-		file = file.replace(File.separatorChar, '/');
+		file = file.replace(separator, '/');
 		if (endsWithSlash && file.charAt(file.length() - 1) != '/')
 		  file += '/';
 	      }




More information about the kaffe mailing list