Program: 125313
Project: 125313
Buggy source:
@Override public void drawBackground(GC gc){
  if (gc == null) {
    return;
  }
  List<LinkDescriptor<Item,D1,Tree,D2>> links=linksManager.getLinks();
  int lstSize=links.size();
  if (xStartBezierLink == null || xStartBezierLink < 10) {
    xStartBezierLink=findXRightStartBezierLink(source.getItems(),0);
  }
  Point sourceToCommonPoint=display.map(source,getBgDrawableComposite(),new Point(0,0));
  int treeItemHeight=source.getItemHeight();
  Rectangle tableBounds=source.getBounds();
  if (WindowSystem.isGTK()) {
    gc.setAdvanced(false);
  }
 else {
    gc.fillRectangle(sourceToCommonPoint.x,sourceToCommonPoint.y,tableBounds.width - source.getBorderWidth(),tableBounds.height - source.getBorderWidth());
    if (backgroundRefresher.isAntialiasAllowed()) {
      gc.setAntialias(SWT.ON);
    }
 else {
      gc.setAntialias(SWT.OFF);
    }
  }
  Point pointStartStraight=new Point(0,0);
  Point pointEndStraight=new Point(0,0);
  for (int i=0; i < lstSize; i++) {
    LinkDescriptor<Item,D1,Tree,D2> link=links.get(i);
    Tree tree=link.getExtremity2().getGraphicalObject();
    Point tableToCommonPoint=display.map(tree,getBgDrawableComposite(),new Point(0,0));
    IDrawableLink drawableLink=link.getStyleLink().getDrawableLink();
    if (drawableLink == null) {
      drawableLink=getDefaultStyleLink().getDrawableLink();
    }
    drawableLink.getStyle().apply(gc);
    IExtremityLink<Item,D1> extremity1=link.getExtremity1();
    IExtremityLink<Tree,D2> extremity2=link.getExtremity2();
    dataToTableItemCache.clear();
    TableItem tableItem=dataToTableItemCache.getTableItem(extremity1.getDataItem());
    Rectangle tableItemBounds=tableItem.getBounds();
    int yStraight=sourceToCommonPoint.y + treeItemHeight / 2 + tableItemBounds.y;
    pointStartStraight.x=sourceToCommonPoint.x + tableItemBounds.x + tableItemBounds.width;
    pointStartStraight.y=yStraight;
    pointEndStraight.x=sourceToCommonPoint.x + xStartBezierLink;
    pointEndStraight.y=yStraight;
    TreeItem treeItem=getFirstVisibleTreeItemOfPath(extremity2.getDataItem());
    Rectangle treeItemBounds;
    if (treeItem != null) {
      treeItemBounds=treeItem.getBounds();
    }
 else {
      treeItemBounds=new Rectangle(0,0,0,0);
    }
    Rectangle treeBounds=tree.getBounds();
    int pointY=treeItemBounds.y + tree.getItemHeight() / 2 + tree.getBorderWidth();
    if (tree.getHeaderVisible()) {
      pointY+=tree.getHeaderHeight();
    }
    Point pointEndCentralCurve=null;
    pointEndCentralCurve=backgroundRefresher.convertPointToCommonParentOrigin(new Point(treeBounds.x - 10,pointY),tree);
    Point point=display.map(source,getBgDrawableComposite(),new Point(0,0));
    Point offset=getOffset();
    int yStartStraight=pointStartStraight.y + offset.y;
    boolean isStartOutOfView=false;
    boolean isEndOutOfView=false;
    if (yStraight < point.y || yStraight > point.y + tableBounds.height) {
      isStartOutOfView=true;
    }
 else {
    }
    if (pointEndCentralCurve.y < tableToCommonPoint.y) {
      pointEndCentralCurve.y=tableToCommonPoint.y;
      isEndOutOfView=true;
    }
    if (pointEndCentralCurve.y > tableToCommonPoint.y + treeBounds.height) {
      pointEndCentralCurve.y=tableToCommonPoint.y + treeBounds.height - 2 * tree.getBorderWidth();
      isEndOutOfView=true;
    }
    if (!(isStartOutOfView && isEndOutOfView)) {
      boolean lineStyleDot=isStartOutOfView || isEndOutOfView;
      if ((treeItem != null && treeItem.getData() == extremity2.getDataItem()) && !lineStyleDot) {
        gc.setLineStyle(SWT.LINE_SOLID);
      }
 else {
        gc.setLineStyle(SWT.LINE_DOT);
      }
      gc.drawLine(pointStartStraight.x + offset.x,yStartStraight,pointEndStraight.x + offset.x,yStartStraight);
      if (WindowSystem.isGTK()) {
        pointStartStraight.x+=-15;
      }
      pointEndStraight.x+=offset.x;
      pointEndStraight.y+=offset.y;
      pointEndCentralCurve.x+=offset.x - 6;
      pointEndCentralCurve.y+=offset.y;
      if (Platform.OS_LINUX.equals(Platform.getOS())) {
        pointEndCentralCurve.y=pointEndCentralCurve.y - tableItem.getBounds().height;
      }
      drawableLink.setPoint1(pointEndStraight);
      drawableLink.setPoint2(pointEndCentralCurve);
      drawableLink.draw(gc);
    }
  }
}

Fixed version (ground truth):
@Override public void drawBackground(GC gc){
  if (gc == null) {
    return;
  }
  List<LinkDescriptor<Item,D1,Tree,D2>> links=linksManager.getLinks();
  int lstSize=links.size();
  if (xStartBezierLink == null || xStartBezierLink < 10) {
    xStartBezierLink=findXRightStartBezierLink(source.getItems(),0);
  }
  Point sourceToCommonPoint=display.map(source,getBgDrawableComposite(),new Point(0,0));
  int treeItemHeight=source.getItemHeight();
  Rectangle tableBounds=source.getBounds();
  if (WindowSystem.isGTK()) {
    gc.setAdvanced(false);
  }
 else {
    gc.fillRectangle(sourceToCommonPoint.x,sourceToCommonPoint.y,tableBounds.width - source.getBorderWidth(),tableBounds.height - source.getBorderWidth());
    if (backgroundRefresher.isAntialiasAllowed()) {
      gc.setAntialias(SWT.ON);
    }
 else {
      gc.setAntialias(SWT.OFF);
    }
  }
  Point pointStartStraight=new Point(0,0);
  Point pointEndStraight=new Point(0,0);
  for (int i=0; i < lstSize; i++) {
    LinkDescriptor<Item,D1,Tree,D2> link=links.get(i);
    Tree tree=link.getExtremity2().getGraphicalObject();
    Point tableToCommonPoint=display.map(tree,getBgDrawableComposite(),new Point(0,0));
    IDrawableLink drawableLink=link.getStyleLink().getDrawableLink();
    if (drawableLink == null) {
      drawableLink=getDefaultStyleLink().getDrawableLink();
    }
    drawableLink.getStyle().apply(gc);
    IExtremityLink<Item,D1> extremity1=link.getExtremity1();
    IExtremityLink<Tree,D2> extremity2=link.getExtremity2();
    dataToTableItemCache.clear();
    TableItem tableItem=dataToTableItemCache.getTableItem(extremity1.getDataItem());
    Rectangle tableItemBounds=tableItem.getBounds();
    int yStraight=sourceToCommonPoint.y + treeItemHeight / 2 + tableItemBounds.y;
    pointEndStraight.x=sourceToCommonPoint.x + xStartBezierLink;
    if (Platform.OS_MACOSX.equals(Platform.getOS())) {
      pointStartStraight.x=sourceToCommonPoint.x + tableItem.getParent().getBounds().width;
      pointEndStraight.x=pointStartStraight.x;
    }
 else {
      pointStartStraight.x=sourceToCommonPoint.x + tableItemBounds.x + tableItemBounds.width;
    }
    pointStartStraight.y=yStraight;
    pointEndStraight.y=yStraight;
    TreeItem treeItem=getFirstVisibleTreeItemOfPath(extremity2.getDataItem());
    Rectangle treeItemBounds;
    if (treeItem != null) {
      treeItemBounds=treeItem.getBounds();
    }
 else {
      treeItemBounds=new Rectangle(0,0,0,0);
    }
    Rectangle treeBounds=tree.getBounds();
    int pointY=treeItemBounds.y + tree.getItemHeight() / 2 + tree.getBorderWidth();
    if (tree.getHeaderVisible()) {
      pointY+=tree.getHeaderHeight();
    }
    Point pointEndCentralCurve=null;
    pointEndCentralCurve=backgroundRefresher.convertPointToCommonParentOrigin(new Point(treeBounds.x - 10,pointY),tree);
    Point point=display.map(source,getBgDrawableComposite(),new Point(0,0));
    Point offset=getOffset();
    int yStartStraight=pointStartStraight.y + offset.y;
    boolean isStartOutOfView=false;
    boolean isEndOutOfView=false;
    if (yStraight < point.y || yStraight > point.y + tableBounds.height) {
      isStartOutOfView=true;
    }
 else {
    }
    if (pointEndCentralCurve.y < tableToCommonPoint.y) {
      pointEndCentralCurve.y=tableToCommonPoint.y;
      isEndOutOfView=true;
    }
    if (pointEndCentralCurve.y > tableToCommonPoint.y + treeBounds.height) {
      pointEndCentralCurve.y=tableToCommonPoint.y + treeBounds.height - 2 * tree.getBorderWidth();
      isEndOutOfView=true;
    }
    if (!(isStartOutOfView && isEndOutOfView)) {
      boolean lineStyleDot=isStartOutOfView || isEndOutOfView;
      if ((treeItem != null && treeItem.getData() == extremity2.getDataItem()) && !lineStyleDot) {
        gc.setLineStyle(SWT.LINE_SOLID);
      }
 else {
        gc.setLineStyle(SWT.LINE_DOT);
      }
      gc.drawLine(pointStartStraight.x + offset.x,yStartStraight,pointEndStraight.x + offset.x,yStartStraight);
      if (WindowSystem.isGTK()) {
        pointStartStraight.x+=-15;
      }
      pointEndStraight.x+=offset.x;
      pointEndStraight.y+=offset.y;
      pointEndCentralCurve.x+=offset.x - 6;
      pointEndCentralCurve.y+=offset.y;
      if (Platform.OS_LINUX.equals(Platform.getOS())) {
        pointEndCentralCurve.y=pointEndCentralCurve.y - tableItem.getBounds().height;
      }
      if (Platform.OS_MACOSX.equals(Platform.getOS())) {
        pointEndCentralCurve.y=pointEndCentralCurve.y + tableItem.getBounds(0).height;
      }
      drawableLink.setPoint1(pointEndStraight);
      drawableLink.setPoint2(pointEndCentralCurve);
      drawableLink.draw(gc);
    }
  }
}