Program: 93632
Project: 93632
Buggy source:
/** 
 * It translates and resizes the figure of the given phantom when this one is nested in a container which is subjected to a coordinates change.
 * @param phantom The phantom.
 */
private void translateWhenInsideContainerChange(Phantom phantom){
  Collection<Diff> changes=Collections2.filter(phantom.getDifference().getMatch().getDifferences(),new Predicate<Diff>(){
    public boolean apply(    Diff difference){
      return difference.getKind() == DifferenceKind.MOVE;
    }
  }
);
  if (changes.size() > 0) {
    View referenceView=phantom.getOriginView();
    View parentReferenceView=(View)referenceView.eContainer();
    if (parentReferenceView != null) {
      View parentView=(View)getMatchView(parentReferenceView,phantom.getSide());
      IFigure parentFigure=getFigure(parentView);
      Rectangle parentRect=parentFigure.getBounds().getCopy();
      translateCoordinates(parentFigure,getLayer(parentReferenceView,getSide(parentView)),parentRect);
      IFigure parentReferenceFigure=getFigure(parentReferenceView);
      Rectangle parentReferenceRect=parentReferenceFigure.getBounds().getCopy();
      translateCoordinates(parentReferenceFigure,getLayer(parentReferenceView,getSide(parentReferenceView)),parentReferenceRect);
      int deltaX=parentRect.x - parentReferenceRect.x;
      int deltaY=parentRect.y - parentReferenceRect.y;
      int deltaWidth=parentRect.width - parentReferenceRect.width;
      int deltaHeight=parentRect.height - parentReferenceRect.height;
      IFigure figure=phantom.getFigure();
      Rectangle rect=figure.getBounds().getCopy();
      rect.x+=deltaX;
      rect.y+=deltaY;
      rect.width+=deltaWidth;
      if (!(figure instanceof Polyline)) {
        rect.height+=deltaHeight;
      }
      figure.setBounds(rect);
      if (figure instanceof Polyline) {
        Point firstPoint=((Polyline)figure).getPoints().getFirstPoint().getCopy();
        Point lastPoint=((Polyline)figure).getPoints().getLastPoint().getCopy();
        firstPoint.x+=deltaX;
        firstPoint.y+=deltaY;
        lastPoint.x+=deltaX + deltaWidth;
        lastPoint.y+=deltaY;
        ((Polyline)figure).setEndpoints(firstPoint,lastPoint);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * It translates and resizes the figure of the given phantom when this one is nested in a container which is subjected to a coordinates change.
 * @param phantom The phantom.
 */
private void translateWhenInsideContainerChange(Phantom phantom){
  Collection<Diff> changes=Collections2.filter(getDiffAncestors(phantom.getDifference()),new Predicate<Diff>(){
    public boolean apply(    Diff difference){
      return difference.getKind() == DifferenceKind.MOVE;
    }
  }
);
  if (changes.size() > 0) {
    View referenceView=phantom.getOriginView();
    View parentReferenceView=(View)referenceView.eContainer();
    if (parentReferenceView != null) {
      View parentView=(View)getMatchView(parentReferenceView,phantom.getSide());
      IFigure parentFigure=getFigure(parentView);
      if (parentFigure != null) {
        Rectangle parentRect=parentFigure.getBounds().getCopy();
        translateCoordinates(parentFigure,getLayer(parentReferenceView,getSide(parentView)),parentRect);
        IFigure parentReferenceFigure=getFigure(parentReferenceView);
        if (parentReferenceFigure != null) {
          Rectangle parentReferenceRect=parentReferenceFigure.getBounds().getCopy();
          translateCoordinates(parentReferenceFigure,getLayer(parentReferenceView,getSide(parentReferenceView)),parentReferenceRect);
          int deltaX=parentRect.x - parentReferenceRect.x;
          int deltaY=parentRect.y - parentReferenceRect.y;
          int deltaWidth=parentRect.width - parentReferenceRect.width;
          int deltaHeight=parentRect.height - parentReferenceRect.height;
          IFigure figure=phantom.getFigure();
          Rectangle rect=figure.getBounds().getCopy();
          rect.x+=deltaX;
          rect.y+=deltaY;
          rect.width+=deltaWidth;
          if (!(figure instanceof Polyline)) {
            rect.height+=deltaHeight;
          }
          figure.setBounds(rect);
          if (figure instanceof Polyline) {
            Point firstPoint=((Polyline)figure).getPoints().getFirstPoint().getCopy();
            Point lastPoint=((Polyline)figure).getPoints().getLastPoint().getCopy();
            firstPoint.x+=deltaX;
            firstPoint.y+=deltaY;
            lastPoint.x+=deltaX + deltaWidth;
            lastPoint.y+=deltaY;
            ((Polyline)figure).setEndpoints(firstPoint,lastPoint);
          }
        }
      }
    }
  }
}