You need to override the equals method on Proposition : ( Collections
use the equals method to check for equality )
You have to take care when you override the equals method that you
implement the contract of the equals method properly... ( Check the
JavaDoc on java.lang.Object )...
If you don't... you get some VERY funky behaviour on collections... :)
.... this SHOULD implement the contract of equals() correctly... just
give it another pair of eyballs...
public boolean equals( Object o ) {
if ( ! o instanceof Proposition ) {
return false;
}
if ( o == null ) {
return false;
}
return ObjectUtils.equals(getName(),other.getName());
}
ObjectUtils is part of commons-lang and takes care of all the
additional null checking...
The lazy developers friend.. :):):)
Cheers,
Renier
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CTJUG Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/CTJUG-Forum
For the ctjug home page see http://www.ctjug.org.za
-~----------~----~----~----~------~----~------~--~---