You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by MatÃas Giovannini <ma...@k-bell.com> on 2003/07/01 18:56:07 UTC
Re: Velocity Numerics : TemplateNumber
On Thursday, June 26, 2003, at 05:43 PM, John J. Allison wrote:
> 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
Actually, equality must test from most particular to most general. In
fact, if the class being tested happens to be a TemplateNumber (I'm not
clear to which class does this method belong), the head call to
equals() would result in infinite recursion, wouldn't it?
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org