View Javadoc
1   /*
2    * MIT License
3    * Copyright (c) 2006-2025 JMockit developers
4    * See LICENSE file for full license text.
5    */
6   package mockit.asm.constantPool;
7   
8   import static mockit.asm.constantPool.TypeTableItem.SpecialType.NORMAL;
9   
10  import edu.umd.cs.findbugs.annotations.NonNull;
11  
12  import org.checkerframework.checker.index.qual.NonNegative;
13  
14  final class NormalTypeTableItem extends TypeTableItem {
15      NormalTypeTableItem() {
16          type = NORMAL;
17      }
18  
19      NormalTypeTableItem(@NonNegative int index, @NonNull NormalTypeTableItem item) {
20          super(index, item);
21      }
22  
23      /**
24       * Sets the type of this normal type table item.
25       *
26       * @param type
27       *            the internal name to be added to the type table.
28       */
29      void set(@NonNull String type) {
30          typeDesc = type;
31          setHashCode(type.hashCode());
32      }
33  
34      @Override
35      boolean isEqualTo(@NonNull Item item) {
36          return ((TypeTableItem) item).typeDesc.equals(typeDesc);
37      }
38  }