public void setIndex(int position, int index) {
    if (index < 0) {
      throw new IllegalArgumentException("index < 0");
    }

    if (hasIndex(position)) {
      throw new IllegalStateException("index already set");
    }

    this.index[position] = index;
  }
Sets the DEX index of a constant. It is only valid to call this method once per instance.

@param position the position of the constant to set.
@param index {@code index >= 0;} the constant pool index
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/code/MultiCstInsn.java