Program: 133539
Project: 133539
Buggy source:
/** 
 * <p> Opens the replicate dialog box and clones the selected shape to the properties </p>
 */
@Override public void run(){
  GeometryComponent geometry=(GeometryComponent)view.treeViewer.getInput();
  ITreeSelection selection=(ITreeSelection)view.treeViewer.getSelection();
  TreePath[] paths=selection.getPaths();
  if (paths.length != 1) {
    return;
  }
  Object selectedObject=paths[0].getLastSegment();
  if (!(selectedObject instanceof ICEShape)) {
    return;
  }
  ICEShape selectedShape=(ICEShape)selectedObject;
  ICETransformation accumulatedTransformation=(ICETransformation)selectedShape.getTransformation().clone();
  ReplicateDialog replicateDialog=new ReplicateDialog(view.getSite().getShell());
  if (replicateDialog.open() != IDialogConstants.OK_ID) {
    return;
  }
  int quantity=replicateDialog.getQuantity();
  double[] shift=replicateDialog.getShift();
  if (quantity == 1) {
    return;
  }
  ICEShape parentShape=selectedShape.getShapeParent();
synchronized (geometry) {
    if (parentShape != null) {
      parentShape.removeShape(selectedShape);
    }
 else {
      geometry.getGeometry().removeShape(selectedShape);
    }
  }
  ICEShape replicateUnion=new ICEShape(ICEOperatorType.Union);
  replicateUnion.setName("String_Node_Str");
  replicateUnion.setId(((ICEObject)selectedShape).getId());
  for (int i=1; i <= quantity; i++) {
    ICEShape clonedShape=(ICEShape)((ICEShape)selectedShape).clone();
    clonedShape.removeProperty("String_Node_Str");
    ((ICEObject)clonedShape).setId(i);
    clonedShape.setTransformation((ICETransformation)accumulatedTransformation.clone());
    replicateUnion.addShape(clonedShape);
    accumulatedTransformation.translate(shift);
  }
  if (parentShape != null) {
synchronized (geometry) {
      parentShape.addShape(replicateUnion);
    }
    view.treeViewer.refresh(parentShape);
  }
 else {
synchronized (geometry) {
      geometry.getGeometry().addShape(replicateUnion);
    }
    view.treeViewer.refresh();
  }
  view.treeViewer.expandToLevel(parentShape,1);
}

Fixed version (ground truth):
/** 
 * <p> Opens the replicate dialog box and clones the selected shape to the properties </p>
 */
@Override public void run(){
  GeometryComponent geometry=(GeometryComponent)view.treeViewer.getInput();
  ITreeSelection selection=(ITreeSelection)view.treeViewer.getSelection();
  TreePath[] paths=selection.getPaths();
  if (paths.length != 1) {
    return;
  }
  Object selectedObject=paths[0].getLastSegment();
  if (!(selectedObject instanceof ICEShape)) {
    return;
  }
  ICEShape selectedShape=(ICEShape)selectedObject;
  Transformation accumulatedTransformation=(Transformation)selectedShape.getTransformation().clone();
  ReplicateDialog replicateDialog=new ReplicateDialog(view.getSite().getShell());
  if (replicateDialog.open() != IDialogConstants.OK_ID) {
    return;
  }
  int quantity=replicateDialog.getQuantity();
  double[] shift=replicateDialog.getShift();
  if (quantity == 1) {
    return;
  }
  ICEShape parentShape=selectedShape.getShapeParent();
synchronized (geometry) {
    if (parentShape != null) {
      parentShape.removeShape(selectedShape);
    }
 else {
      geometry.getGeometry().removeShape(selectedShape);
    }
  }
  ICEShape replicateUnion=new ICEShape(OperatorType.Union);
  replicateUnion.setName("String_Node_Str");
  replicateUnion.setId(((ICEObject)selectedShape).getId());
  for (int i=1; i <= quantity; i++) {
    ICEShape clonedShape=(ICEShape)((ICEShape)selectedShape).clone();
    clonedShape.removeProperty("String_Node_Str");
    ((ICEObject)clonedShape).setId(i);
    clonedShape.setTransformation((Transformation)accumulatedTransformation.clone());
    replicateUnion.addShape(clonedShape);
    accumulatedTransformation.translate(shift);
  }
  if (parentShape != null) {
synchronized (geometry) {
      parentShape.addShape(replicateUnion);
    }
    view.treeViewer.refresh(parentShape);
  }
 else {
synchronized (geometry) {
      geometry.getGeometry().addShape(replicateUnion);
    }
    view.treeViewer.refresh();
  }
  view.treeViewer.expandToLevel(parentShape,1);
}