Exemple #1
0
  /**
   * Add an entry to the Constant Pool.
   *
   * @param cpe the new constant pool entry
   * @return the index of the new entry in the pool
   */
  public synchronized short addConstantPoolEntry(ConstantPoolEntry cpe) {

    ConstantPoolEntry old = (ConstantPoolEntry) constantHash.get(cpe);
    if (old != null) {
      return old.getConstantPoolIndex();
    }
    constantHash.put(cpe, cpe);

    constantPool.addElement(cpe);

    return (short) constantPool.size();
  }