Program: 64360
Project: 64360
Buggy source:
/** 
 * Perform the replacement on the given file. The replacement is performed on a temporary file which then replaces the original file.
 * @param src the source file
 */
private void processFile(File src) throws BuildException {
  if (!src.exists()) {
    throw new BuildException("String_Node_Str" + src.getPath() + "String_Node_Str",location);
  }
  File temp=new File(src.getPath() + "String_Node_Str");
  if (temp.exists()) {
    throw new BuildException("String_Node_Str" + temp.getPath() + "String_Node_Str",location);
  }
  try {
    Reader fileReader=encoding == null ? new FileReader(src) : new InputStreamReader(new FileInputStream(src),encoding);
    Writer fileWriter=encoding == null ? new FileWriter(src) : new OutputStreamWriter(new FileOutputStream(src),encoding);
    BufferedReader br=new BufferedReader(fileReader);
    BufferedWriter bw=new BufferedWriter(fileWriter);
    int fileLengthInBytes=(int)(src.length());
    StringBuffer tmpBuf=new StringBuffer(fileLengthInBytes);
    int readChar=0;
    int totread=0;
    while (true) {
      readChar=br.read();
      if (readChar < 0) {
        break;
      }
      tmpBuf.append((char)readChar);
      totread++;
    }
    String buf=tmpBuf.toString();
    String newString=new String(buf);
    if (token != null) {
      String linesep=System.getProperty("String_Node_Str");
      String val=stringReplace(value.getText(),"String_Node_Str",linesep);
      String tok=stringReplace(token.getText(),"String_Node_Str",linesep);
      log("String_Node_Str" + src.getPath() + "String_Node_Str"+ token.getText()+ "String_Node_Str"+ value.getText(),Project.MSG_VERBOSE);
      newString=stringReplace(newString,tok,val);
    }
    if (replacefilters.size() > 0) {
      newString=processReplacefilters(newString,src.getPath());
    }
    boolean changes=!newString.equals(buf);
    if (changes) {
      bw.write(newString,0,newString.length());
      bw.flush();
    }
    bw.close();
    br.close();
    if (changes) {
      ++fileCount;
      src.delete();
      temp.renameTo(src);
    }
 else {
      temp.delete();
    }
  }
 catch (  IOException ioe) {
    throw new BuildException("String_Node_Str" + src + "String_Node_Str"+ ioe.getClass().getName()+ "String_Node_Str"+ ioe.getMessage(),ioe,location);
  }
}

Fixed version (ground truth):
/** 
 * Perform the replacement on the given file. The replacement is performed on a temporary file which then replaces the original file.
 * @param src the source file
 */
private void processFile(File src) throws BuildException {
  if (!src.exists()) {
    throw new BuildException("String_Node_Str" + src.getPath() + "String_Node_Str",location);
  }
  File temp=new File(src.getPath() + "String_Node_Str");
  if (temp.exists()) {
    throw new BuildException("String_Node_Str" + temp.getPath() + "String_Node_Str",location);
  }
  try {
    Reader fileReader=encoding == null ? new FileReader(src) : new InputStreamReader(new FileInputStream(src),encoding);
    Writer fileWriter=encoding == null ? new FileWriter(temp) : new OutputStreamWriter(new FileOutputStream(temp),encoding);
    BufferedReader br=new BufferedReader(fileReader);
    BufferedWriter bw=new BufferedWriter(fileWriter);
    int fileLengthInBytes=(int)(src.length());
    StringBuffer tmpBuf=new StringBuffer(fileLengthInBytes);
    int readChar=0;
    int totread=0;
    while (true) {
      readChar=br.read();
      if (readChar < 0) {
        break;
      }
      tmpBuf.append((char)readChar);
      totread++;
    }
    String buf=tmpBuf.toString();
    String newString=new String(buf);
    if (token != null) {
      String linesep=System.getProperty("String_Node_Str");
      String val=stringReplace(value.getText(),"String_Node_Str",linesep);
      String tok=stringReplace(token.getText(),"String_Node_Str",linesep);
      log("String_Node_Str" + src.getPath() + "String_Node_Str"+ token.getText()+ "String_Node_Str"+ value.getText(),Project.MSG_VERBOSE);
      newString=stringReplace(newString,tok,val);
    }
    if (replacefilters.size() > 0) {
      newString=processReplacefilters(newString,src.getPath());
    }
    boolean changes=!newString.equals(buf);
    if (changes) {
      bw.write(newString,0,newString.length());
      bw.flush();
    }
    bw.close();
    br.close();
    if (changes) {
      ++fileCount;
      src.delete();
      temp.renameTo(src);
    }
 else {
      temp.delete();
    }
  }
 catch (  IOException ioe) {
    throw new BuildException("String_Node_Str" + src + "String_Node_Str"+ ioe.getClass().getName()+ "String_Node_Str"+ ioe.getMessage(),ioe,location);
  }
}