[Soot-list] bug with makeAllocNode?

Patrick Lam plam at cs.mcgill.ca
Mon Dec 7 14:07:42 EST 2009


Patrick Lam wrote:
> I looked at the implementation of equals() in JNewExpr, and that should
> never happen. Actually, JNewExpr delegates to AbstractNewExpr.equivTo,
> which is:
> 
>     public boolean equivTo(Object o)
>     {
>         if (o instanceof AbstractNewExpr)
>         {
>             AbstractNewExpr ae = (AbstractNewExpr)o;
>             return type.equals(ae.type);
>         }
>         return false;
>     }
> 
> so it should only return true for new statements with the same type,
> unless there's a bug in the equals() method for type.

Let me just clarify that JNewExpr has no equals() implementation, so it
uses the default Java equals() implementation, which is object equality.
JNewExpr also inherits equivTo() from AbstractNewExpr. equivTo() should
not be relevant for maps.

pat



More information about the Soot-list mailing list