public boolean equals(Object obj) { /* * TODO It might be a potential problem to use LockEdges in HashMaps * since they are mutable and this equals method depends on them? */ try { LockEdge other = (LockEdge) obj; return (mTarget.getLockId() == other.mTarget.getLockId()) && (mSource.getLockId() == other.mSource.getLockId()) && (mThreadId == other.mThreadId) && (mSourceContextId == other.mSourceContextId) && (mTargetContextId == other.mTargetContextId); } catch (Exception e) { return false; } }
public int hashCode() { // TODO Improve hashCode algorithm to improve performance? return mTarget.getLockId() + mSource.getLockId(); }