mirror of
https://github.com/revanced/smali.git
synced 2025-05-28 11:50:12 +02:00
Added a hashCode and equals method, so that interning annotations that reference items works correctly
git-svn-id: https://smali.googlecode.com/svn/trunk@208 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
9f8be06898
commit
6ccb8b3d2b
@ -121,4 +121,23 @@ public class EncodedIndexedItemReference<T extends IndexedItem<T>>
|
||||
return valueType;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
if (item == null) {
|
||||
return 0;
|
||||
}
|
||||
return item.hashCode();
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof EncodedIndexedItemReference)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
EncodedIndexedItemReference other = (EncodedIndexedItemReference)o;
|
||||
if (item != null) {
|
||||
return item.equals(other.item);
|
||||
} else {
|
||||
return other.item == null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user