[cp-patches] [RFA/JDWP] IdManager

Keith Seitz keiths@redhat.com
Tue Jun 21 18:19:00 GMT 2005


On Mon, 2005-06-20 at 13:48 -0500, Archie Cobbs wrote:
> > "Uniquely identifies a reference type in the target VM. It should not be
> > assumed that for a particular class, the classObjectID and the
> > referenceTypeID are the same. A particular reference type will be
> > identified by exactly one ID in JDWP commands and replies throughout its
> > lifetime A referenceTypeID is not reused to identify a different
> > reference type, regardless of whether the referenced class has been
> > unloaded."
> 
> This seems to only imply that whoever is creating ReferenceTypeID's
> must create a new and unique one every time, not that you need to
> cache them after the associated class has been unloaded... ?

So if a class is unloaded and then consequently reloaded, you read the
above to mean that it would still get a new ID (not the old one)?

I guess our interpretation of "lifetime" is a little different. For me,
lifetime was considered the lifetime of the type within the application.
For you, it's the lifetime of the class as it exists in the VM. So when
it is unloaded, it's ID goes stale.

I can buy that, especially given this tidbit:

> In any case, how is a class ever going to be unloaded if your
> Hashtable is referencing it? :-)

TRUE!

So now that mens that I'd have to use a similar strategy to what is done
for objects, which we're discussing somewhere else, I think...

Keith



More information about the Java-patches mailing list