/**
   * Generic add entry to constant pool. Includes the logic for an entry to occupy more than one
   * slot (e.g. long).
   *
   * @return The number of slots occupied by the entry. .
   */
  protected int addEntry(Object key, ConstantPoolEntry item) {

    item.setIndex(cptEntries.size());
    if (key != null) cptHashTable.put(key, item);
    cptEntries.addElement(item);

    cptEstimatedSize += item.classFileSize();

    if (item.doubleSlot()) {
      cptEntries.addElement(null);
      return 2;
    } else {
      return 1;
    }
  }