Program: 120098
Project: 120098
Buggy source:
private void autoScroll(DropTargetEvent event){
  Composite currentComposite=null;
  Object source=event.getSource();
  if (source instanceof DropTarget) {
    Control control=((DropTarget)source).getControl();
    if (control instanceof Composite) {
      currentComposite=(Composite)control;
    }
  }
  if (currentComposite == null) {
    return;
  }
  ScrolledComposite parentScrolledComposite=getParentScrolledComposite(currentComposite);
  if (parentScrolledComposite == null) {
    return;
  }
  ScrollBar vBar=parentScrolledComposite.getVerticalBar();
  Control content=parentScrolledComposite.getContent();
  if (content != null) {
    Point location=content.getLocation();
    int vSelection=vBar.getSelection();
    int increment=0;
    int thumb=vBar.getThumb();
    if (lastCursorPosition == null || lastCursorPosition.y == event.y) {
      long currentTimeMillis=System.currentTimeMillis();
      long time=currentTimeMillis - lastDragTime;
      if (lastDragTime != 0 && time > 100) {
        Point pointToScrollComposite=parentScrolledComposite.toControl(event.x,event.y);
        if (pointToScrollComposite.y < 40) {
          increment=-20;
        }
 else         if (thumb - pointToScrollComposite.y < 40) {
          increment=20;
        }
 else {
          return;
        }
      }
 else {
        return;
      }
    }
 else {
      increment=event.y - lastCursorPosition.y;
      if (increment > 0) {
        increment=increment + 3;
      }
 else {
        increment=increment - 3;
      }
    }
    if (vSelection >= 0 && vSelection + increment > 0 && vSelection + increment < vBar.getMaximum()) {
      vBar.setSelection(vSelection + increment);
    }
    content.setLocation(location.x,-(vSelection + increment));
    mapperManager.getUiManager().refreshBackground(true,false);
    lastDragTime=System.currentTimeMillis();
  }
}

Fixed version (ground truth):
private void autoScroll(DropTargetEvent event){
  Composite currentComposite=null;
  Object source=event.getSource();
  if (source instanceof DropTarget) {
    Control control=((DropTarget)source).getControl();
    if (control instanceof Composite) {
      currentComposite=(Composite)control;
    }
  }
  if (currentComposite == null) {
    return;
  }
  ScrolledComposite parentScrolledComposite=getParentScrolledComposite(currentComposite);
  if (parentScrolledComposite == null) {
    return;
  }
  ScrollBar vBar=parentScrolledComposite.getVerticalBar();
  Control content=parentScrolledComposite.getContent();
  if (content != null) {
    Point location=content.getLocation();
    int vSelection=vBar.getSelection();
    int increment=0;
    int thumb=vBar.getThumb();
    if (lastCursorPosition == null || lastCursorPosition.y == event.y) {
      long currentTimeMillis=System.currentTimeMillis();
      long time=currentTimeMillis - lastDragTime;
      if (lastDragTime != 0 && time > 100) {
        Point pointToScrollComposite=parentScrolledComposite.toControl(event.x,event.y);
        if (pointToScrollComposite.y < 40) {
          increment=-20;
        }
 else         if (thumb - pointToScrollComposite.y < 40) {
          increment=20;
        }
 else {
          return;
        }
      }
 else {
        return;
      }
    }
 else {
      increment=event.y - lastCursorPosition.y;
      if (increment > 0) {
        increment=increment + 3;
      }
 else {
        increment=increment - 3;
      }
    }
    if (vSelection >= 0 && vSelection + increment > 0 && vSelection + increment < vBar.getMaximum()) {
      vBar.setSelection(vSelection + increment);
    }
    content.setLocation(location.x,-vSelection);
    mapperManager.getUiManager().refreshBackground(true,false);
    lastDragTime=System.currentTimeMillis();
  }
}