Program: 109403
Project: 109403
Buggy source:
@Override public void perform(final GraphRewrite event,final EvaluationContext context,final ReportModel payload){
  String templatePath=payload.getTemplatePath();
  String outputFilename=payload.getReportFilename();
  ExecutionStatistics.get().begin("String_Node_Str" + templatePath + "String_Node_Str"+ outputFilename+ "String_Node_Str");
  try {
    ReportService reportService=new ReportService(event.getGraphContext());
    Path outputDir=reportService.getReportDirectory();
    if (!Files.isDirectory(outputDir)) {
      Files.createDirectories(outputDir);
    }
    Path outputPath=outputDir.resolve(outputFilename);
    LOG.info("String_Node_Str" + templatePath + "String_Node_Str"+ outputPath.toAbsolutePath().toString()+ "String_Node_Str");
    Configuration freemarkerConfig=new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
    DefaultObjectWrapperBuilder objectWrapperBuilder=new DefaultObjectWrapperBuilder(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
    objectWrapperBuilder.setUseAdaptersForContainers(true);
    freemarkerConfig.setObjectWrapper(objectWrapperBuilder.build());
    freemarkerConfig.setAPIBuiltinEnabled(true);
    freemarkerConfig.setTemplateLoader(new FurnaceFreeMarkerTemplateLoader());
    freemarkerConfig.setTemplateUpdateDelayMilliseconds(3600);
    Template template=freemarkerConfig.getTemplate(templatePath);
    Variables variables=Variables.instance(event);
    Map<String,Object> vars=FreeMarkerUtil.findFreeMarkerContextVariables(variables,variableNames.toArray(new String[variableNames.size()]));
    if (useDefaultPayloadVariableName) {
      vars.put(DEFAULT_ITERATION_PAYLOAD_NAME,payload);
    }
    final Map<String,Object> freeMarkerExtensions;
    freeMarkerExtensions=furnace.getLockManager().performLocked(LockMode.WRITE,new Callable<Map<String,Object>>(){
      @Override public Map<String,Object> call() throws Exception {
        return FreeMarkerUtil.findFreeMarkerExtensions(furnace,event);
      }
    }
);
    Map<String,Object> objects=new HashMap<>(vars);
    objects.putAll(freeMarkerExtensions);
    try (FileWriter fw=new FileWriter(outputPath.toFile())){
      template.process(objects,fw);
    }
     FreeMarkerUtil.addAssociatedReportData(event.getGraphContext(),payload,vars);
  }
 catch (  IOException|TemplateException e) {
    LOG.log(Level.WARNING,"String_Node_Str" + templatePath + "String_Node_Str"+ outputFilename+ "String_Node_Str"+ e.getMessage(),e);
  }
 finally {
    ExecutionStatistics.get().end("String_Node_Str" + templatePath + "String_Node_Str"+ outputFilename+ "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void perform(final GraphRewrite event,final EvaluationContext context,final ReportModel payload){
  String templatePath=payload.getTemplatePath();
  String outputFilename=payload.getReportFilename();
  ExecutionStatistics.get().begin("String_Node_Str" + templatePath + "String_Node_Str"+ outputFilename+ "String_Node_Str");
  try {
    ReportService reportService=new ReportService(event.getGraphContext());
    Path outputDir=reportService.getReportDirectory();
    if (!Files.isDirectory(outputDir)) {
      Files.createDirectories(outputDir);
    }
    Path outputPath=outputDir.resolve(outputFilename);
    LOG.info("String_Node_Str" + templatePath + "String_Node_Str"+ outputPath.toAbsolutePath().toString()+ "String_Node_Str");
    Configuration freemarkerConfig=new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
    DefaultObjectWrapperBuilder objectWrapperBuilder=new DefaultObjectWrapperBuilder(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
    objectWrapperBuilder.setUseAdaptersForContainers(true);
    freemarkerConfig.setObjectWrapper(objectWrapperBuilder.build());
    freemarkerConfig.setAPIBuiltinEnabled(true);
    freemarkerConfig.setTemplateLoader(new FurnaceFreeMarkerTemplateLoader());
    freemarkerConfig.setTemplateUpdateDelayMilliseconds(3600);
    Template template=freemarkerConfig.getTemplate(templatePath);
    Variables variables=Variables.instance(event);
    Map<String,Object> vars=FreeMarkerUtil.findFreeMarkerContextVariables(variables,variableNames.toArray(new String[variableNames.size()]));
    if (useDefaultPayloadVariableName) {
      vars.put(DEFAULT_ITERATION_PAYLOAD_NAME,payload);
    }
    final Map<String,Object> freeMarkerExtensions;
    freeMarkerExtensions=furnace.getLockManager().performLocked(LockMode.WRITE,new Callable<Map<String,Object>>(){
      @Override public Map<String,Object> call() throws Exception {
        return FreeMarkerUtil.findFreeMarkerExtensions(furnace,event);
      }
    }
);
    Map<String,Object> objects=new HashMap<>(vars);
    objects.putAll(freeMarkerExtensions);
    try (FileWriter fw=new FileWriter(outputPath.toFile())){
      template.process(objects,fw);
    }
   }
 catch (  IOException|TemplateException e) {
    LOG.log(Level.WARNING,"String_Node_Str" + templatePath + "String_Node_Str"+ outputFilename+ "String_Node_Str"+ e.getMessage(),e);
  }
 finally {
    ExecutionStatistics.get().end("String_Node_Str" + templatePath + "String_Node_Str"+ outputFilename+ "String_Node_Str");
  }
}