I want to override the equals method of a common ancestor class so it will
compare two subtypes for equality regardless of what subtype they are. I
noticed that when I replace this code:

        if (getClass() != obj.getClass()) {
            return false;
        }
        final Referent<S,C_IN,_C,I>other = (Referent<S,C_IN,_C,I>) obj;

With this code:

        Referent<S,C_IN,_C,I>other;
        try{
            other=(Referent<S,C_IN,_C,I>) obj;
        }catch(ClassCastException x){return false;}

However, I get the warning in the title of this email.

I don't think this warning is correct. Who is right; me or NB 11?

Thanks,

  Owen.

Reply via email to