Hi !
I'm struggling with a problem I don't understand, my equalsBuilder's
isEquals seem to return false when dealing with Longs :
I have a bean class UiTheme, with a property private Long id.
The following equals builder will return false when this.id = 1 and
rhs.id = 1 :
public boolean equals(Object object) {
if (!(object instanceof UiTheme)) {
return false;
}
UiTheme rhs = (UiTheme) object;
return new
EqualsBuilder().appendSuper(super.equals(object)).append(this.id,
rhs.id).isEquals();
}
If I manually do the equality, as in this.id.equals(rhs.id), then it
is true (because, well... 1 = 1 !)
If I do an equality like this.id == rhs.id, then it is false (being a
Java newbie... maybe it should be false, not sure if doing == instead
of equals(obj) is correct with Longs)
So I assume (am I wrong ?) that equalsBuilder's isEquals uses "=="
instead of "equals(obj)"... but I really, really don't understand why.
Can anyone enlighten me ?
thanks !
--
<a href="http://in-pocket.blogspot.com">http://in-pocket.blogspot.com
- Mobile world, technology and more</a>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]