Program: 177178
Project: 177178
Buggy source:
@Override public void doFreemarkerGenerate() throws IOException, TemplateException, EnunciateException {
  File serverGenerateDir=getServerSideGenerateDir();
  File clientGenerateDir=getClientSideGenerateDir();
  File xmlGenerateDir=getXMLGenerateDir();
  Enunciate enunciate=getEnunciate();
  if (!enunciate.isUpToDateWithSources(serverGenerateDir) || !enunciate.isUpToDateWithSources(clientGenerateDir) || !enunciate.isUpToDateWithSources(xmlGenerateDir)) {
    URL amfEndpointTemplate=getTemplateURL("String_Node_Str");
    URL amfTypeTemplate=getTemplateURL("String_Node_Str");
    URL amfTypeMapperTemplate=getTemplateURL("String_Node_Str");
    EnunciateFreemarkerModel model=getModel();
    model.setFileOutputDirectory(serverGenerateDir);
    TreeSet<String> packages=new TreeSet<String>(new Comparator<String>(){
      public int compare(      String package1,      String package2){
        int comparison=package1.length() - package2.length();
        if (comparison == 0) {
          return package1.compareTo(package2);
        }
        return comparison;
      }
    }
);
    HashMap<String,String> as3Aliases=new HashMap<String,String>();
    for (    SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
      for (      TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
        if (!isAMFTransient(typeDefinition)) {
          as3Aliases.put(typeDefinition.getQualifiedName(),typeDefinition.getSimpleName());
          packages.add(typeDefinition.getPackage().getQualifiedName());
        }
      }
    }
    LinkedHashMap<String,String> amfTypePackageConversions=new LinkedHashMap<String,String>();
    for (    String pckg : packages) {
      amfTypePackageConversions.put(pckg,pckg + "String_Node_Str");
    }
    info("String_Node_Str");
    AMFClassnameForMethod amfClassnameForMethod=new AMFClassnameForMethod(amfTypePackageConversions);
    model.put("String_Node_Str",new SimpleNameWithParamsMethod(amfClassnameForMethod));
    model.put("String_Node_Str",amfClassnameForMethod);
    for (    SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
      for (      TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
        if (!isAMFTransient(typeDefinition)) {
          model.put("String_Node_Str",typeDefinition);
          processTemplate(amfTypeTemplate,model);
          processTemplate(amfTypeMapperTemplate,model);
        }
      }
    }
    info("String_Node_Str");
    for (    WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
      for (      EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
        if (!isAMFTransient(ei)) {
          model.put("String_Node_Str",ei);
          processTemplate(amfEndpointTemplate,model);
        }
      }
    }
    URL endpointTemplate=getTemplateURL("String_Node_Str");
    URL typeTemplate=getTemplateURL("String_Node_Str");
    URL enumTypeTemplate=getTemplateURL("String_Node_Str");
    model.setFileOutputDirectory(clientGenerateDir);
    HashMap<String,String> conversions=new HashMap<String,String>();
    model.put("String_Node_Str",new ClientPackageForMethod(conversions));
    UnqualifiedClassnameForMethod classnameFor=new UnqualifiedClassnameForMethod(conversions);
    model.put("String_Node_Str",classnameFor);
    model.put("String_Node_Str",new ComponentTypeForMethod(conversions));
    model.put("String_Node_Str",new ForEachAMFImportTransform(null,classnameFor));
    model.put("String_Node_Str",as3Aliases);
    info("String_Node_Str");
    for (    SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
      for (      TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
        if (!isAMFTransient(typeDefinition)) {
          model.put("String_Node_Str",typeDefinition);
          URL template=typeDefinition.isEnum() ? enumTypeTemplate : typeTemplate;
          processTemplate(template,model);
        }
      }
    }
    for (    WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
      for (      EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
        if (!isAMFTransient(ei)) {
          model.put("String_Node_Str",ei);
          processTemplate(endpointTemplate,model);
        }
      }
    }
    URL servicesConfigTemplate=getTemplateURL("String_Node_Str");
    model.setFileOutputDirectory(xmlGenerateDir);
    info("String_Node_Str");
    processTemplate(servicesConfigTemplate,model);
  }
 else {
    info("String_Node_Str");
  }
  this.enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",clientGenerateDir));
  this.enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",serverGenerateDir));
  this.enunciate.addAdditionalSourceRoot(serverGenerateDir);
}

Fixed version (ground truth):
@Override public void doFreemarkerGenerate() throws IOException, TemplateException, EnunciateException {
  File serverGenerateDir=getServerSideGenerateDir();
  File clientGenerateDir=getClientSideGenerateDir();
  File xmlGenerateDir=getXMLGenerateDir();
  Enunciate enunciate=getEnunciate();
  if (!enunciate.isUpToDateWithSources(serverGenerateDir) || !enunciate.isUpToDateWithSources(clientGenerateDir) || !enunciate.isUpToDateWithSources(xmlGenerateDir)) {
    URL amfEndpointTemplate=getTemplateURL("String_Node_Str");
    URL amfTypeTemplate=getTemplateURL("String_Node_Str");
    URL amfTypeMapperTemplate=getTemplateURL("String_Node_Str");
    EnunciateFreemarkerModel model=getModel();
    model.setFileOutputDirectory(serverGenerateDir);
    TreeSet<String> packages=new TreeSet<String>(new Comparator<String>(){
      public int compare(      String package1,      String package2){
        int comparison=package1.length() - package2.length();
        if (comparison == 0) {
          return package1.compareTo(package2);
        }
        return comparison;
      }
    }
);
    HashMap<String,String> as3Aliases=new HashMap<String,String>();
    for (    SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
      for (      TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
        if (!isAMFTransient(typeDefinition)) {
          as3Aliases.put(typeDefinition.getQualifiedName(),typeDefinition.getSimpleName());
          packages.add(typeDefinition.getPackage().getQualifiedName());
        }
      }
    }
    LinkedHashMap<String,String> amfTypePackageConversions=new LinkedHashMap<String,String>();
    for (    String pckg : packages) {
      amfTypePackageConversions.put(pckg,pckg + "String_Node_Str");
    }
    info("String_Node_Str");
    AMFClassnameForMethod amfClassnameForMethod=new AMFClassnameForMethod(amfTypePackageConversions);
    model.put("String_Node_Str",new SimpleNameWithParamsMethod(amfClassnameForMethod));
    model.put("String_Node_Str",amfClassnameForMethod);
    for (    SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
      for (      TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
        if (!isAMFTransient(typeDefinition)) {
          model.put("String_Node_Str",typeDefinition);
          processTemplate(amfTypeTemplate,model);
          processTemplate(amfTypeMapperTemplate,model);
        }
      }
    }
    info("String_Node_Str");
    for (    WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
      for (      EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
        if (!isAMFTransient(ei)) {
          model.put("String_Node_Str",ei);
          processTemplate(amfEndpointTemplate,model);
        }
      }
    }
    URL endpointTemplate=getTemplateURL("String_Node_Str");
    URL typeTemplate=getTemplateURL("String_Node_Str");
    URL enumTypeTemplate=getTemplateURL("String_Node_Str");
    model.setFileOutputDirectory(clientGenerateDir);
    HashMap<String,String> conversions=new HashMap<String,String>();
    model.put("String_Node_Str",new ClientPackageForMethod(conversions));
    UnqualifiedClassnameForMethod classnameFor=new UnqualifiedClassnameForMethod(conversions);
    model.put("String_Node_Str",classnameFor);
    model.put("String_Node_Str",new ComponentTypeForMethod(conversions));
    model.put("String_Node_Str",amfClassnameForMethod);
    model.put("String_Node_Str",new ComponentTypeForMethod(amfTypePackageConversions));
    model.put("String_Node_Str",new ForEachAS3ImportTransform(null,classnameFor));
    model.put("String_Node_Str",new AccessorOverridesAnotherMethod());
    model.put("String_Node_Str",as3Aliases);
    info("String_Node_Str");
    for (    SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
      for (      TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
        if (!isAMFTransient(typeDefinition)) {
          model.put("String_Node_Str",typeDefinition);
          URL template=typeDefinition.isEnum() ? enumTypeTemplate : typeTemplate;
          processTemplate(template,model);
        }
      }
    }
    for (    WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
      for (      EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
        if (!isAMFTransient(ei)) {
          model.put("String_Node_Str",ei);
          processTemplate(endpointTemplate,model);
        }
      }
    }
    URL servicesConfigTemplate=getTemplateURL("String_Node_Str");
    model.setFileOutputDirectory(xmlGenerateDir);
    info("String_Node_Str");
    processTemplate(servicesConfigTemplate,model);
  }
 else {
    info("String_Node_Str");
  }
  this.enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",clientGenerateDir));
  this.enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",serverGenerateDir));
  this.enunciate.addAdditionalSourceRoot(serverGenerateDir);
}