-
1. Re: default equals() doesn't behave as expected for javaBean
matt.drees Apr 26, 2007 11:32 AM (in response to matt.drees)Oops, the collection stuff was leftovers from earlier when I had
assert pingSet.contains(ping);
which also fails. -
2. Re: default equals() doesn't behave as expected for javaBean
fhh Apr 26, 2007 1:33 PM (in response to matt.drees)The default equals method (of Object) checks if the objects are identical and returns false otherwise. So this behaviour is to be expected.
Overwrite equals() to get the behaviour you want.
Regards
Felix -
3. Re: default equals() doesn't behave as expected for javaBean
matt.drees Apr 26, 2007 1:45 PM (in response to matt.drees)It seems you shouldn't have to override equals() to get reflexive equality.
Like I said, maybe it's not a bug, but it sure as heck has the potential to cause confusion.
-Matt -
4. Re: default equals() doesn't behave as expected for javaBean
pmuir Apr 26, 2007 5:16 PM (in response to matt.drees)Matt, can you file an issue - I'm not sure if its something thats improvable on, but if there is an issue then hopefully Gavin can take a look when he's less busy :)
-
5. Re: default equals() doesn't behave as expected for javaBean
matt.drees Apr 26, 2007 5:30 PM (in response to matt.drees)No problem.
http://jira.jboss.com/jira/browse/JBSEAM-1257
Thanks Pete. -
6. Re: default equals() doesn't behave as expected for javaBean
sammy8306 Apr 28, 2007 3:16 PM (in response to matt.drees)Just a thought: wouldn't it be enough to let equals check the defined component name and scope for equality? That assumes that the name/scope pair is unique to the object and immutable, which holds as far as I can see?