From: Dain S. <da...@da...> - 2002-05-13 21:15:01
|
> Here is hashCode function (the same in UserPK and ResourceOwnerPK): > public int hashCode() { > if( _hashCode == Integer.MIN_VALUE ) > _hashCode += this.username.hashCode(); // line 59 > return _hashCode; > } this.username is null. Do you have this field in both classes, so you have a shadowed field. By the way, this is a dangerous hash function as when the pk is serialized the hashCode will be reset to 0 not Integer.MIN_VALUE assuming it is marked a transient. Also check that you implemented equals correctly. You must check for an exact type match first. -dain -- xxxxxxxxxxxxxxxxxxxxxxxxx Dain Sundstrom Chief Architect, JBossCMP JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxxx |