Program: 31879
Project: 31879
Buggy source:
void updateGridLabels(double startValue,double endValue,double gridDensity,GridScaleType scale_mode){
  int scale_mode_id=scale_mode.getValue();
  double[][] gridPoints=gridPointsArray[scale_mode_id];
  StringBuffer[] gridPointsStr=gridPointsStrArray[scale_mode_id];
  double[] oldGridPointBoundary=oldGridPointBoundaryArray[scale_mode_id];
  genLinearGridPoints(gridPoints,startValue,endValue,gridDensity,scale_mode_id);
  double[] gridPointsBig=gridPoints[0];
  boolean needUpdate=false;
  if (gridPointsBig.length != gridPointsStr.length) {
    gridPointsStrArray[scale_mode_id]=new StringBuffer[gridPointsBig.length];
    gridPointsStr=gridPointsStrArray[scale_mode_id];
    for (int i=0; i < gridPointsBig.length; i++) {
      gridPointsStr[i]=new StringBuffer();
    }
    if (scale_mode_id == 0) {
      gridPoints2Str=gridPointsStr;
    }
 else {
      gridPoints2StrDB=gridPointsStr;
    }
    needUpdate=true;
  }
  if (gridPointsBig.length > 0 && (needUpdate || gridPointsBig[0] != oldGridPointBoundary[0] || gridPointsBig[gridPointsBig.length - 1] != oldGridPointBoundary[1])) {
    oldGridPointBoundary[0]=gridPointsBig[0];
    oldGridPointBoundary[1]=gridPointsBig[gridPointsBig.length - 1];
    for (int i=0; i < gridPointsStr.length; i++) {
      gridPointsStr[i].setLength(0);
      if (Math.abs(gridPointsBig[i]) >= 10) {
        gridPointsStr[i].append(largeFormatter.format(gridPointsBig[i]));
      }
 else       if (gridPointsBig[i] != 0) {
        gridPointsStr[i].append(smallFormatter.format(gridPointsBig[i]));
      }
 else {
        gridPointsStr[i].append("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
void updateGridLabels(double startValue,double endValue,double gridDensity,GridScaleType scale_mode){
  int scale_mode_id=scale_mode.getValue();
  double[][] gridPoints=gridPointsArray[scale_mode_id];
  StringBuilder[] gridPointsStr=gridPointsStrArray[scale_mode_id];
  double[] oldGridPointBoundary=oldGridPointBoundaryArray[scale_mode_id];
  genLinearGridPoints(gridPoints,startValue,endValue,gridDensity,scale_mode_id);
  double[] gridPointsBig=gridPoints[0];
  boolean needUpdate=false;
  if (gridPointsBig.length != gridPointsStr.length) {
    gridPointsStrArray[scale_mode_id]=new StringBuilder[gridPointsBig.length];
    gridPointsStr=gridPointsStrArray[scale_mode_id];
    for (int i=0; i < gridPointsBig.length; i++) {
      gridPointsStr[i]=new StringBuilder();
    }
    if (scale_mode_id == 0) {
      gridPoints2Str=gridPointsStr;
    }
 else {
      gridPoints2StrDB=gridPointsStr;
    }
    needUpdate=true;
  }
  if (gridPointsBig.length > 0 && (needUpdate || gridPointsBig[0] != oldGridPointBoundary[0] || gridPointsBig[gridPointsBig.length - 1] != oldGridPointBoundary[1])) {
    oldGridPointBoundary[0]=gridPointsBig[0];
    oldGridPointBoundary[1]=gridPointsBig[gridPointsBig.length - 1];
    for (int i=0; i < gridPointsStr.length; i++) {
      gridPointsStr[i].setLength(0);
      if (Math.abs(gridPointsBig[i]) >= 10) {
        gridPointsStr[i].append(largeFormatter.format(gridPointsBig[i]));
      }
 else       if (gridPointsBig[i] != 0) {
        gridPointsStr[i].append(smallFormatter.format(gridPointsBig[i]));
      }
 else {
        gridPointsStr[i].append("String_Node_Str");
      }
    }
  }
}