code: public final int resolveConstantIndex(String constant)
      {
          int size = 0;
          int index = 0;
          int nameIndex = resolveNameIndex(constant);
          constantReadLock.lock();
          try
          {
              size = getConstantPoolSize();
              index = getConstantIndex(constant);
          }
          finally
          {
              constantReadLock.unlock();
          }
          if (index != -1)
          {
              return index;
          }
          return addConstantInfo(new ConstantString(nameIndex), size);
      }
docs: Returns the constant map index to constant
  If entry doesn't exist it is created.
  @param constant
  @return