Commit 96e96331 authored by Lubomir Bulej's avatar Lubomir Bulej

ShadowObject: use the whole object tag (a.k.a. net reference) instead of just...

ShadowObject: use the whole object tag (a.k.a. net reference) instead of just object id to compare for equality.
ShadowObject: simplify the hash code calculation.
parent 5572da1d
......@@ -72,17 +72,16 @@ public class ShadowObject implements Formattable {
// only object id considered
// TODO consider also the class ID
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (shadowId ^ (shadowId >>> 32));
return result;
return 31 + (int) (shadowId ^ (shadowId >>> 32));
}
@Override
public boolean equals(Object obj) {
if (obj instanceof ShadowObject) {
return shadowId == ((ShadowObject) obj).shadowId;
final ShadowObject that = (ShadowObject) obj;
return this.netRef == that.netRef;
}
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment