[Pogamut-list] Bug in MessageObject.equals()

nvh pogamut-forum at artemis.ms.mff.cuni.cz
Tue Apr 21 17:54:46 CEST 2009


Re: Re: Bug in MessageObject.equals()

Author: nvh

> > ^return ((mo.ID == this.ID) && (mo.UnrealID.equals(this.UnrealID)) && (mo.type == this.type));^
> Actually, the correct code should be:
> ^return ((mo.ID == this.ID) && (this.UnrealID.equals(mo)) && (mo.type == this.type));^
> Slight difference, but otherwise it can throw a NullPointerException when compared with null.
> 
And even that is not correct, because I forgot the UnrealID part there :)
^return ((mo.ID == this.ID) && (this.UnrealID.equals(mo.UnrealID)) && (mo.type == this.type));^
is the correct one





More information about the Pogamut-list mailing list