Program: 151462
Project: 151462
Buggy source:
/** 
 * Generates the navigation menu based on scaffolded entities.
 */
protected Resource<?> generateNavigation(final String targetDir,final boolean overwrite) throws IOException {
  WebResourcesFacet web=this.origin.getFacet(WebResourcesFacet.class);
  HtmlTag unorderedList=new HtmlTag("String_Node_Str");
  ResourceFilter filter=new ResourceFilter(){
    @Override public boolean accept(    Resource<?> resource){
      FileResource<?> file=(FileResource<?>)resource;
      if (!file.isDirectory() || file.getName().equals("String_Node_Str") || file.getName().equals("String_Node_Str")|| file.getName().equals("String_Node_Str")) {
        return false;
      }
      return true;
    }
  }
;
  for (  Resource<?> resource : web.getWebResource(targetDir + "String_Node_Str").listResources(filter)) {
    HtmlOutcomeTargetLink outcomeTargetLink=new HtmlOutcomeTargetLink();
    outcomeTargetLink.putAttribute("String_Node_Str",targetDir + "String_Node_Str" + resource.getName()+ "String_Node_Str");
    outcomeTargetLink.setValue(StringUtils.uncamelCase(resource.getName()));
    HtmlTag listItem=new HtmlTag("String_Node_Str");
    listItem.getChildren().add(outcomeTargetLink);
    unorderedList.getChildren().add(listItem);
  }
  Writer writer=new IndentedWriter(new StringWriter(),this.navigationTemplateIndent);
  unorderedList.write(writer);
  Map<Object,Object> context=CollectionUtils.newHashMap();
  context.put("String_Node_Str",StringUtils.uncamelCase(this.origin.getProjectRoot().getName()));
  context.put("String_Node_Str",writer.toString().trim());
  context.put("String_Node_Str",targetDir);
  if (this.navigationTemplate == null) {
    loadTemplates();
  }
  try {
    return ScaffoldUtil.createOrOverwrite((FileResource<?>)getTemplateStrategy().getDefaultTemplate(),this.templateProcessor.processTemplate(context,navigationTemplate),overwrite);
  }
  finally {
    writer.close();
  }
}

Fixed version (ground truth):
/** 
 * Generates the navigation menu based on scaffolded entities.
 */
protected Resource<?> generateNavigation(final String targetDir,final boolean overwrite) throws IOException {
  WebResourcesFacet web=this.origin.getFacet(WebResourcesFacet.class);
  HtmlTag unorderedList=new HtmlTag("String_Node_Str");
  ResourceFilter filter=new ResourceFilter(){
    @Override public boolean accept(    Resource<?> resource){
      FileResource<?> file=(FileResource<?>)resource;
      if (!file.isDirectory() || file.getName().equals("String_Node_Str") || file.getName().equals("String_Node_Str")|| file.getName().equals("String_Node_Str")) {
        return false;
      }
      return true;
    }
  }
;
  for (  Resource<?> resource : web.getWebResource(targetDir + "String_Node_Str").listResources(filter)) {
    HtmlOutcomeTargetLink outcomeTargetLink=new HtmlOutcomeTargetLink();
    outcomeTargetLink.putAttribute("String_Node_Str",targetDir + "String_Node_Str" + resource.getName()+ "String_Node_Str");
    outcomeTargetLink.setValue(StringUtils.uncamelCase(resource.getName()));
    HtmlTag listItem=new HtmlTag("String_Node_Str");
    listItem.getChildren().add(outcomeTargetLink);
    unorderedList.getChildren().add(listItem);
  }
  Writer writer=new IndentedWriter(new StringWriter(),this.navigationTemplateIndent);
  unorderedList.write(writer);
  Map<Object,Object> context=CollectionUtils.newHashMap();
  context.put("String_Node_Str",StringUtils.uncamelCase(this.origin.getProjectRoot().getName()));
  context.put("String_Node_Str",writer.toString().trim());
  context.put("String_Node_Str",targetDir);
  if (this.navigationTemplate == null) {
    loadTemplates();
  }
  try {
    return ScaffoldUtil.createOrOverwrite((FileResource<?>)getTemplateStrategy().getDefaultTemplate(),this.templateProcessor.processTemplate(context,navigationTemplate),true);
  }
  finally {
    writer.close();
  }
}