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:
sjfink 2007-05-03 17:26:31 +00:00
parent 8c2927636c
commit a03a4accd8
5 changed files with 2 additions and 41 deletions

View File

@ -70,15 +70,6 @@ public class SSAConditionalBranchInstruction extends SSAInstruction {
return 2; 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) * @see com.ibm.wala.ssa.SSAInstruction#getUse(int)
*/ */

View File

@ -96,7 +96,7 @@ public class SSAGetInstruction extends SSAFieldAccessInstruction {
} }
public int hashCode() { public int hashCode() {
return result * 2371 ^ 6521; return result * 2371 + 6521;
} }
/* /*

View File

@ -257,7 +257,7 @@ public abstract class SSAInstruction implements IInstruction {
* *
* @see java.lang.Object#equals(java.lang.Object) * @see java.lang.Object#equals(java.lang.Object)
*/ */
public boolean equals(Object obj) { public final boolean equals(Object obj) {
return this == obj; return this == obj;
} }
} }

View File

@ -134,19 +134,4 @@ public class SSAInvokeInstruction extends SSAAbstractInvokeInstruction {
public Collection<TypeReference> getExceptionTypes() { public Collection<TypeReference> getExceptionTypes() {
return Exceptions.getNullPointerException(); 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;
}
}
} }

View File

@ -158,19 +158,4 @@ public class SSANewInstruction extends SSAInstruction {
public Collection<TypeReference> getExceptionTypes() { public Collection<TypeReference> getExceptionTypes() {
return site.getDeclaredType().isArrayType() ? Exceptions.getNewArrayExceptions() : Exceptions.getNewScalarExceptions(); 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;
}
}
} }