java.net.URL bugs

Archie Cobbs archie at whistle.com
Wed Mar 24 18:22:23 PST 1999


Jules Bean writes:
> > I've tried to run under kaffe a program which works on Sun's JDK and on
> > the Linux porting for i386 (jdk1.1.7) and I've found several problems when
> > the program uses the java.net.URL class:
> > 1. the .equals() method reports a java.lang.NullPointerException (only if
> > I use Kaffe);
> > 2. if I use the  'new URL("http://myhost:5000")' a StringIndexOutOfBounds
> > exception is reported. This not happens if I use
> >       'new URL("http://myhost:5000/")'.
> 
> I'm a bit rushed to submit a patch just now, but I can see why these
> happen:
> 
> 1. This is because it compares protocol, host, file, ref, etc. without
> considering that they might be null.
> 
> 2. The init code doesn't account for this case.  It assumes no second
> slash - probably correctly, by the URL spec, but the behavious should
> probably assume that the whole rest of the string is the port, if no slash
> is found.

OK, I've fixed these two glitches (hopefully). Please update from CVS
and see how it works.

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


More information about the kaffe mailing list