Program: 39638
Project: 39638
Buggy source:
@Override @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value="String_Node_Str") protected TOExecutionResult execution(File transformedAppFolder,TransformationContext transformationContext){
  String details;
  BufferedReader reader=null;
  BufferedWriter writer=null;
  TOExecutionResult result=null;
  File fileToBeChanged=getAbsoluteFile(transformedAppFolder,transformationContext);
  File tempFile=new File(fileToBeChanged.getAbsolutePath() + "String_Node_Str" + System.currentTimeMillis());
  try {
    if (!fileToBeChanged.exists()) {
      details=String.format("String_Node_Str",getName(),getRelativePath(transformedAppFolder,fileToBeChanged));
      return TOExecutionResult.noOp(this,details);
    }
    reader=new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged),StandardCharsets.UTF_8));
    writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile),StandardCharsets.UTF_8));
    String currentLine;
    boolean foundFirstMatch=false;
    String regex="String_Node_Str" + propertyName + "String_Node_Str";
    final Pattern pattern=Pattern.compile(regex);
    boolean firstLine=true;
    while ((currentLine=reader.readLine()) != null) {
      if (!foundFirstMatch && pattern.matcher(currentLine).matches()) {
        foundFirstMatch=true;
        continue;
      }
      if (!firstLine) {
        writer.write(System.lineSeparator());
      }
      writer.write(currentLine);
      firstLine=false;
    }
    if (foundFirstMatch) {
      details=String.format("String_Node_Str",propertyName,getRelativePath());
      result=TOExecutionResult.success(this,details);
    }
 else {
      details=String.format("String_Node_Str",propertyName,getRelativePath());
      result=TOExecutionResult.warning(this,details);
    }
  }
 catch (  IOException e) {
    result=TOExecutionResult.error(this,e);
  }
 finally {
    try {
      if (writer != null)       try {
        writer.close();
      }
 catch (      IOException e) {
        result.addWarning(e);
      }
    }
  finally {
      if (reader != null)       try {
        reader.close();
      }
 catch (      IOException e) {
        result.addWarning(e);
      }
    }
  }
  boolean deleted=fileToBeChanged.delete();
  if (deleted) {
    if (!tempFile.renameTo(fileToBeChanged)) {
      details=String.format("String_Node_Str",getRelativePath(transformedAppFolder,tempFile),getRelativePath(transformedAppFolder,fileToBeChanged));
      TransformationOperationException e=new TransformationOperationException(details);
      result=TOExecutionResult.error(this,e);
    }
  }
 else {
    details=String.format("String_Node_Str",getRelativePath(transformedAppFolder,fileToBeChanged));
    TransformationOperationException e=new TransformationOperationException(details);
    result=TOExecutionResult.error(this,e);
  }
  return result;
}

Fixed version (ground truth):
@Override @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value="String_Node_Str") protected TOExecutionResult execution(File transformedAppFolder,TransformationContext transformationContext){
  String details;
  BufferedReader reader=null;
  BufferedWriter writer=null;
  TOExecutionResult result=null;
  File fileToBeChanged=getAbsoluteFile(transformedAppFolder,transformationContext);
  File tempFile=new File(fileToBeChanged.getAbsolutePath() + "String_Node_Str" + System.currentTimeMillis());
  try {
    if (!fileToBeChanged.exists()) {
      details=String.format("String_Node_Str",getName(),getRelativePath(transformedAppFolder,fileToBeChanged));
      return TOExecutionResult.noOp(this,details);
    }
    reader=new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged),StandardCharsets.UTF_8));
    writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile),StandardCharsets.UTF_8));
    String currentLine;
    boolean foundFirstMatch=false;
    String regex="String_Node_Str" + propertyName + "String_Node_Str";
    final Pattern pattern=Pattern.compile(regex);
    EolBufferedReader eolReader=new EolBufferedReader(reader);
    while ((currentLine=eolReader.readLineKeepStartEOL()) != null) {
      if (!foundFirstMatch && pattern.matcher(removeEOL(currentLine)).matches()) {
        foundFirstMatch=true;
        continue;
      }
      writer.write(currentLine);
    }
    if (foundFirstMatch) {
      details=String.format("String_Node_Str",propertyName,getRelativePath());
      result=TOExecutionResult.success(this,details);
    }
 else {
      details=String.format("String_Node_Str",propertyName,getRelativePath());
      result=TOExecutionResult.warning(this,details);
    }
  }
 catch (  IOException e) {
    result=TOExecutionResult.error(this,e);
  }
 finally {
    try {
      if (writer != null)       try {
        writer.close();
      }
 catch (      IOException e) {
        result.addWarning(e);
      }
    }
  finally {
      if (reader != null)       try {
        reader.close();
      }
 catch (      IOException e) {
        result.addWarning(e);
      }
    }
  }
  boolean deleted=fileToBeChanged.delete();
  if (deleted) {
    if (!tempFile.renameTo(fileToBeChanged)) {
      details=String.format("String_Node_Str",getRelativePath(transformedAppFolder,tempFile),getRelativePath(transformedAppFolder,fileToBeChanged));
      TransformationOperationException e=new TransformationOperationException(details);
      result=TOExecutionResult.error(this,e);
    }
  }
 else {
    details=String.format("String_Node_Str",getRelativePath(transformedAppFolder,fileToBeChanged));
    TransformationOperationException e=new TransformationOperationException(details);
    result=TOExecutionResult.error(this,e);
  }
  return result;
}