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

Bob Lee openjdk at crazybob.org
Fri Feb 27 18:56:09 UTC 2009

On Fri, Feb 27, 2009 at 10:40 AM, David M. Lloyd <david.lloyd at redhat.com> wrote:
> Seems like a reasonable alternate approach, *however* I think there ought to
> be a way to clear the reference as well,

Do you have a use case?

*If* we wanted to support removals (I don't think we should), I would
do something like this:

 public class ClassLoader {
   public Reference<?> keepReferenceTo(Object o) { ... }

You could call clear() on the returned reference to clear the
ClassLoader's reference. Internally, it would use some sort of CAS
doubly-linked list.


More information about the core-libs-dev mailing list