1 package mockit.asm.constantPool;
2
3 import static mockit.asm.constantPool.TypeTableItem.SpecialType.MERGED;
4
5 import edu.umd.cs.findbugs.annotations.NonNull;
6
7 import org.checkerframework.checker.index.qual.NonNegative;
8
9 final class MergedTypeTableItem extends TypeTableItem {
10 private int type1;
11 private int type2;
12 @NonNegative
13 int commonSuperTypeIndex;
14
15 MergedTypeTableItem() {
16 type = MERGED;
17 }
18
19 MergedTypeTableItem(@NonNull MergedTypeTableItem item) {
20 super(0, item);
21 type1 = item.type1;
22 type2 = item.type2;
23 commonSuperTypeIndex = item.commonSuperTypeIndex;
24 }
25
26
27
28
29
30
31
32
33
34 void set(@NonNegative int type1, @NonNegative int type2) {
35 this.type1 = type1;
36 this.type2 = type2;
37 setHashCode(type1 + type2);
38 }
39
40 @Override
41 boolean isEqualTo(@NonNull Item item) {
42 MergedTypeTableItem other = (MergedTypeTableItem) item;
43 return other.type1 == type1 && other.type2 == type2;
44 }
45 }