Program: 125100
Project: 125100
Buggy source:
/** 
 * DOC ycbai Comment method "createTmpFile". Create a temporary file which contents are readed from the inputStream.
 * @param inputStream the inputStream to read
 * @param fileName the name of temporary file
 * @param maxLineNum the max quantity lines to read. If is "-1" means not limit the quantity.
 * @return
 */
private static File createTmpFile(InputStream inputStream,String fileName,int maxLineNum){
  int maxLines=maxLineNum;
  if (maxLines == -1) {
  }
  Project project=ProjectManager.getInstance().getCurrentProject();
  IProject fsProject=null;
  try {
    fsProject=ResourceModelUtils.getProject(project);
  }
 catch (  PersistenceException e2) {
    ExceptionHandler.process(e2);
  }
  if (fsProject == null) {
    return null;
  }
  File tmpParentFile=new File(fsProject.getLocationURI().getPath() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str");
  File tmpfile=new File(tmpParentFile,fileName);
  BufferedReader reader=null;
  Writer writer=null;
  try {
    if (!tmpParentFile.exists()) {
      tmpParentFile.mkdirs();
    }
    if (tmpfile.exists()) {
      tmpfile.delete();
    }
    reader=new BufferedReader(new InputStreamReader(inputStream));
    String strLine=reader.readLine();
    int totalLines=0;
    writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tmpfile)));
    while (strLine != null && (maxLineNum == -1 || totalLines < maxLineNum)) {
      totalLines++;
      strLine=reader.readLine();
      if (strLine != null) {
        writer.append(strLine);
        writer.append("String_Node_Str");
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
 finally {
    try {
      inputStream.close();
      reader.close();
      writer.close();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return tmpfile;
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "createTmpFile". Create a temporary file which contents are readed from the inputStream.
 * @param inputStream the inputStream to read
 * @param fileName the name of temporary file
 * @param maxLineNum the max quantity lines to read. If is "-1" means not limit the quantity.
 * @return
 */
private static File createTmpFile(InputStream inputStream,String fileName,int maxLineNum){
  Project project=ProjectManager.getInstance().getCurrentProject();
  IProject fsProject=null;
  try {
    fsProject=ResourceModelUtils.getProject(project);
  }
 catch (  PersistenceException e2) {
    ExceptionHandler.process(e2);
  }
  if (fsProject == null) {
    return null;
  }
  File tmpParentFile=new File(fsProject.getLocationURI().getPath() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str");
  File tmpfile=new File(tmpParentFile,fileName);
  BufferedReader reader=null;
  Writer writer=null;
  try {
    if (!tmpParentFile.exists()) {
      tmpParentFile.mkdirs();
    }
    if (tmpfile.exists()) {
      tmpfile.delete();
    }
    reader=new BufferedReader(new InputStreamReader(inputStream));
    writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tmpfile)));
    int totalLines=0;
    String strLine=null;
    do {
      totalLines++;
      strLine=reader.readLine();
      if (strLine != null) {
        writer.append(strLine);
        writer.append("String_Node_Str");
      }
    }
 while (strLine != null && (maxLineNum == -1 || totalLines < maxLineNum));
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
 finally {
    try {
      inputStream.close();
      reader.close();
      writer.close();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return tmpfile;
}