public int getIndex() {
    if (index < 0) {
      throw new IllegalStateException("index not yet set for " + constant);
    }

    return index;
  }
Gets the constant's index. It is only valid to call this after {@link #setIndex} has been
called.

@return {@code >= 0;} the constant pool index
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/code/CstInsn.java