The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement

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.

Message:

TreeSet does not perform itself

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

I use TreeSet to contain objects.


PseudoCode:


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.








Replies:

Sponsored Links



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