Replace == between class constants by ".equals"
This is needed since class constants may not be unique. Indeed, there
may be multiple identical class contants in the constant pool.
Bug: 16709921
(cherry picked from commit 8863d0fd24b293032a7e749e89b6f36524e0ff4f)
Change-Id: I63c07ebf03d67eb942aec6364c7e02c631744612
diff --git a/dx/src/com/android/dx/cf/code/RopperMachine.java b/dx/src/com/android/dx/cf/code/RopperMachine.java
index ea7d6ff..530295b 100644
--- a/dx/src/com/android/dx/cf/code/RopperMachine.java
+++ b/dx/src/com/android/dx/cf/code/RopperMachine.java
@@ -940,7 +940,7 @@
// NOTE: This is a slow O(n) loop, and can be replaced with a
// faster implementation (at the cost of higher memory usage)
// if it proves to be a hot area of code.
- if (ref.getDefiningClass() == method.getDefiningClass()) {
+ if (ref.getDefiningClass().equals(method.getDefiningClass())) {
for (int i = 0; i < methods.size(); ++i) {
final Method m = methods.get(i);
if (AccessFlags.isPrivate(m.getAccessFlags()) &&
@@ -960,7 +960,7 @@
*/
CstMethodRef ref = (CstMethodRef) cst;
if (ref.isInstanceInit() ||
- (ref.getDefiningClass() == method.getDefiningClass()) ||
+ (ref.getDefiningClass().equals(method.getDefiningClass())) ||
!method.getAccSuper()) {
return RegOps.INVOKE_DIRECT;
}