The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


TreeSet does not perform itself

Posted by Fisher on June 27, 2001 at 6:02 AM

I use TreeSet to contain objects.


Object o = m_TreeSet.first();
boolean b = m_TreeSet.remove (o);
Object o1 = m_TreeSet.first();

After program runs some time, this piece of code does not do
what it should do, i.e. remove() return a false.
o (Object), which is not null, is not be removed from the container.
That is that o1 is the same as o.

Please help me to avoid this isue.

Thanks a lot.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us