This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: java.net.URL question
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Michael Koch <konqueror at gmx dot de>
- Cc: java at gcc dot gnu dot org
- Date: Sat, 27 Sep 2003 09:29:51 -0400 (EDT)
- Subject: Re: java.net.URL question
On Sat, 27 Sep 2003, Michael Koch wrote:
> I'm currently trying to merge java.net.URL with classpath.
> Unfortunately both use little different strategies when caching
> URLStreamHandlers. libgcj caches the handlers themself and directly
> return them on request. Classpath stores Class objects of the
> handlers into its cache and creates a new instance when a handler for
> a cached protocol is requested.
Given that all the handlers are stateless, the two approaches should be
equivalent, though libgcj seems a little simpler and slightly more
efficient.
(Note that the cache itself might as well be a HashMap instead of
Hashtable. All accesses to it are through getURLStreamHandler which is
already synchronized.)
Jeff