Nathan Bubna wrote:
> shouldn't calling equals() itself be done before *anything* else? is there
> any real case where that would true, yet we'd want to return a different
> result?
> ...
> it seems to me you only need to look at the class of the objects and/or do
> conversions if equals() is false.
good point.
if (left.equals(right))
{
return true;
}
else if (left.getClass().equals( right.getClass() ) )
{
// same class but we already know they're !=
return false;
}
// equals fails, not same class,
// so continue to TemplateNumber, Number, then finally log error
John Allison
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]