[kaffe] Bug Report: Incorrect parsing of host

Elliotte Rusty Harold elharo at metalab.unc.edu
Mon Oct 27 14:32:02 PST 2003


Kaffe 1.1.2 is not correctly parsing the host out of URLs that 
include user names and passwords such as 
ftp://anonymous:anonymous@wuarchive.wustl.edu/
It reports the username as the host.

Code follows

import java.io.*;
import java.net.*;

public class Test {

   public static void main(String[] args)
     throws Exception {
      URL u = new URL("ftp://anonymous:anonymous@wuarchive.wustl.edu/");
      String host = u.getHost();
      System.out.println(host);
   }

}

-- 

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Processing XML with Java (Addison-Wesley, 2002)
   http://www.cafeconleche.org/books/xmljava
   http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA




More information about the kaffe mailing list