-
Bug
-
Resolution: Fixed
-
P4
-
1.1.1
-
1.2beta4
-
generic
-
solaris_2.4
-
Not verified
java.net.URLConnection doesn't cache factory provided handlers.
URLConnection.getContentHandler() has a hashtable of content
handlers that have been found that it uses to save searching
for the same handler endlessly.
It also conveniently provides an interface to call a
URLContentHandlerFactory to search for a content handler.
Unfortunately any handler found by a provided factory is
not stored into the cache of content handlers. Only
handlers found by the default content handler search
are stored into that cache.
This doesn't cause any obvious failures. When a factory
is provided it's handlers are used. The main problem is
a performance issue. The factory is called at every
call to getContentHandler() to generally return the
same content handler over and over again.
Simple fix in suggested-fix.
URLConnection.getContentHandler() has a hashtable of content
handlers that have been found that it uses to save searching
for the same handler endlessly.
It also conveniently provides an interface to call a
URLContentHandlerFactory to search for a content handler.
Unfortunately any handler found by a provided factory is
not stored into the cache of content handlers. Only
handlers found by the default content handler search
are stored into that cache.
This doesn't cause any obvious failures. When a factory
is provided it's handlers are used. The main problem is
a performance issue. The factory is called at every
call to getContentHandler() to generally return the
same content handler over and over again.
Simple fix in suggested-fix.