class AllocNode extends Node implements Context {
  /** Returns the new expression of this allocation site. */
  public Object getNewExpr() {
    return newExpr;
  }

  /** Returns all field ref nodes having this node as their base. */
  public Collection<AllocDotField> getAllFieldRefs() {
    if (fields == null) {
      return Collections.emptySet();
    }
    return fields.values();
  }

  /**
   * Returns the field ref node having this node as its base, and field as its field; null if nonexistent.
   */
  public AllocDotField dot(SparkField field) {
    return fields == null ? null : fields.get(field);
  }

  public String toString() {
    return "AllocNode " + getNumber() + " " + newExpr + " in method " + method;
  }

  /* End of public methods. */

  AllocNode(PAG pag, Object newExpr, Type t, SootMethod m) {
    super(pag, t);
    this.method = m;
    if (t instanceof RefType) {
      RefType rt = (RefType) t;
      if (rt.getSootClass().isAbstract()) {
        boolean usesReflectionLog = new CGOptions(PhaseOptions.v().getPhaseOptions("cg")).reflection_log() != null;
        if (!usesReflectionLog) {
          throw new RuntimeException("Attempt to create allocnode with abstract type " + t);
        }
      }
    }
    this.newExpr = newExpr;
    if (newExpr instanceof ContextVarNode) {
      throw new RuntimeException();
    }
    pag.getAllocNodeNumberer().add(this);
  }

  /** Registers a AllocDotField as having this node as its base. */
  void addField(AllocDotField adf, SparkField field) {
    if (fields == null) {
      fields = new HashMap<SparkField, AllocDotField>();
    }
    fields.put(field, adf);
  }

  public Set<AllocDotField> getFields() {<FILL_FUNCTION_BODY>}

  /* End of package methods. */

  protected Object newExpr;
  protected Map<SparkField, AllocDotField> fields;

  private SootMethod method;

  public SootMethod getMethod() {
    return method;
  }
}

    if (fields == null) {
      return Collections.emptySet();
    }
    return new HashSet<AllocDotField>(fields.values());
  
<methods>public void discardP2Set() ,public final boolean equals(java.lang.Object) ,public final int getNumber() ,public soot.jimple.spark.sets.PointsToSetInternal getP2Set() ,public soot.jimple.spark.pag.PAG getPag() ,public soot.jimple.spark.pag.Node getReplacement() ,public soot.Type getType() ,public final int hashCode() ,public soot.jimple.spark.sets.PointsToSetInternal makeP2Set() ,public void mergeWith(soot.jimple.spark.pag.Node) ,public final void setNumber(int) ,public void setP2Set(soot.jimple.spark.sets.PointsToSetInternal) ,public void setType(soot.Type) <variables>private int number,protected soot.jimple.spark.sets.PointsToSetInternal p2set,protected soot.jimple.spark.pag.PAG pag,protected soot.jimple.spark.pag.Node replacement,protected soot.Type type