java.net.URL question
Jeff Sturm
jsturm@one-point.com
Sun Sep 28 10:58:00 GMT 2003
On 2003年9月27日, 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
More information about the Java
mailing list