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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to