This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]