Program: 93736
Project: 93736
Buggy source:
private void drawRectangle(PaintEvent event,TreeItem treeItem,DiffElement diff){
  final Rectangle treeBounds=tree.getTree().getBounds();
  final Rectangle treeItemBounds=treeItem.getBounds();
  final IPreferenceStore comparePreferences=EMFCompareUIPlugin.getDefault().getPreferenceStore();
  RGB color=PreferenceConverter.getColor(comparePreferences,EMFCompareConstants.PREFERENCES_KEY_CHANGED_COLOR);
  treeItem.setBackground(new Color(treeItem.getDisplay(),PreferenceConverter.getColor(comparePreferences,EMFCompareConstants.PREFERENCES_KEY_HIGHLIGHT_COLOR)));
  if (diff instanceof AddModelElement) {
    color=PreferenceConverter.getColor(comparePreferences,EMFCompareConstants.PREFERENCES_KEY_ADDED_COLOR);
  }
 else   if (diff instanceof RemoveModelElement) {
    color=PreferenceConverter.getColor(comparePreferences,EMFCompareConstants.PREFERENCES_KEY_REMOVED_COLOR);
  }
  final int margin=40;
  final int rectangleX=treeItemBounds.x - margin;
  final int rectangleY=treeItemBounds.y;
  final int rectangleWidth=treeItemBounds.width + margin;
  final int rectangleHeight=treeItemBounds.height - 1;
  final int rectangleArcWidth=5;
  final int rectangleArcHeight=5;
  int lineWidth=1;
  if (getSelectedElements().contains(treeItem)) {
    lineWidth=2;
  }
  event.gc.setLineWidth(lineWidth);
  event.gc.setForeground(new Color(treeItem.getDisplay(),color));
  if (partSide == EMFCompareConstants.LEFT) {
    if (!treeItem.getData().equals(EMFCompareEObjectUtils.getLeftElement(diff)) || diff instanceof AddModelElement) {
      event.gc.setLineStyle(SWT.LINE_SOLID);
      event.gc.drawLine(rectangleX,rectangleY + rectangleHeight,treeBounds.width,rectangleY + rectangleHeight);
    }
 else {
      event.gc.setLineStyle(SWT.LINE_DASHDOT);
      event.gc.drawRoundRectangle(rectangleX,rectangleY,rectangleWidth,rectangleHeight,rectangleArcWidth,rectangleArcHeight);
      event.gc.setLineStyle(SWT.LINE_SOLID);
      event.gc.drawLine(rectangleX + rectangleWidth,rectangleY + rectangleHeight / 2,treeBounds.width,rectangleY + rectangleHeight / 2);
    }
  }
 else   if (partSide == EMFCompareConstants.RIGHT) {
    if (!treeItem.getData().equals(EMFCompareEObjectUtils.getRightElement(diff)) || diff instanceof RemoveModelElement) {
      event.gc.setLineStyle(SWT.LINE_SOLID);
      event.gc.drawLine(rectangleX + rectangleWidth,rectangleY + rectangleHeight,treeBounds.x,rectangleY + rectangleHeight);
    }
 else {
      event.gc.setLineStyle(SWT.LINE_DASHDOT);
      event.gc.drawRoundRectangle(rectangleX,rectangleY,rectangleWidth,rectangleHeight,rectangleArcWidth,rectangleArcHeight);
      event.gc.setLineStyle(SWT.LINE_SOLID);
      event.gc.drawLine(rectangleX,rectangleY + rectangleHeight / 2,treeBounds.x,rectangleY + rectangleHeight / 2);
    }
  }
}

Fixed version (ground truth):
private void drawRectangle(PaintEvent event,TreeItem treeItem,DiffElement diff){
  final Rectangle treeBounds=tree.getTree().getBounds();
  final Rectangle treeItemBounds=treeItem.getBounds();
  RGB color=parentViewer.getChangedColor();
  treeItem.setBackground(new Color(treeItem.getDisplay(),parentViewer.getHighlightColor()));
  if (diff instanceof AddModelElement) {
    color=parentViewer.getAddedColor();
  }
 else   if (diff instanceof RemoveModelElement) {
    color=parentViewer.getRemovedColor();
  }
  final int margin=40;
  final int rectangleX=treeItemBounds.x - margin;
  final int rectangleY=treeItemBounds.y;
  final int rectangleWidth=treeItemBounds.width + margin;
  final int rectangleHeight=treeItemBounds.height - 1;
  final int rectangleArcWidth=5;
  final int rectangleArcHeight=5;
  int lineWidth=1;
  if (getSelectedElements().contains(treeItem)) {
    lineWidth=2;
  }
  event.gc.setLineWidth(lineWidth);
  event.gc.setForeground(new Color(treeItem.getDisplay(),color));
  if (partSide == EMFCompareConstants.LEFT) {
    if (!treeItem.getData().equals(EMFCompareEObjectUtils.getLeftElement(diff)) || diff instanceof AddModelElement) {
      event.gc.setLineStyle(SWT.LINE_SOLID);
      event.gc.drawLine(rectangleX,rectangleY + rectangleHeight,treeBounds.width,rectangleY + rectangleHeight);
    }
 else {
      event.gc.setLineStyle(SWT.LINE_DASHDOT);
      event.gc.drawRoundRectangle(rectangleX,rectangleY,rectangleWidth,rectangleHeight,rectangleArcWidth,rectangleArcHeight);
      event.gc.setLineStyle(SWT.LINE_SOLID);
      event.gc.drawLine(rectangleX + rectangleWidth,rectangleY + rectangleHeight / 2,treeBounds.width,rectangleY + rectangleHeight / 2);
    }
  }
 else   if (partSide == EMFCompareConstants.RIGHT) {
    if (!treeItem.getData().equals(EMFCompareEObjectUtils.getRightElement(diff)) || diff instanceof RemoveModelElement) {
      event.gc.setLineStyle(SWT.LINE_SOLID);
      event.gc.drawLine(rectangleX + rectangleWidth,rectangleY + rectangleHeight,treeBounds.x,rectangleY + rectangleHeight);
    }
 else {
      event.gc.setLineStyle(SWT.LINE_DASHDOT);
      event.gc.drawRoundRectangle(rectangleX,rectangleY,rectangleWidth,rectangleHeight,rectangleArcWidth,rectangleArcHeight);
      event.gc.setLineStyle(SWT.LINE_SOLID);
      event.gc.drawLine(rectangleX,rectangleY + rectangleHeight / 2,treeBounds.x,rectangleY + rectangleHeight / 2);
    }
  }
}