Program: 39649
Project: 39649
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);
  File tempFile=new File(fileToBeChanged.getAbsolutePath() + "String_Node_Str" + System.currentTimeMillis());
  BufferedReader readerOriginalFile=null;
  BufferedWriter writer=null;
  String details=null;
  TOExecutionResult result=null;
  try {
    readerOriginalFile=new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged),StandardCharsets.UTF_8));
    writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile),StandardCharsets.UTF_8));
switch (insertionMode) {
case LINE_NUMBER:
      details=insertAtSpecificLine(readerOriginalFile,writer);
    break;
case REGEX_FIRST:
  details=insertAfterRegex(readerOriginalFile,writer,true);
break;
case REGEX_ALL:
details=insertAfterRegex(readerOriginalFile,writer,false);
break;
default :
case CONCAT:
details=concat(readerOriginalFile,writer);
break;
}
result=TOExecutionResult.success(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 (readerOriginalFile != null) try {
readerOriginalFile.close();
}
 catch (IOException e) {
result.addWarning(e);
}
}
}
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);
}
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);
  File tempFile=new File(fileToBeChanged.getAbsolutePath() + "String_Node_Str" + System.currentTimeMillis());
  BufferedReader readerOriginalFile=null;
  BufferedWriter writer=null;
  String details=null;
  TOExecutionResult result=null;
  try {
    readerOriginalFile=new BufferedReader(new InputStreamReader(new FileInputStream(fileToBeChanged),StandardCharsets.UTF_8));
    writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile),StandardCharsets.UTF_8));
switch (insertionMode) {
case LINE_NUMBER:
      details=insertAtSpecificLine(readerOriginalFile,writer);
    break;
case REGEX_FIRST:
  details=insertAfterRegex(readerOriginalFile,writer,true);
break;
case REGEX_ALL:
details=insertAfterRegex(readerOriginalFile,writer,false);
break;
default :
case CONCAT:
details=concat(readerOriginalFile,writer);
break;
}
result=TOExecutionResult.success(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 (readerOriginalFile != null) try {
readerOriginalFile.close();
}
 catch (IOException e) {
result.addWarning(e);
}
}
}
boolean bDeleted=fileToBeChanged.delete();
if (bDeleted) {
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;
}