RFC: Merge java.net.URL

Gary Benson gbenson@redhat.com
Tue Jan 9 14:17:00 GMT 2007


Andrew Haley wrote:
> Gary Benson writes:
> > I'm planning on removing GCJ'S customized java.net.URL after the
> > branch gets merged (with something like the attached patch) but
> > there's one bit I want to check.  GCJ's URL.getURLStreamHandler()
> > has special cases for "file://" and "core://" URLs with this note:
> > 
> >   This is an interesting case.  It's tempting to think that we
> >   could call Class.forName ("gnu.java.net.protocol.file.Handler")
> >   to get the appropriate class.  Unfortunately, if we do that
> >   the program will never terminate, because getURLStreamHandler
> >   is eventually called by Class.forName.
> 
> The handler for "core" has nothing to do with that note; it's a
> separate case.

The note continues:

  Treating "file" as a special case is the minimum that will fix this
  problem.  If other protocols are required in a statically linked
  application they will need to be handled in the same way as "file".

I presumed that the "core" handler was done in this way because it
will definitly be required in a statically linked application.
  
> > The special cases are six years old, and GCJ seems to run fine
> > without them, passing make check, etc, but I wanted to see if
> > anyone knows of special weird cases in which this could break.
> 
> Well, are you suggesting we remove the "core" protocaol altogether?

No, not at all.  I'm suggesting we remove the special case for
creating core URLStreamHandlers.

Cheers,
Gary



More information about the Java-patches mailing list