make SSAInstruction.equals() consistently use ==
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1047 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
8c2927636c
commit
a03a4accd8
|
@ -70,15 +70,6 @@ public class SSAConditionalBranchInstruction extends SSAInstruction {
|
|||
return 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
return this == obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see com.ibm.wala.ssa.SSAInstruction#getUse(int)
|
||||
*/
|
||||
|
|
|
@ -96,7 +96,7 @@ public class SSAGetInstruction extends SSAFieldAccessInstruction {
|
|||
}
|
||||
|
||||
public int hashCode() {
|
||||
return result * 2371 ^ 6521;
|
||||
return result * 2371 + 6521;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -257,7 +257,7 @@ public abstract class SSAInstruction implements IInstruction {
|
|||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
public final boolean equals(Object obj) {
|
||||
return this == obj;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,19 +134,4 @@ public class SSAInvokeInstruction extends SSAAbstractInvokeInstruction {
|
|||
public Collection<TypeReference> getExceptionTypes() {
|
||||
return Exceptions.getNullPointerException();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof SSAInvokeInstruction) {
|
||||
SSAInvokeInstruction other = (SSAInvokeInstruction) obj;
|
||||
return site.equals(other.site) && result == other.result;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -158,19 +158,4 @@ public class SSANewInstruction extends SSAInstruction {
|
|||
public Collection<TypeReference> getExceptionTypes() {
|
||||
return site.getDeclaredType().isArrayType() ? Exceptions.getNewArrayExceptions() : Exceptions.getNewScalarExceptions();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
public boolean equals(Object arg0) {
|
||||
if (arg0 instanceof SSANewInstruction) {
|
||||
SSANewInstruction other = (SSANewInstruction) arg0;
|
||||
return result == other.result && site.equals(other.site);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue