Program: 186328
Project: 186328
Buggy source:
/** 
 * @param outputFile
 * @param outputMode   one of the image output modes
 * @param x            horizontal resolution
 * @param y            vertical resolution
 * @param results
 * @param camera
 * @param projection
 * @throws IOException
 */
public void writeImageFile(File outputFile,OutputMode outputMode,int x,int y,final Camera camera,final Projection projection) throws IOException {
  int xParts=1 + ((x - 1) / pBufferSizeX);
  int yParts=1 + ((y - 1) / pBufferSizeY);
  BufferedImage image=new BufferedImage(x,y,BufferedImage.TYPE_INT_RGB);
  for (int xPart=0; xPart < xParts; ++xPart) {
    for (int yPart=0; yPart < yParts; ++yPart) {
      int xStart=xPart * pBufferSizeX;
      int xEnd=(xPart + 1 < xParts) ? (xStart + (pBufferSizeX - 1)) : (x - 1);
      int xSize=(xEnd - xStart) + 1;
      int yStart=yPart * pBufferSizeY;
      int yEnd=(yPart + 1 < yParts) ? (yStart + (pBufferSizeY - 1)) : (y - 1);
      int ySize=(yEnd - yStart) + 1;
      JOGLTarget.clearGL(gl,null);
      if (backgroundImage != null) {
        JOGLTarget.drawBackgoundImage(gl,backgroundImage,xStart,yStart,xSize,ySize,backgroundTextureManager);
      }
      JOGLTarget target=(bufferTarget == null) ? createJOGLTarget(gl,results,config) : bufferTarget;
      target.renderPart(camera,projection,xStart / (double)(x - 1),xEnd / (double)(x - 1),yStart / (double)(y - 1),yEnd / (double)(y - 1));
      if (target != bufferTarget) {
        target.freeResources();
      }
      BufferedImage imagePart=Screenshot.readToBufferedImage(pBufferSizeX,pBufferSizeY);
      image.getGraphics().drawImage(imagePart,xStart,y - 1 - yEnd,xSize,ySize,null);
    }
  }
switch (outputMode) {
case PNG:
    ImageIO.write(image,"String_Node_Str",outputFile);
  break;
case PPM:
writePPMFile(image,outputFile);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + outputMode);
}
}

Fixed version (ground truth):
/** 
 * renders this ImageExporter's content to a file
 * @param outputMode   one of the image output modes
 * @param x            horizontal resolution
 * @param y            vertical resolution
 */
public void writeImageFile(File outputFile,OutputMode outputMode,int x,int y,final Camera camera,final Projection projection) throws IOException {
  int xParts=1 + ((x - 1) / pBufferSizeX);
  int yParts=1 + ((y - 1) / pBufferSizeY);
  BufferedImage image=new BufferedImage(x,y,BufferedImage.TYPE_INT_RGB);
  for (int xPart=0; xPart < xParts; ++xPart) {
    for (int yPart=0; yPart < yParts; ++yPart) {
      int xStart=xPart * pBufferSizeX;
      int xEnd=(xPart + 1 < xParts) ? (xStart + (pBufferSizeX - 1)) : (x - 1);
      int xSize=(xEnd - xStart) + 1;
      int yStart=yPart * pBufferSizeY;
      int yEnd=(yPart + 1 < yParts) ? (yStart + (pBufferSizeY - 1)) : (y - 1);
      int ySize=(yEnd - yStart) + 1;
      JOGLTarget.clearGL(gl,null);
      if (backgroundImage != null) {
        JOGLTarget.drawBackgoundImage(gl,backgroundImage,xStart,yStart,xSize,ySize,backgroundTextureManager);
      }
      JOGLTarget target=(bufferTarget == null) ? createJOGLTarget(gl,results,config) : bufferTarget;
      target.renderPart(camera,projection,xStart / (double)(x - 1),xEnd / (double)(x - 1),yStart / (double)(y - 1),yEnd / (double)(y - 1));
      if (target != bufferTarget) {
        target.freeResources();
      }
      BufferedImage imagePart=Screenshot.readToBufferedImage(pBufferSizeX,pBufferSizeY);
      image.getGraphics().drawImage(imagePart,xStart,y - 1 - yEnd,xSize,ySize,null);
    }
  }
switch (outputMode) {
case PNG:
    ImageIO.write(image,"String_Node_Str",outputFile);
  break;
case PPM:
writePPMFile(image,outputFile);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + outputMode);
}
}