Always use .equals for comparing RegisterType instances

This commit is contained in:
Ben Gruver
2013-04-08 20:27:35 -07:00
parent d87770e69b
commit 3f05570b6b
10 changed files with 51 additions and 38 deletions

View File

@ -176,7 +176,7 @@ public class AnalyzedInstruction implements Comparable<AnalyzedInstruction> {
RegisterType oldRegisterType = preRegisterMap[registerNumber];
RegisterType mergedRegisterType = oldRegisterType.merge(registerType);
if (mergedRegisterType == oldRegisterType) {
if (mergedRegisterType.equals(oldRegisterType)) {
return false;
}
@ -218,7 +218,7 @@ public class AnalyzedInstruction implements Comparable<AnalyzedInstruction> {
assert registerType != null;
RegisterType oldRegisterType = postRegisterMap[registerNumber];
if (oldRegisterType == registerType) {
if (oldRegisterType.equals(registerType)) {
return false;
}
@ -277,7 +277,7 @@ public class AnalyzedInstruction implements Comparable<AnalyzedInstruction> {
return false;
}
//check if the uninit ref has been copied to another register
if (getPreInstructionRegisterType(registerNumber) == preInstructionDestRegisterType) {
if (getPreInstructionRegisterType(registerNumber).equals(preInstructionDestRegisterType)) {
return true;
}
return false;

View File

@ -1253,7 +1253,7 @@ public class MethodAnalyzer {
if (preInstructionRegisterType.category == RegisterType.UNINIT_REF ||
preInstructionRegisterType.category == RegisterType.UNINIT_THIS) {
RegisterType registerType;
if (preInstructionRegisterType == objectRegisterType) {
if (preInstructionRegisterType.equals(objectRegisterType)) {
registerType = analyzedInstruction.postRegisterMap[objectRegister];
} else {
registerType = preInstructionRegisterType;

View File

@ -264,7 +264,7 @@ public class RegisterType {
@Nonnull
public RegisterType merge(@Nonnull RegisterType other) {
if (other == this) {
if (other.equals(this)) {
return this;
}