Program: 90255
Project: 90255
Buggy source:
public void drawTestInfo(Canvas canvas){
  ShapeModel s=mModel.shapeModel;
  PathModel path=mModel.pathModel;
  if (test_PlotPatch) {
    Paint pt=new Paint();
    byte[] patches=cropPatches();
    int offsetX=-(SEARCH_WIN_W + mModel.patchModel.sampleWidth - 1) / 2;
    int offsetY=-(SEARCH_WIN_H + mModel.patchModel.sampleHeight - 1) / 2;
    for (int i=0; i < mModel.numPts; i++) {
      double centX=mCropPositions.get(i * 2);
      double centY=mCropPositions.get(i * 2 + 1);
      for (int j=0; j < SEARCH_WIN_H + mModel.patchModel.sampleHeight - 1; j++) {
        for (int k=0; k < (SEARCH_WIN_W + mModel.patchModel.sampleWidth - 1); k++) {
          int color=(patches[i * (SEARCH_WIN_W + mModel.patchModel.sampleWidth - 1) * (SEARCH_WIN_H + mModel.patchModel.sampleHeight - 1) + (SEARCH_WIN_W + mModel.patchModel.sampleWidth - 1) * j + k]) & 0xFF;
          double left=(centX + k + offsetX) / mScaleFactor;
          double top=(centY + j + offsetY) / mScaleFactor;
          double right=(centX + k + offsetX+ 1) / mScaleFactor;
          double bottom=(centY + j + offsetY+ 1) / mScaleFactor;
          pt.setARGB(0xff,color,color,color);
          canvas.drawRect((float)left,(float)top,(float)right,(float)bottom,pt);
        }
      }
    }
  }
 else   if (test_PlotResponse) {
    Paint pt=new Paint();
    float[] responses=mFilter.gerResponseImages();
    int offsetX=-(SEARCH_WIN_W - 1) / 2;
    int offsetY=-(SEARCH_WIN_H - 1) / 2;
    for (int i=27; i < 28; i++) {
      double centX=mCropPositions.get(i * 2);
      double centY=mCropPositions.get(i * 2 + 1);
      for (int j=0; j < SEARCH_WIN_H; j++) {
        for (int k=0; k < SEARCH_WIN_W; k++) {
          int color=(int)((255 * responses[i * SEARCH_WIN_W * SEARCH_WIN_H + j * SEARCH_WIN_W + k]));
          double left=(centX + k + offsetX) / mScaleFactor;
          double top=(centY + j + offsetY) / mScaleFactor;
          double right=(centX + k + offsetX+ 1) / mScaleFactor;
          double bottom=(centY + j + offsetY+ 1) / mScaleFactor;
          pt.setARGB(0xff,color,color,color);
          canvas.drawRect((float)left,(float)top,(float)right,(float)bottom,pt);
        }
      }
    }
  }
  if (test_PlotContour) {
    for (int i=0; i < path.paths.length; i++) {
      Paint pt=new Paint();
      pt.setStrokeWidth(2);
      if (test_PlotOriginal) {
        pt.setColor(0xFFFF0000);
        for (int j=1; j < path.paths[i].length; j++) {
          double startX=mOriginalPositions.get(path.paths[i][j - 1] * 2);
          double startY=mOriginalPositions.get(path.paths[i][j - 1] * 2 + 1);
          double endX=mOriginalPositions.get(path.paths[i][j] * 2);
          double endY=mOriginalPositions.get(path.paths[i][j] * 2 + 1);
          canvas.drawLine((float)(startX / mScaleFactor),(float)(startY / mScaleFactor),(float)(endX / mScaleFactor),(float)(endY / mScaleFactor),pt);
        }
      }
      pt.setColor(0xFF00FF00);
      for (int j=1; j < path.paths[i].length; j++) {
        double startX=mCurrentPositions.get(path.paths[i][j - 1] * 2);
        double startY=mCurrentPositions.get(path.paths[i][j - 1] * 2 + 1);
        double endX=mCurrentPositions.get(path.paths[i][j] * 2);
        double endY=mCurrentPositions.get(path.paths[i][j] * 2 + 1);
        canvas.drawLine((float)(startX / mScaleFactor),(float)(startY / mScaleFactor),(float)(endX / mScaleFactor),(float)(endY / mScaleFactor),pt);
      }
    }
  }
 else   if (test_PlotPts) {
    Paint pt=new Paint();
    if (test_PlotOriginal) {
      pt.setColor(0xFFFF0000);
      for (int i=0; i < mModel.numPts; i++) {
        double centX=mOriginalPositions.get(i * 2);
        double centY=mOriginalPositions.get(i * 2 + 1);
        canvas.drawText("String_Node_Str" + i,(float)(centX / mScaleFactor),(float)(centY / mScaleFactor),pt);
      }
    }
    pt.setColor(0xFF00FF00);
    for (int i=0; i < mModel.numPts; i++) {
      double centX=mCurrentPositions.get(i * 2);
      double centY=mCurrentPositions.get(i * 2 + 1);
      canvas.drawText("String_Node_Str" + i,(float)(centX / mScaleFactor),(float)(centY / mScaleFactor),pt);
    }
  }
  if (test_PlotParams) {
    Paint pt=new Paint();
    pt.setColor(0xFF00FF00);
    pt.setTextSize(30);
    String text=new String();
    for (int i=0; i < mModel.shapeModel.mEigenConstraints.length(); i++) {
      int value=(int)((mCurrentParams.get(i + 4) * 50) / mModel.shapeModel.mEigenConstraints.get(i)) + 50;
      canvas.drawText(Parameter.fromInteger(i).desciption() + "String_Node_Str" + value+ "String_Node_Str",0,(i + 1) * (30 + 5),pt);
    }
  }
}

Fixed version (ground truth):
public void drawTestInfo(Canvas canvas,float scale,float translateX,float translateY){
  FuncTracer.startFunc();
  ShapeModel s=mModel.shapeModel;
  PathModel path=mModel.pathModel;
  if (test_PlotPatch) {
    Paint pt=new Paint();
    byte[] patches=cropPatches();
    int offsetX=-(SEARCH_WIN_W + mModel.patchModel.sampleWidth - 1) / 2;
    int offsetY=-(SEARCH_WIN_H + mModel.patchModel.sampleHeight - 1) / 2;
    for (int i=0; i < mModel.numPts; i++) {
      double centX=mCropPositions.get(i * 2);
      double centY=mCropPositions.get(i * 2 + 1);
      for (int j=0; j < SEARCH_WIN_H + mModel.patchModel.sampleHeight - 1; j++) {
        for (int k=0; k < (SEARCH_WIN_W + mModel.patchModel.sampleWidth - 1); k++) {
          int color=(patches[i * (SEARCH_WIN_W + mModel.patchModel.sampleWidth - 1) * (SEARCH_WIN_H + mModel.patchModel.sampleHeight - 1) + (SEARCH_WIN_W + mModel.patchModel.sampleWidth - 1) * j + k]) & 0xFF;
          double left=(centX + k + offsetX) / mScaleFactor;
          double top=(centY + j + offsetY) / mScaleFactor;
          double right=(centX + k + offsetX+ 1) / mScaleFactor;
          double bottom=(centY + j + offsetY+ 1) / mScaleFactor;
          left=left * scale + translateX;
          top=top * scale + translateY;
          right=right * scale + translateX;
          bottom=bottom * scale + translateY;
          pt.setARGB(0xFF,color,color,color);
          canvas.drawRect((float)left,(float)top,(float)right,(float)bottom,pt);
        }
      }
    }
  }
 else   if (test_PlotResponse) {
    Paint pt=new Paint();
    float[] responses=mFilter.gerResponseImages();
    int offsetX=-(SEARCH_WIN_W - 1) / 2;
    int offsetY=-(SEARCH_WIN_H - 1) / 2;
    for (int i=27; i < 28; i++) {
      double centX=mCropPositions.get(i * 2);
      double centY=mCropPositions.get(i * 2 + 1);
      for (int j=0; j < SEARCH_WIN_H; j++) {
        for (int k=0; k < SEARCH_WIN_W; k++) {
          int color=(int)((255 * responses[i * SEARCH_WIN_W * SEARCH_WIN_H + j * SEARCH_WIN_W + k]));
          double left=(centX + k + offsetX) / mScaleFactor;
          double top=(centY + j + offsetY) / mScaleFactor;
          double right=(centX + k + offsetX+ 1) / mScaleFactor;
          double bottom=(centY + j + offsetY+ 1) / mScaleFactor;
          left=left * scale + translateX;
          top=top * scale + translateY;
          right=right * scale + translateX;
          bottom=bottom * scale + translateY;
          pt.setARGB(0xff,color,color,color);
          canvas.drawRect((float)left,(float)top,(float)right,(float)bottom,pt);
        }
      }
    }
  }
  if (test_PlotContour) {
    for (int i=0; i < path.paths.length; i++) {
      Paint pt=new Paint();
      pt.setStrokeWidth(2);
      if (test_PlotOriginal) {
        pt.setColor(0xFFFF0000);
        for (int j=1; j < path.paths[i].length; j++) {
          double startX=mOriginalPositions.get(path.paths[i][j - 1] * 2) / mScaleFactor;
          double startY=mOriginalPositions.get(path.paths[i][j - 1] * 2 + 1) / mScaleFactor;
          double endX=mOriginalPositions.get(path.paths[i][j] * 2) / mScaleFactor;
          double endY=mOriginalPositions.get(path.paths[i][j] * 2 + 1) / mScaleFactor;
          startX=startX * scale + translateX;
          endX=endX * scale + translateX;
          startY=startY * scale + translateY;
          endY=endY * scale + translateY;
          canvas.drawLine((float)startX,(float)startY,(float)endX,(float)endY,pt);
        }
      }
      pt.setColor(0xFF00FF00);
      for (int j=1; j < path.paths[i].length; j++) {
        double startX=mCurrentPositions.get(path.paths[i][j - 1] * 2) / mScaleFactor;
        double startY=mCurrentPositions.get(path.paths[i][j - 1] * 2 + 1) / mScaleFactor;
        double endX=mCurrentPositions.get(path.paths[i][j] * 2) / mScaleFactor;
        double endY=mCurrentPositions.get(path.paths[i][j] * 2 + 1) / mScaleFactor;
        startX=startX * scale + translateX;
        endX=endX * scale + translateX;
        startY=startY * scale + translateY;
        endY=endY * scale + translateY;
        canvas.drawLine((float)startX,(float)startY,(float)endX,(float)endY,pt);
      }
    }
  }
 else   if (test_PlotPts) {
    Paint pt=new Paint();
    if (test_PlotOriginal) {
      pt.setColor(0xFFFF0000);
      for (int i=0; i < mModel.numPts; i++) {
        double centX=mOriginalPositions.get(i * 2) / mScaleFactor;
        double centY=mOriginalPositions.get(i * 2 + 1) / mScaleFactor;
        centX=centX * scale + translateX;
        centY=centY * scale + translateY;
        canvas.drawText("String_Node_Str" + i,(float)centX,(float)centY,pt);
      }
    }
    pt.setColor(0xFF00FF00);
    for (int i=0; i < mModel.numPts; i++) {
      double centX=mCurrentPositions.get(i * 2) / mScaleFactor;
      double centY=mCurrentPositions.get(i * 2 + 1) / mScaleFactor;
      centX=centX * scale + translateX;
      centY=centY * scale + translateY;
      canvas.drawText("String_Node_Str" + i,(float)centX,(float)centY,pt);
    }
  }
  if (test_PlotParams) {
    Paint pt=new Paint();
    pt.setColor(0xFF00FF00);
    pt.setTextSize(30);
    String text=new String();
    for (int i=0; i < mModel.shapeModel.mEigenConstraints.length(); i++) {
      int value=(int)((mCurrentParams.get(i + 4) * 50) / mModel.shapeModel.mEigenConstraints.get(i)) + 50;
      canvas.drawText(Parameter.fromInteger(i).desciption() + "String_Node_Str" + value+ "String_Node_Str",0,(i + 1) * (30 + 5),pt);
    }
  }
  FuncTracer.endFunc();
}