[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fwd: Equality of Locals in Soot Version 1.beta.4]



James C. Corbett wrote:
>
> >From beta.3 to beta.4, the definition of equals() for Locals seems to
> have changed.  In beta.3, Locals were not equal() unless they were the
> same Local, while in beta.4, Locals seems to test equal() if they have
> the same name, even if they are distinct locals in different methods.
>
> Was there a reason for this change?
>
> I am storing Locals in a Hashtable (using the Local as the key), but
> the change in equals() breaks this.  I could generate a unique key for
> a Local from the names of the class, method, and local, but I'm
> wondering if this is a bug?
 
 Hmmm, you're storing locals from different methods in the same table
 right?
 
 We should probably reserve equals() for object equality and introduce a
 separate method to test for structural identity.  Like... hmmmm...
 isIdenticalTo()  How does that sound? (what do other people think?)
 
 Raja


James C. Corbett wrote:
> 
> >From beta.3 to beta.4, the definition of equals() for Locals seems to
> have changed.  In beta.3, Locals were not equal() unless they were the
> same Local, while in beta.4, Locals seems to test equal() if they have
> the same name, even if they are distinct locals in different methods.
> 
> Was there a reason for this change?
> 
> I am storing Locals in a Hashtable (using the Local as the key), but
> the change in equals() breaks this.  I could generate a unique key for
> a Local from the names of the class, method, and local, but I'm
> wondering if this is a bug?

Hmmm, you're storing locals from different methods in the same table
right? 

We should probably reserve equals() for object equality and introduce a
separate method to test for structural identity.  Like... hmmmm...
isIdenticalTo()  How does that sound?


RAja