View Javadoc
1   package mockit.asm.constantPool;
2   
3   import static mockit.asm.jvmConstants.ConstantPoolTypes.BSM;
4   
5   import edu.umd.cs.findbugs.annotations.NonNull;
6   
7   import org.checkerframework.checker.index.qual.NonNegative;
8   
9   public final class BootstrapMethodItem extends Item {
10      @NonNegative
11      final int position;
12  
13      /**
14       * Initializes the new item with the given index, position and hash code.
15       *
16       * @param position
17       *            position in byte in the class attribute "BootstrapMethods"
18       * @param hashCode
19       *            hashcode of the item, which is processed from the hashcode of the bootstrap method and the hashcode of
20       *            all bootstrap arguments
21       */
22      public BootstrapMethodItem(@NonNegative int index, @NonNegative int position, int hashCode) {
23          super(index);
24          this.position = position;
25          setHashCode(hashCode);
26          type = BSM;
27      }
28  
29      @Override
30      boolean isEqualTo(@NonNull Item item) {
31          return ((BootstrapMethodItem) item).position == position;
32      }
33  }