Program: 58139
Project: 58139
Buggy source:
private void adjustAxisSpacing(GL gl){
  Point currentPoint=glMouseListener.getPickedPoint();
  float[] fArTargetWorldCoordinates=GLCoordinateUtils.convertWindowCoordinatesToWorldCoordinates(gl,currentPoint.x,currentPoint.y);
  float fWidth=fArTargetWorldCoordinates[0] - fXTranslation - fXDefaultTranslation;
  if (bWasAxisDraggedFirstTime) {
    fAxisDraggingOffset=fWidth - alAxisSpacing.get(iMovedAxisPosition);
    bWasAxisDraggedFirstTime=false;
  }
  fWidth-=fAxisDraggingOffset;
  if (fWidth < renderStyle.getXAxisStart()) {
    fWidth=renderStyle.getXAxisStart();
  }
  if (fWidth > renderStyle.getXAxisEnd()) {
    fWidth=renderStyle.getXAxisEnd();
  }
  int iSwitchAxisWithThis=-1;
  for (int iCount=0; iCount < alAxisSpacing.size(); iCount++) {
    if (iMovedAxisPosition > iCount && fWidth < alAxisSpacing.get(iCount)) {
      iSwitchAxisWithThis=iCount;
      break;
    }
    if (iMovedAxisPosition < iCount && fWidth > alAxisSpacing.get(iCount)) {
      iSwitchAxisWithThis=iCount;
    }
  }
  if (iSwitchAxisWithThis != -1) {
    storageVA.move(iMovedAxisPosition,iSwitchAxisWithThis);
    alAxisSpacing.remove(iMovedAxisPosition);
    alAxisSpacing.add(iSwitchAxisWithThis,fWidth);
    StorageVADelta vaDelta=new StorageVADelta(storageVAType,storageIDType);
    vaDelta.add(VADeltaItem.move(iMovedAxisPosition,iSwitchAxisWithThis));
    sendStorageFilterEvent(vaDelta,"String_Node_Str" + dataDomain.getStorageLabel(storageVA.get(iMovedAxisPosition)));
    iMovedAxisPosition=iSwitchAxisWithThis;
  }
 else {
    alAxisSpacing.set(iMovedAxisPosition,fWidth);
  }
  setDisplayListDirty();
}

Fixed version (ground truth):
private void adjustAxisSpacing(GL gl){
  Point currentPoint=glMouseListener.getPickedPoint();
  float[] fArTargetWorldCoordinates=GLCoordinateUtils.convertWindowCoordinatesToWorldCoordinates(gl,currentPoint.x,currentPoint.y);
  float fWidth=fArTargetWorldCoordinates[0] - fXTranslation - fXDefaultTranslation;
  if (bWasAxisDraggedFirstTime) {
    fAxisDraggingOffset=fWidth - alAxisSpacing.get(iMovedAxisPosition);
    bWasAxisDraggedFirstTime=false;
  }
  fWidth-=fAxisDraggingOffset;
  if (fWidth < renderStyle.getXAxisStart()) {
    fWidth=renderStyle.getXAxisStart();
  }
  if (fWidth > renderStyle.getXAxisEnd()) {
    fWidth=renderStyle.getXAxisEnd();
  }
  int iSwitchAxisWithThis=-1;
  for (int iCount=0; iCount < alAxisSpacing.size(); iCount++) {
    if (iMovedAxisPosition > iCount && fWidth < alAxisSpacing.get(iCount)) {
      iSwitchAxisWithThis=iCount;
      break;
    }
    if (iMovedAxisPosition < iCount && fWidth > alAxisSpacing.get(iCount)) {
      iSwitchAxisWithThis=iCount;
    }
  }
  if (iSwitchAxisWithThis != -1) {
    storageVA.move(iMovedAxisPosition,iSwitchAxisWithThis);
    alAxisSpacing.remove(iMovedAxisPosition);
    alAxisSpacing.add(iSwitchAxisWithThis,fWidth);
    StorageVADelta vaDelta=new StorageVADelta(storageVAType,storageIDType);
    vaDelta.add(VADeltaItem.move(iMovedAxisPosition,iSwitchAxisWithThis));
    triggerStorageFilterEvent(vaDelta,"String_Node_Str" + dataDomain.getStorageLabel(storageVA.get(iMovedAxisPosition)));
    iMovedAxisPosition=iSwitchAxisWithThis;
  }
 else {
    alAxisSpacing.set(iMovedAxisPosition,fWidth);
  }
  setDisplayListDirty();
}