Hello, I have found another problem in URL.java.

Here is a patch that should throw MalformedURLException in
Constructor.

Index: URL.java
===================================================================
RCS file: /home/cvspublic/kaffe/libraries/javalib/java/net/URL.java,v
retrieving revision 1.11
diff -u -r1.11 URL.java
--- URL.java    1999/03/25 03:26:07     1.11
+++ URL.java    1999/03/25 05:38:26
@@ -102,6 +102,7 @@
                        file = "";
                }
        }
+       handler = getURLStreamHandler(protocol);
 //System.out.println("URL = " + this);
 }
 
@@ -117,6 +118,7 @@
        this.host = host;
        this.file = file;
        this.port = port;
+       handler = getURLStreamHandler(protocol);
 }
 
 public URL(URL context, String spec) throws MalformedURLException {
@@ -179,7 +181,7 @@
                return (handler);
        }
 
-       throw new MalformedURLException("failed to find handler");
+       throw new MalformedURLException("unknown protocol: " + protocol);
 }
 
 public int hashCode() {
@@ -213,9 +215,6 @@
 
 public URLConnection openConnection() throws IOException {
        if (conn == null) {
-               if (handler == null) {
-                       handler = getURLStreamHandler(protocol);
-               }
                conn = handler.openConnection(this);
                conn.connect();
        }

--
// YAMAGUCHI Yuji - [EMAIL PROTECTED] -
// Freeware Distribution Services Co.,Ltd.

Reply via email to