[PATCH 0/2] Class- and class loader-local storage (Bug ID #6493635)

Bob Lee openjdk at crazybob.org
Fri Feb 27 20:18:35 UTC 2009


On Fri, Feb 27, 2009 at 11:44 AM, David M. Lloyd <david.lloyd at redhat.com> wrote:
> WeakHashMap<Class<?>, Externalizer>()
>
> *fails* because Externalizer instances are usually customized to the class
> they externalize (which, by the way, could well be a system class).  This
> means that Externalizer keeps a strong ref to the Class after all.

If the class is from a parent class loader, you should just keep a
strong reference to the data and not use
ClassLoader.keepReferenceTo().

Bob



More information about the core-libs-dev mailing list