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