orphan objects
From: Tom (tom.cowdery_at_bigfoot.com)
Date: 11/26/03
- Next message: Spif: "java does not run"
- Previous message: dd: "Need somebody to do some java work for me"
- Next in thread: Eric Sosman: "Re: orphan objects"
- Reply: Eric Sosman: "Re: orphan objects"
- Reply: Christophe Vanfleteren: "Re: orphan objects"
- Reply: Chris Smith: "Re: orphan objects"
- Reply: Fu, Ren-Li: "Re: orphan objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 Nov 2003 11:46:19 -0800
Suppose that you have code along the lines of what is shown below:
SomeObject x = new SomeObject();
SomeCollection coll = new SomeCollection(); //might be a Vector,
ArrayList, etc.
coll.add(x);
x = new SomeObject(); //occurs AFTER x is added to the collection
At this point, the object that was added to the collection is what I
mean by an orphan object. The reference 'x' no longer points to it,
but it isn't garbage either. It lives on as an anonymous object in
the Collection.
Obviously, coll.remove(x); won't work any more since x no longer
points to the original object.
Is there any way to identify which element is an orphan so it could be
removed from the Collection?
- Next message: Spif: "java does not run"
- Previous message: dd: "Need somebody to do some java work for me"
- Next in thread: Eric Sosman: "Re: orphan objects"
- Reply: Eric Sosman: "Re: orphan objects"
- Reply: Christophe Vanfleteren: "Re: orphan objects"
- Reply: Chris Smith: "Re: orphan objects"
- Reply: Fu, Ren-Li: "Re: orphan objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]