class DVariableDeclarationStmt extends AbstractUnit implements Stmt {

  Type declarationType = null;

  List declarations = null;

  // added solely for the purpose of retrieving packages used when printing
  DavaBody davaBody = null;

  public DVariableDeclarationStmt(Type decType, DavaBody davaBody) {
    if (declarationType != null) {
      throw new RuntimeException("creating a VariableDeclaration which has already been created");
    } else {
      declarationType = decType;
      declarations = new ArrayList();
      this.davaBody = davaBody;
    }
  }

  public List getDeclarations() {
    return declarations;
  }

  public void addLocal(Local add) {
    declarations.add(add);
  }

  public void removeLocal(Local remove) {
    for (int i = 0; i < declarations.size(); i++) {
      Local temp = (Local) declarations.get(i);
      if (temp.getName().compareTo(remove.getName()) == 0) {
        // this is the local to be removed
        // System.out.println("REMOVED"+temp);
        declarations.remove(i);
        return;
      }
    }
  }

  public Type getType() {
    return declarationType;
  }

  public boolean isOfType(Type type) {
    if (type.toString().compareTo(declarationType.toString()) == 0) {
      return true;
    } else {
      return false;
    }
  }

  public Object clone() {<FILL_FUNCTION_BODY>}

  public String toString() {
    StringBuffer b = new StringBuffer();

    if (declarations.size() == 0) {
      return b.toString();
    }

    String type = declarationType.toString();

    if (type.equals("null_type")) {
      b.append("Object");
    } else {
      b.append(type);
    }
    b.append(" ");

    Iterator decIt = declarations.iterator();
    while (decIt.hasNext()) {
      Local tempDec = (Local) decIt.next();
      b.append(tempDec.getName());

      if (decIt.hasNext()) {
        b.append(", ");
      }
    }
    return b.toString();
  }

  public void toString(UnitPrinter up) {
    if (declarations.size() == 0) {
      return;
    }

    if (!(up instanceof DavaUnitPrinter)) {
      throw new RuntimeException("DavaBody should always be printed using the DavaUnitPrinter");
    } else {
      DavaUnitPrinter dup = (DavaUnitPrinter) up;

      String type = declarationType.toString();

      if (type.equals("null_type")) {
        dup.printString("Object");
      } else {
        IterableSet importSet = davaBody.getImportList();
        if (!importSet.contains(type)) {
          davaBody.addToImportList(type);
        }

        type = RemoveFullyQualifiedName.getReducedName(davaBody.getImportList(), type, declarationType);

        dup.printString(type);
      }
      dup.printString(" ");

      Iterator decIt = declarations.iterator();
      while (decIt.hasNext()) {
        Local tempDec = (Local) decIt.next();
        dup.printString(tempDec.getName());
        if (decIt.hasNext()) {
          dup.printString(", ");
        }
      }
    }
  }

  /*
   * Methods needed to satisfy all obligations due to extension from AbstractUnit and implementing Stmt
   * 
   */

  public boolean fallsThrough() {
    return true;
  }

  public boolean branches() {
    return false;
  }

  public boolean containsInvokeExpr() {
    return false;
  }

  public InvokeExpr getInvokeExpr() {
    throw new RuntimeException("getInvokeExpr() called with no invokeExpr present!");
  }

  public ValueBox getInvokeExprBox() {
    throw new RuntimeException("getInvokeExprBox() called with no invokeExpr present!");
  }

  public boolean containsArrayRef() {
    return false;
  }

  public ArrayRef getArrayRef() {
    throw new RuntimeException("getArrayRef() called with no ArrayRef present!");
  }

  public ValueBox getArrayRefBox() {
    throw new RuntimeException("getArrayRefBox() called with no ArrayRef present!");
  }

  public boolean containsFieldRef() {
    return false;
  }

  public FieldRef getFieldRef() {
    throw new RuntimeException("getFieldRef() called with no FieldRef present!");
  }

  public ValueBox getFieldRefBox() {
    throw new RuntimeException("getFieldRefBox() called with no FieldRef present!");
  }

}

    DVariableDeclarationStmt temp = new DVariableDeclarationStmt(declarationType, davaBody);
    Iterator it = declarations.iterator();
    while (it.hasNext()) {
      Local obj = (Local) it.next();

      Value temp1 = Grimp.cloneIfNecessary(obj);
      if (temp1 instanceof Local) {
        temp.addLocal((Local) temp1);
      }
    }
    return temp;
  
<methods>public non-sealed void <init>() ,public void addBoxPointingToThis(soot.UnitBox) ,public void apply(soot.util.Switch) ,public void clearUnitBoxes() ,public abstract java.lang.Object clone() ,public List<soot.UnitBox> getBoxesPointingToThis() ,public List<soot.ValueBox> getDefBoxes() ,public List<soot.UnitBox> getUnitBoxes() ,public List<soot.ValueBox> getUseAndDefBoxes() ,public List<soot.ValueBox> getUseBoxes() ,public void redirectJumpsToThisTo(soot.Unit) ,public void removeBoxPointingToThis(soot.UnitBox) <variables>protected List<soot.UnitBox> boxesPointingToThis