Program: 177142
Project: 177142
Buggy source:
@Override public void doFreemarkerGenerate() throws IOException, TemplateException, EnunciateException {
  File clientSideGenerateDir=getClientSideGenerateDir();
  File serverSideGenerateDir=getServerSideGenerateDir();
  boolean upToDate=enunciate.isUpToDateWithSources(clientSideGenerateDir) && enunciate.isUpToDateWithSources(serverSideGenerateDir);
  if (!upToDate) {
    URL typeMapperTemplate=getTemplateURL("String_Node_Str");
    URL enumTypeMapperTemplate=getTemplateURL("String_Node_Str");
    URL faultMapperTemplate=getTemplateURL("String_Node_Str");
    URL moduleXmlTemplate=getTemplateURL("String_Node_Str");
    URL eiTemplate=isUseWrappedServices() ? getTemplateURL("String_Node_Str") : getTemplateURL("String_Node_Str");
    URL endpointImplTemplate=getTemplateURL("String_Node_Str");
    URL faultTemplate=getTemplateURL("String_Node_Str");
    URL typeTemplate=getTemplateURL("String_Node_Str");
    URL overlayTypeTemplate=getTemplateURL("String_Node_Str");
    URL enumTypeTemplate=getTemplateURL("String_Node_Str");
    URL overlayEnumTypeTemplate=getTemplateURL("String_Node_Str");
    EnunciateFreemarkerModel model=getModel();
    model.put("String_Node_Str",this.springDIFound);
    model.put("String_Node_Str",this.isUseWrappedServices());
    Map<String,String> conversions=new LinkedHashMap<String,String>();
    Set<String> knownGwtPackages=this.gwtClasspathHandler != null ? this.gwtClasspathHandler.getSourcePackagesToModules().keySet() : Collections.<String>emptySet();
    for (    String knownGwtPackage : knownGwtPackages) {
      conversions.put(knownGwtPackage,knownGwtPackage);
    }
    Map<String,String> overlayConversions=new HashMap<String,String>();
    String clientNamespace=this.rpcModuleNamespace + "String_Node_Str";
    conversions.put(this.rpcModuleNamespace,clientNamespace);
    overlayConversions.put(this.rpcModuleNamespace,clientNamespace + "String_Node_Str");
    if (!this.enforceNamespaceConformance) {
      TreeSet<WebFault> allFaults=new TreeSet<WebFault>(new TypeDeclarationComparator());
      for (      WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
        for (        EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
          if (!isGWTTransient(ei)) {
            String pckg=ei.getPackage().getQualifiedName();
            if (!pckg.startsWith(this.rpcModuleNamespace) && !conversions.containsKey(pckg)) {
              conversions.put(pckg,clientNamespace + "String_Node_Str" + pckg);
            }
            for (            WebMethod webMethod : ei.getWebMethods()) {
              for (              WebFault webFault : webMethod.getWebFaults()) {
                allFaults.add(webFault);
              }
            }
          }
        }
      }
      for (      WebFault webFault : allFaults) {
        if (!isGWTTransient(webFault)) {
          String pckg=webFault.getPackage().getQualifiedName();
          if (!pckg.startsWith(this.rpcModuleNamespace) && !conversions.containsKey(pckg)) {
            conversions.put(pckg,clientNamespace + "String_Node_Str" + pckg);
          }
        }
      }
      for (      SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
        for (        TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
          if (!isGWTTransient(typeDefinition)) {
            String pckg=typeDefinition.getPackage().getQualifiedName();
            if (!pckg.startsWith(this.rpcModuleNamespace) && !conversions.containsKey(pckg) && (getKnownGwtModule(typeDefinition) == null)) {
              conversions.put(pckg,clientNamespace + "String_Node_Str" + pckg);
              overlayConversions.put(pckg,clientNamespace + "String_Node_Str" + pckg);
            }
          }
        }
      }
    }
    ClientClassnameForMethod classnameFor=new ClientClassnameForMethod(conversions);
    classnameFor.setJdk15(true);
    OverlayClientClassnameForMethod overlayClassnameFor=new OverlayClientClassnameForMethod(overlayConversions);
    overlayClassnameFor.setJdk15(true);
    model.put("String_Node_Str",new ClientPackageForMethod(conversions));
    model.put("String_Node_Str",new ClientPackageForMethod(overlayConversions));
    model.put("String_Node_Str",classnameFor);
    model.put("String_Node_Str",overlayClassnameFor);
    model.put("String_Node_Str",new SimpleNameWithParamsMethod(classnameFor));
    model.put("String_Node_Str",getGwtSubcontext());
    model.put("String_Node_Str",new AccessorOverridesAnotherMethod());
    model.setFileOutputDirectory(clientSideGenerateDir);
    Properties gwt2jaxbMappings=new Properties();
    TreeSet<WebFault> allFaults=new TreeSet<WebFault>(new TypeDeclarationComparator());
    Set<String> importedModules=new TreeSet<String>();
    if (isGenerateRPCSupport()) {
      debug("String_Node_Str");
      for (      WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
        for (        EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
          if (!isGWTTransient(ei)) {
            model.put("String_Node_Str",ei);
            processTemplate(eiTemplate,model);
            for (            WebMethod webMethod : ei.getWebMethods()) {
              for (              WebFault webFault : webMethod.getWebFaults()) {
                allFaults.add(webFault);
              }
            }
          }
        }
      }
      debug("String_Node_Str");
      for (      WebFault webFault : allFaults) {
        if (!isGWTTransient(webFault)) {
          model.put("String_Node_Str",webFault);
          processTemplate(faultTemplate,model);
        }
      }
      debug("String_Node_Str");
      for (      SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
        for (        TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
          if (!isGWTTransient(typeDefinition)) {
            String knownGwtModule=getKnownGwtModule(typeDefinition);
            if (knownGwtModule == null) {
              model.put("String_Node_Str",typeDefinition);
              URL template=typeDefinition.isEnum() ? enumTypeTemplate : typeTemplate;
              processTemplate(template,model);
            }
 else {
              importedModules.add(knownGwtModule);
              debug("String_Node_Str",typeDefinition.getQualifiedName());
            }
          }
        }
      }
    }
    if (isGenerateJsonOverlays()) {
      debug("String_Node_Str");
      for (      SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
        for (        TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
          if (!isGWTTransient(typeDefinition)) {
            model.put("String_Node_Str",typeDefinition);
            URL template=typeDefinition.isEnum() ? overlayEnumTypeTemplate : overlayTypeTemplate;
            processTemplate(template,model);
          }
        }
      }
    }
    model.put("String_Node_Str",this.rpcModuleName);
    model.put("String_Node_Str",importedModules);
    processTemplate(moduleXmlTemplate,model);
    model.setFileOutputDirectory(serverSideGenerateDir);
    if (isGenerateRPCSupport()) {
      debug("String_Node_Str");
      for (      WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
        for (        EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
          if (!isGWTTransient(ei)) {
            model.put("String_Node_Str",ei);
            processTemplate(endpointImplTemplate,model);
          }
        }
      }
      debug("String_Node_Str");
      for (      SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
        for (        TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
          if (!isGWTTransient(typeDefinition)) {
            if (getKnownGwtModule(typeDefinition) == null) {
              if (!typeDefinition.isEnum()) {
                model.put("String_Node_Str",typeDefinition);
                processTemplate(typeMapperTemplate,model);
                gwt2jaxbMappings.setProperty(classnameFor.convert(typeDefinition),typeDefinition.getQualifiedName());
              }
 else               if (typeDefinition.isEnum()) {
                model.put("String_Node_Str",typeDefinition);
                processTemplate(enumTypeMapperTemplate,model);
                gwt2jaxbMappings.setProperty(classnameFor.convert(typeDefinition),typeDefinition.getQualifiedName());
              }
            }
 else {
              debug("String_Node_Str",typeDefinition.getQualifiedName());
            }
          }
        }
      }
      debug("String_Node_Str");
      for (      WebFault webFault : allFaults) {
        if (!isGWTTransient(webFault)) {
          model.put("String_Node_Str",webFault);
          processTemplate(faultMapperTemplate,model);
          gwt2jaxbMappings.setProperty(classnameFor.convert(webFault),webFault.getQualifiedName());
        }
      }
      FileOutputStream mappingsOut=new FileOutputStream(new File(serverSideGenerateDir,"String_Node_Str"));
      gwt2jaxbMappings.store(mappingsOut,"String_Node_Str");
      mappingsOut.flush();
      mappingsOut.close();
    }
  }
 else {
    info("String_Node_Str");
  }
  enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",clientSideGenerateDir));
  enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",serverSideGenerateDir));
  enunciate.addAdditionalSourceRoot(clientSideGenerateDir);
  enunciate.addAdditionalSourceRoot(serverSideGenerateDir);
}

Fixed version (ground truth):
@Override public void doFreemarkerGenerate() throws IOException, TemplateException, EnunciateException {
  File clientSideGenerateDir=getClientSideGenerateDir();
  File serverSideGenerateDir=getServerSideGenerateDir();
  boolean upToDate=enunciate.isUpToDateWithSources(clientSideGenerateDir) && enunciate.isUpToDateWithSources(serverSideGenerateDir);
  if (!upToDate) {
    URL typeMapperTemplate=getTemplateURL("String_Node_Str");
    URL enumTypeMapperTemplate=getTemplateURL("String_Node_Str");
    URL faultMapperTemplate=getTemplateURL("String_Node_Str");
    URL moduleXmlTemplate=getTemplateURL("String_Node_Str");
    URL eiTemplate=isUseWrappedServices() ? getTemplateURL("String_Node_Str") : getTemplateURL("String_Node_Str");
    URL endpointImplTemplate=getTemplateURL("String_Node_Str");
    URL faultTemplate=getTemplateURL("String_Node_Str");
    URL typeTemplate=getTemplateURL("String_Node_Str");
    URL overlayTypeTemplate=getTemplateURL("String_Node_Str");
    URL enumTypeTemplate=getTemplateURL("String_Node_Str");
    URL overlayEnumTypeTemplate=getTemplateURL("String_Node_Str");
    EnunciateFreemarkerModel model=getModel();
    model.put("String_Node_Str",this.springDIFound);
    model.put("String_Node_Str",this.isUseWrappedServices());
    Map<String,String> conversions=new LinkedHashMap<String,String>();
    Set<String> knownGwtPackages=this.gwtClasspathHandler != null ? this.gwtClasspathHandler.getSourcePackagesToModules().keySet() : Collections.<String>emptySet();
    for (    String knownGwtPackage : knownGwtPackages) {
      conversions.put(knownGwtPackage,knownGwtPackage);
    }
    Map<String,String> overlayConversions=new HashMap<String,String>();
    String clientNamespace=this.rpcModuleNamespace + "String_Node_Str";
    conversions.put(this.rpcModuleNamespace,clientNamespace);
    overlayConversions.put(this.rpcModuleNamespace,clientNamespace + "String_Node_Str");
    if (!this.enforceNamespaceConformance) {
      TreeSet<WebFault> allFaults=new TreeSet<WebFault>(new TypeDeclarationComparator());
      for (      WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
        for (        EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
          if (!isGWTTransient(ei)) {
            String pckg=ei.getPackage().getQualifiedName();
            if (!pckg.startsWith(this.rpcModuleNamespace) && !conversions.containsKey(pckg)) {
              conversions.put(pckg,clientNamespace + "String_Node_Str" + pckg);
            }
            for (            WebMethod webMethod : ei.getWebMethods()) {
              for (              WebFault webFault : webMethod.getWebFaults()) {
                allFaults.add(webFault);
              }
            }
          }
        }
      }
      for (      WebFault webFault : allFaults) {
        if (!isGWTTransient(webFault)) {
          String pckg=webFault.getPackage().getQualifiedName();
          if (!pckg.startsWith(this.rpcModuleNamespace) && !conversions.containsKey(pckg) && (getKnownGwtModule(webFault) == null)) {
            conversions.put(pckg,clientNamespace + "String_Node_Str" + pckg);
          }
        }
      }
      for (      SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
        for (        TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
          if (!isGWTTransient(typeDefinition)) {
            String pckg=typeDefinition.getPackage().getQualifiedName();
            if (!pckg.startsWith(this.rpcModuleNamespace) && !conversions.containsKey(pckg)) {
              if (getKnownGwtModule(typeDefinition) == null) {
                conversions.put(pckg,clientNamespace + "String_Node_Str" + pckg);
              }
              overlayConversions.put(pckg,clientNamespace + "String_Node_Str" + pckg);
            }
          }
        }
      }
    }
    ClientClassnameForMethod classnameFor=new ClientClassnameForMethod(conversions);
    classnameFor.setJdk15(true);
    OverlayClientClassnameForMethod overlayClassnameFor=new OverlayClientClassnameForMethod(overlayConversions);
    overlayClassnameFor.setJdk15(true);
    model.put("String_Node_Str",new ClientPackageForMethod(conversions));
    model.put("String_Node_Str",new ClientPackageForMethod(overlayConversions));
    model.put("String_Node_Str",classnameFor);
    model.put("String_Node_Str",overlayClassnameFor);
    model.put("String_Node_Str",new SimpleNameWithParamsMethod(classnameFor));
    model.put("String_Node_Str",getGwtSubcontext());
    model.put("String_Node_Str",new AccessorOverridesAnotherMethod());
    model.setFileOutputDirectory(clientSideGenerateDir);
    Properties gwt2jaxbMappings=new Properties();
    TreeSet<WebFault> allFaults=new TreeSet<WebFault>(new TypeDeclarationComparator());
    Set<String> importedModules=new TreeSet<String>();
    if (isGenerateRPCSupport()) {
      debug("String_Node_Str");
      for (      WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
        for (        EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
          if (!isGWTTransient(ei)) {
            model.put("String_Node_Str",ei);
            processTemplate(eiTemplate,model);
            for (            WebMethod webMethod : ei.getWebMethods()) {
              for (              WebFault webFault : webMethod.getWebFaults()) {
                allFaults.add(webFault);
              }
            }
          }
        }
      }
      debug("String_Node_Str");
      for (      WebFault webFault : allFaults) {
        if (!isGWTTransient(webFault)) {
          String knownGwtModule=getKnownGwtModule(webFault);
          if (knownGwtModule == null) {
            model.put("String_Node_Str",webFault);
            processTemplate(faultTemplate,model);
          }
 else {
            importedModules.add(knownGwtModule);
            debug("String_Node_Str",webFault.getQualifiedName());
          }
        }
      }
      debug("String_Node_Str");
      for (      SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
        for (        TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
          if (!isGWTTransient(typeDefinition)) {
            String knownGwtModule=getKnownGwtModule(typeDefinition);
            if (knownGwtModule == null) {
              model.put("String_Node_Str",typeDefinition);
              URL template=typeDefinition.isEnum() ? enumTypeTemplate : typeTemplate;
              processTemplate(template,model);
            }
 else {
              importedModules.add(knownGwtModule);
              debug("String_Node_Str",typeDefinition.getQualifiedName());
            }
          }
        }
      }
    }
    if (isGenerateJsonOverlays()) {
      debug("String_Node_Str");
      for (      SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
        for (        TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
          if (!isGWTTransient(typeDefinition)) {
            model.put("String_Node_Str",typeDefinition);
            URL template=typeDefinition.isEnum() ? overlayEnumTypeTemplate : overlayTypeTemplate;
            processTemplate(template,model);
          }
        }
      }
    }
    model.put("String_Node_Str",this.rpcModuleName);
    model.put("String_Node_Str",importedModules);
    processTemplate(moduleXmlTemplate,model);
    model.setFileOutputDirectory(serverSideGenerateDir);
    if (isGenerateRPCSupport()) {
      debug("String_Node_Str");
      for (      WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
        for (        EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
          if (!isGWTTransient(ei)) {
            model.put("String_Node_Str",ei);
            processTemplate(endpointImplTemplate,model);
          }
        }
      }
      debug("String_Node_Str");
      for (      SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
        for (        TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
          if (!isGWTTransient(typeDefinition)) {
            if (getKnownGwtModule(typeDefinition) == null) {
              if (!typeDefinition.isEnum()) {
                model.put("String_Node_Str",typeDefinition);
                processTemplate(typeMapperTemplate,model);
                gwt2jaxbMappings.setProperty(classnameFor.convert(typeDefinition),typeDefinition.getQualifiedName());
              }
 else               if (typeDefinition.isEnum()) {
                model.put("String_Node_Str",typeDefinition);
                processTemplate(enumTypeMapperTemplate,model);
                gwt2jaxbMappings.setProperty(classnameFor.convert(typeDefinition),typeDefinition.getQualifiedName());
              }
            }
 else {
              debug("String_Node_Str",typeDefinition.getQualifiedName());
            }
          }
        }
      }
      debug("String_Node_Str");
      for (      WebFault webFault : allFaults) {
        if (!isGWTTransient(webFault)) {
          model.put("String_Node_Str",webFault);
          processTemplate(faultMapperTemplate,model);
          gwt2jaxbMappings.setProperty(classnameFor.convert(webFault),webFault.getQualifiedName());
        }
      }
      FileOutputStream mappingsOut=new FileOutputStream(new File(serverSideGenerateDir,"String_Node_Str"));
      gwt2jaxbMappings.store(mappingsOut,"String_Node_Str");
      mappingsOut.flush();
      mappingsOut.close();
    }
  }
 else {
    info("String_Node_Str");
  }
  enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",clientSideGenerateDir));
  enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",serverSideGenerateDir));
  enunciate.addAdditionalSourceRoot(clientSideGenerateDir);
  enunciate.addAdditionalSourceRoot(serverSideGenerateDir);
}