Program: 39644
Project: 39644
Buggy source:
@Override @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value="String_Node_Str") protected TOExecutionResult execution(File transformedAppFolder,TransformationContext transformationContext){
  File fileToBeChanged=getAbsoluteFile(transformedAppFolder,transformationContext);
  String details;
  if (!fileToBeChanged.exists()) {
    details=String.format("String_Node_Str",getName(),getRelativePath(transformedAppFolder,fileToBeChanged));
    return TOExecutionResult.noOp(this,details);
  }
  File tempFile=new File(fileToBeChanged.getAbsolutePath() + "String_Node_Str" + System.currentTimeMillis());
  BufferedReader reader=null;
  BufferedWriter writer=null;
  TOExecutionResult result=null;
  try {
    reader=new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged),StandardCharsets.UTF_8));
    writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile),StandardCharsets.UTF_8));
    if (lineNumber != null) {
      result=removeBasedOnLineNumber(reader,writer);
    }
 else {
      result=removeBasedOnRegex(reader,writer);
    }
    return result;
  }
 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){
  File fileToBeChanged=getAbsoluteFile(transformedAppFolder,transformationContext);
  String details;
  if (!fileToBeChanged.exists()) {
    details=String.format("String_Node_Str",getName(),getRelativePath(transformedAppFolder,fileToBeChanged));
    return TOExecutionResult.noOp(this,details);
  }
  File tempFile=new File(fileToBeChanged.getAbsolutePath() + "String_Node_Str" + System.currentTimeMillis());
  BufferedReader reader=null;
  BufferedWriter writer=null;
  TOExecutionResult result=null;
  try {
    reader=new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged),StandardCharsets.UTF_8));
    writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile),StandardCharsets.UTF_8));
    if (lineNumber != null) {
      result=removeBasedOnLineNumber(reader,writer);
    }
 else {
      result=removeBasedOnRegex(reader,writer);
    }
  }
 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;
}