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