Program: 149596
Project: 149596
Buggy source:
/** 
 * Performs truncation of cluster from the right side. - if byIndex = true  : till the index of last cluster record will be < truncationPoint - if byIndex = false : till the positionInTarget of last cluster record will be < truncationPoint
 * @param byIndex         determine truncation type
 * @param seedPositions   seed positions
 * @param results         cluster data
 * @param data            records data
 * @param dataTo          use only [0..dataTo] records from data
 * @param clusterPointer  pointer to target cluster
 * @param truncationPoint main truncation threshold
 * @return {@literal true} if cluster remains to have score above the threshold (absoluteMinClusterScore);{@literal false} if cluster was removed due to too low score
 */
private boolean truncateClusterFromRight(boolean byIndex,final IntArrayList seedPositions,final IntArrayList results,final int[] data,final int dataTo,final int clusterPointer,final int truncationPoint){
  if (stat != null)   stat.trimmingEvent(byIndex ? TrimRightQuery : TrimRightTarget);
  int lastRecordId=results.get(clusterPointer + FIRST_RECORD_ID), record=data[lastRecordId], prevOffset=offset(record), prevIndex=index(record), score=matchScore;
  int i=lastRecordId;
  while (++i < dataTo && prevIndex == index(data[i]))   ;
  int offset, index;
  for (; i < dataTo && (byIndex ? index(data[i]) < truncationPoint : (positionInTarget(seedPositions,data[i]) < truncationPoint)); ++i) {
    index=index(data[i]);
    offset=offset(data[i]);
    if (inDelta(prevOffset,offset,maxClusterIndels)) {
      if (i < dataTo - 1 && index == index(data[i + 1]) && abs(prevOffset - offset) > abs(prevOffset - offset(data[i + 1])))       continue;
      int scoreDelta=matchScore + (index - prevIndex - 1) * mismatchScore + abs(prevOffset - offset) * offsetShiftScore;
      if (scoreDelta > 0) {
        score+=scoreDelta;
        prevOffset=offset;
        prevIndex=index;
        lastRecordId=i;
      }
    }
  }
  results.set(clusterPointer + LAST_RECORD_ID,lastRecordId);
  results.set(clusterPointer + SCORE,score);
  if (score < absoluteMinClusterScore) {
    results.set(clusterPointer + FIRST_RECORD_ID,DROPPED_CLUSTER);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Performs truncation of cluster from the right side. - if byIndex = true  : till the index of last cluster record will be < truncationPoint - if byIndex = false : till the positionInTarget of last cluster record will be < truncationPoint
 * @param byIndex         determine truncation type
 * @param seedPositions   seed positions
 * @param results         cluster data
 * @param data            records data
 * @param dataTo          use only [0..dataTo] records from data
 * @param clusterPointer  pointer to target cluster
 * @param truncationPoint main truncation threshold
 * @return {@literal true} if cluster remains to have score above the threshold (absoluteMinClusterScore);{@literal false} if cluster was removed due to too low score
 */
private boolean truncateClusterFromRight(boolean byIndex,final IntArrayList seedPositions,final IntArrayList results,final int[] data,final int dataTo,final int clusterPointer,final int truncationPoint){
}