nus-yam/ex-repair huggingface dataset:
Program: 177136
Project: 177136
Buggy source:
/** 
 * Returns the qname of the element that has the first parameter as the namespace, the second as the element.
 * @param list The arguments.
 * @return The qname.
 */
public Object exec(List list) throws TemplateModelException {
  if (list.size() < 1) {
    throw new TemplateModelException("String_Node_Str");
  }
  TemplateModel from=(TemplateModel)list.get(0);
  Object unwrapped=BeansWrapper.getDefaultInstance().unwrap(from);
  if (!LocalElementDeclaration.class.isInstance(unwrapped)) {
    throw new TemplateModelException("String_Node_Str");
  }
  LocalElementDeclaration decl=(LocalElementDeclaration)unwrapped;
  String namespace=decl.getNamespace();
  SchemaInfo schemaInfo=getModel().getNamespacesToSchemas().get(namespace);
  if (schemaInfo != null) {
    for (    RootElementDeclaration rootElementDeclaration : schemaInfo.getGlobalElements()) {
      if (rootElementDeclaration.getName().equals(decl.getName())) {
        return true;
      }
    }
    for (    ImplicitSchemaElement implicitSchemaElement : schemaInfo.getImplicitSchemaElements()) {
      if (implicitSchemaElement.getElementName().equals(decl.getName())) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns the qname of the element that has the first parameter as the namespace, the second as the element.
 * @param list The arguments.
 * @return The qname.
 */
public Object exec(List list) throws TemplateModelException {
  if (list.size() < 1) {
    throw new TemplateModelException("String_Node_Str");
  }
  TemplateModel from=(TemplateModel)list.get(0);
  Object unwrapped=BeansWrapper.getDefaultInstance().unwrap(from);
  String namespace;
  String name;
  if (LocalElementDeclaration.class.isInstance(unwrapped)) {
    LocalElementDeclaration decl=(LocalElementDeclaration)unwrapped;
    namespace=decl.getNamespace();
    name=decl.getName();
  }
 else   if (ImplicitSchemaElement.class.isInstance(unwrapped)) {
    ImplicitSchemaElement ise=(ImplicitSchemaElement)unwrapped;
    namespace=ise.getTargetNamespace();
    name=ise.getElementName();
  }
 else {
    throw new TemplateModelException("String_Node_Str");
  }
  SchemaInfo schemaInfo=getModel().getNamespacesToSchemas().get(namespace);
  if (schemaInfo != null) {
    for (    RootElementDeclaration rootElementDeclaration : schemaInfo.getGlobalElements()) {
      if (rootElementDeclaration.getName().equals(name)) {
        return true;
      }
    }
    if (LocalElementDeclaration.class.isInstance(unwrapped)) {
      for (      ImplicitSchemaElement implicitSchemaElement : schemaInfo.getImplicitSchemaElements()) {
        if (implicitSchemaElement.getElementName().equals(name)) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 177137
Project: 177137
Buggy source:
public boolean endPathEntry(File pathEntry){
  this.classesImportedFromCurrentEntry=copyImportedClasses(this.currentEntryClassesToSources,this.classesToSources) || this.classesImportedFromCurrentEntry;
  this.currentEntry=null;
  this.currentEntryClassesToSources=null;
  return this.classesImportedFromCurrentEntry;
}

Fixed version (ground truth):
public boolean endPathEntry(File pathEntry){
  if (this.enunciate.getConfig() != null) {
    Set<String> classesFound=this.currentEntryClassesToSources.keySet();
    for (    DeploymentModule deploymentModule : this.enunciate.getConfig().getEnabledModules()) {
      if (deploymentModule instanceof EnunciateClasspathListener) {
        ((EnunciateClasspathListener)deploymentModule).onClassesFound(classesFound);
      }
    }
  }
  this.classesImportedFromCurrentEntry=copyImportedClasses(this.currentEntryClassesToSources,this.classesToSources) || this.classesImportedFromCurrentEntry;
  this.currentEntry=null;
  this.currentEntryClassesToSources=null;
  return this.classesImportedFromCurrentEntry;
}
Program: 177138
Project: 177138
Buggy source:
public void handleResource(ClasspathResource resource){
  String path=resource.getPath();
  if (resource instanceof JarClasspathResource) {
    if (path.endsWith("String_Node_Str")) {
      File sourceFile=new File(tempSourcesDir,path.substring(0,path.length() - 6) + "String_Node_Str");
      if (!packageInfoSources.containsKey(resource.getPath())) {
        enunciate.debug("String_Node_Str",sourceFile);
        try {
          InputStream resourceStream=resource.read();
          writePackageSourceFile(resourceStream,sourceFile);
          resourceStream.close();
          packageInfoSources.put(resource.getPath(),sourceFile);
        }
 catch (        IOException e) {
          enunciate.warn("String_Node_Str",sourceFile,e.getMessage());
        }
      }
    }
 else     if (path.endsWith("String_Node_Str")) {
      File sourceFile=new File(tempSourcesDir,path);
      enunciate.debug("String_Node_Str",path,sourceFile);
      try {
        InputStream in=resource.read();
        sourceFile.getParentFile().mkdirs();
        FileOutputStream out=new FileOutputStream(sourceFile);
        byte[] buffer=new byte[1024 * 2];
        int len;
        while ((len=in.read(buffer)) > 0) {
          out.write(buffer,0,len);
        }
        out.flush();
        out.close();
        in.close();
        packageInfoSources.put(resource.getPath(),sourceFile);
      }
 catch (      IOException e) {
        enunciate.warn("String_Node_Str",sourceFile,e.getMessage());
      }
    }
  }
}

Fixed version (ground truth):
public void handleResource(ClasspathResource resource){
  String path=resource.getPath();
  if (path.startsWith("String_Node_Str")) {
    return;
  }
  if (resource instanceof JarClasspathResource) {
    if (path.endsWith("String_Node_Str")) {
      File sourceFile=new File(tempSourcesDir,path.substring(0,path.length() - 6) + "String_Node_Str");
      if (!packageInfoSources.containsKey(path)) {
        enunciate.debug("String_Node_Str",sourceFile);
        try {
          InputStream resourceStream=resource.read();
          writePackageSourceFile(resourceStream,sourceFile);
          resourceStream.close();
          packageInfoSources.put(path,sourceFile);
        }
 catch (        IOException e) {
          enunciate.warn("String_Node_Str",sourceFile,e.getMessage());
        }
      }
    }
 else     if (path.endsWith("String_Node_Str")) {
      File sourceFile=new File(tempSourcesDir,path);
      enunciate.debug("String_Node_Str",path,sourceFile);
      try {
        InputStream in=resource.read();
        sourceFile.getParentFile().mkdirs();
        FileOutputStream out=new FileOutputStream(sourceFile);
        byte[] buffer=new byte[1024 * 2];
        int len;
        while ((len=in.read(buffer)) > 0) {
          out.write(buffer,0,len);
        }
        out.flush();
        out.close();
        in.close();
        packageInfoSources.put(path,sourceFile);
      }
 catch (      IOException e) {
        enunciate.warn("String_Node_Str",sourceFile,e.getMessage());
      }
    }
  }
}
Program: 177139
Project: 177139
Buggy source:
public void handleResource(ClasspathResource resource){
  String path=resource.getPath();
  if (path.endsWith("String_Node_Str")) {
    String modulename=path.substring(0,path.length() - 8).replace('/','.');
    enunciate.debug("String_Node_Str",modulename);
    int lastDot=modulename.lastIndexOf('.');
    if (lastDot < 0) {
      throw new IllegalStateException("String_Node_Str" + modulename);
    }
    String modulePackage=modulename.substring(0,lastDot);
    try {
      InputStream resourceStream=resource.read();
      Document document=documentBuilder.parse(resourceStream);
      resourceStream.close();
      NodeList sourceNodes=document.getDocumentElement().getElementsByTagName("String_Node_Str");
      if (sourceNodes.getLength() > 0) {
        for (int i=0; i < sourceNodes.getLength(); i++) {
          Element node=(Element)sourceNodes.item(i);
          String subPackage=node.getAttribute("String_Node_Str");
          String pckg=modulePackage + "String_Node_Str" + subPackage;
          enunciate.debug("String_Node_Str");
          this.sourcePackagesToModules.put(pckg,modulename);
        }
      }
 else {
        String pckg=modulePackage + "String_Node_Str";
        enunciate.debug("String_Node_Str");
        this.sourcePackagesToModules.put(pckg,modulename);
      }
    }
 catch (    Exception e) {
      enunciate.warn("String_Node_Str",e.getMessage());
    }
  }
}

Fixed version (ground truth):
public void handleResource(ClasspathResource resource){
  String path=resource.getPath();
  if (path.endsWith("String_Node_Str")) {
    String modulename=path.substring(0,path.length() - 8).replace('/','.');
    enunciate.debug("String_Node_Str",modulename);
    int lastDot=modulename.lastIndexOf('.');
    if (lastDot < 0) {
      throw new IllegalStateException("String_Node_Str" + modulename);
    }
    String modulePackage=modulename.substring(0,lastDot);
    try {
      InputStream resourceStream=resource.read();
      Document document=documentBuilder.parse(resourceStream);
      resourceStream.close();
      NodeList sourceNodes=document.getDocumentElement().getElementsByTagName("String_Node_Str");
      if (sourceNodes.getLength() > 0) {
        for (int i=0; i < sourceNodes.getLength(); i++) {
          Element node=(Element)sourceNodes.item(i);
          String subPackage=node.getAttribute("String_Node_Str");
          String pckg=modulePackage + "String_Node_Str" + subPackage;
          enunciate.debug("String_Node_Str",pckg);
          this.sourcePackagesToModules.put(pckg,modulename);
        }
      }
 else {
        String pckg=modulePackage + "String_Node_Str";
        enunciate.debug("String_Node_Str",pckg);
        this.sourcePackagesToModules.put(pckg,modulename);
      }
    }
 catch (    Exception e) {
      enunciate.warn("String_Node_Str",e.getMessage());
    }
  }
}
Program: 177141
Project: 177141
Buggy source:
@Override protected void doCompile() throws EnunciateException, IOException {
  Enunciate enunciate=getEnunciate();
  if (this.gwtApps.size() > 0) {
    doGWTCompile();
    enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",getAppGenerateDir()));
  }
  if (!enunciate.isUpToDate(getClientSideGenerateDir(),getClientSideCompileDir())) {
    debug("String_Node_Str");
    Collection<String> clientSideFiles=enunciate.getJavaFiles(getClientSideGenerateDir());
    String clientClasspath=enunciate.getEnunciateBuildClasspath();
    enunciate.invokeJavac(clientClasspath,"String_Node_Str",getClientSideCompileDir(),new ArrayList<String>(),clientSideFiles.toArray(new String[clientSideFiles.size()]));
  }
 else {
    info("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void doCompile() throws EnunciateException, IOException {
  Enunciate enunciate=getEnunciate();
  if (this.gwtApps.size() > 0) {
    doGWTCompile();
    enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",getAppGenerateDir()));
  }
  if (!enunciate.isUpToDate(getClientSideGenerateDir(),getClientSideCompileDir())) {
    debug("String_Node_Str");
    Collection<String> clientSideFiles=enunciate.getJavaFiles(getClientSideGenerateDir());
    String clientClasspath=enunciate.getEnunciateBuildClasspath() + File.pathSeparator + enunciate.getRuntimeClasspath();
    enunciate.invokeJavac(clientClasspath,"String_Node_Str",getClientSideCompileDir(),new ArrayList<String>(),clientSideFiles.toArray(new String[clientSideFiles.size()]));
  }
 else {
    info("String_Node_Str");
  }
}
Program: 177147
Project: 177147
Buggy source:
@Override public Map<EventType,String> unmarshal(List<Event> v) throws Exception {
  return null;
}

Fixed version (ground truth):
@Override public Map<EventType,String> unmarshal(EventDescriptionContainer v) throws Exception {
  return null;
}
Program: 177148
Project: 177148
Buggy source:
@Override public List<Event> marshal(Map<EventType,String> v) throws Exception {
  return null;
}

Fixed version (ground truth):
@Override public EventDescriptionContainer marshal(Map<EventType,String> v) throws Exception {
  return null;
}
Program: 177149
Project: 177149
Buggy source:
public AMFClassnameForMethod(Map<String,String> conversions){
  super(conversions);
}

Fixed version (ground truth):
public AMFClassnameForMethod(Map<String,String> conversions){
  super(conversions);
  this.classConversions.put(UUID.class.getName(),String.class.getName());
  this.classConversions.put(XMLGregorianCalendar.class.getName(),Date.class.getName());
  this.classConversions.put(QName.class.getName(),String.class.getName());
  this.classConversions.put(URI.class.getName(),String.class.getName());
  this.classConversions.put(DataHandler.class.getName(),"String_Node_Str");
}
Program: 177150
Project: 177150
Buggy source:
@Override public String convert(TypeMirror typeMirror) throws TemplateModelException {
  if ((typeMirror instanceof ArrayType) && (((ArrayType)typeMirror).getComponentType() instanceof PrimitiveType)) {
    return super.convert(((ArrayType)typeMirror).getComponentType()) + "String_Node_Str";
  }
 else   if (typeMirror instanceof EnumType) {
    return String.class.getName();
  }
  return super.convert(typeMirror);
}

Fixed version (ground truth):
@Override public String convert(TypeMirror typeMirror) throws TemplateModelException {
  DecoratedTypeMirror decorated=(DecoratedTypeMirror)TypeMirrorDecorator.decorate(typeMirror);
  if ((typeMirror instanceof ArrayType) && (((ArrayType)typeMirror).getComponentType() instanceof PrimitiveType)) {
    return super.convert(((ArrayType)typeMirror).getComponentType()) + "String_Node_Str";
  }
 else   if (decorated.isEnum()) {
    return String.class.getName();
  }
 else   if (decorated.isDeclared()) {
    DeclaredType declaredType=((DeclaredType)decorated);
    String fqn=declaredType.getDeclaration().getQualifiedName();
    if (classConversions.containsKey(fqn)) {
      return classConversions.get(fqn);
    }
  }
  return super.convert(typeMirror);
}
Program: 177151
Project: 177151
Buggy source:
/** 
 * Generates example xml to the specified parent element.
 * @param parent The parent element.
 */
public void generateExampleXml(org.jdom.Element parent){
  DocumentationExample exampleInfo=getAnnotation(DocumentationExample.class);
  if (exampleInfo == null || !exampleInfo.exclude()) {
    String namespace=getNamespace();
    String prefix=namespace == null ? null : ((EnunciateFreemarkerModel)FreemarkerModel.get()).getNamespacesToPrefixes().get(namespace);
    String exampleValue=exampleInfo == null || "String_Node_Str".equals(exampleInfo.value()) ? "String_Node_Str" : exampleInfo.value();
    org.jdom.Attribute attr=new org.jdom.Attribute(getName(),exampleValue,org.jdom.Namespace.getNamespace(prefix,namespace));
    parent.setAttribute(attr);
  }
}

Fixed version (ground truth):
/** 
 * Generates example xml to the specified parent element.
 * @param parent The parent element.
 */
public void generateExampleXml(org.jdom.Element parent){
  DocumentationExample exampleInfo=getAnnotation(DocumentationExample.class);
  if (exampleInfo == null || !exampleInfo.exclude()) {
    String namespace=getNamespace();
    String prefix=namespace == null ? null : ((EnunciateFreemarkerModel)FreemarkerModel.get()).getNamespacesToPrefixes().get(namespace);
    String exampleValue=exampleInfo == null || "String_Node_Str".equals(exampleInfo.value()) ? "String_Node_Str" : exampleInfo.value();
    Namespace jdomNS;
    if (org.jdom.Namespace.XML_NAMESPACE.getURI().equals(namespace)) {
      jdomNS=org.jdom.Namespace.XML_NAMESPACE;
    }
 else {
      jdomNS=Namespace.getNamespace(prefix,namespace);
    }
    org.jdom.Attribute attr=new org.jdom.Attribute(getName(),exampleValue,jdomNS);
    parent.setAttribute(attr);
  }
}
Program: 177153
Project: 177153
Buggy source:
/** 
 * Generate some example XML for this root element.
 * @return Some example XML.
 */
public String generateExampleXml(){
  try {
    String namespace=getNamespace();
    EnunciateFreemarkerModel model=(EnunciateFreemarkerModel)FreemarkerModel.get();
    String prefix=namespace == null ? null : model.getNamespacesToPrefixes().get(namespace);
    org.jdom.Element rootElement=new org.jdom.Element(getName(),org.jdom.Namespace.getNamespace(prefix,namespace));
    TypeDeclaration elementTypeDeclaration=getElementTypeDeclaration();
    if (elementTypeDeclaration instanceof ClassDeclaration) {
      TypeDefinition typeDef=model.findTypeDefinition((ClassDeclaration)elementTypeDeclaration);
      if (typeDef != null) {
        typeDef.generateExampleXml(rootElement);
      }
 else {
        rootElement.addContent(new Comment("String_Node_Str"));
      }
    }
 else {
      rootElement.addContent(new Comment("String_Node_Str"));
    }
    org.jdom.Document document=new org.jdom.Document(rootElement);
    XMLOutputter out=new XMLOutputter(org.jdom.output.Format.getPrettyFormat());
    StringWriter sw=new StringWriter();
    out.output(document,sw);
    sw.flush();
    return sw.toString();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Generate some example XML for this root element.
 * @return Some example XML.
 */
public String generateExampleXml(){
  try {
    String namespace=getNamespace();
    EnunciateFreemarkerModel model=(EnunciateFreemarkerModel)FreemarkerModel.get();
    String prefix=namespace == null ? null : model.getNamespacesToPrefixes().get(namespace);
    Namespace jdomNS;
    if (org.jdom.Namespace.XML_NAMESPACE.getURI().equals(namespace)) {
      jdomNS=org.jdom.Namespace.XML_NAMESPACE;
    }
 else {
      jdomNS=Namespace.getNamespace(prefix,namespace);
    }
    org.jdom.Element rootElement=new org.jdom.Element(getName(),jdomNS);
    TypeDeclaration elementTypeDeclaration=getElementTypeDeclaration();
    if (elementTypeDeclaration instanceof ClassDeclaration) {
      TypeDefinition typeDef=model.findTypeDefinition((ClassDeclaration)elementTypeDeclaration);
      if (typeDef != null) {
        typeDef.generateExampleXml(rootElement);
      }
 else {
        rootElement.addContent(new Comment("String_Node_Str"));
      }
    }
 else {
      rootElement.addContent(new Comment("String_Node_Str"));
    }
    org.jdom.Document document=new org.jdom.Document(rootElement);
    XMLOutputter out=new XMLOutputter(org.jdom.output.Format.getPrettyFormat());
    StringWriter sw=new StringWriter();
    out.output(document,sw);
    sw.flush();
    return sw.toString();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 177154
Project: 177154
Buggy source:
/** 
 * Generate some example XML for this root element.
 * @return Some example XML.
 */
public String generateExampleXml(){
  try {
    String namespace=getNamespace();
    String prefix=namespace == null ? null : ((EnunciateFreemarkerModel)FreemarkerModel.get()).getNamespacesToPrefixes().get(namespace);
    org.jdom.Element rootElement=new org.jdom.Element(getName(),org.jdom.Namespace.getNamespace(prefix,namespace));
    getTypeDefinition().generateExampleXml(rootElement);
    org.jdom.Document document=new org.jdom.Document(rootElement);
    XMLOutputter out=new XMLOutputter(org.jdom.output.Format.getPrettyFormat());
    StringWriter sw=new StringWriter();
    out.output(document,sw);
    sw.flush();
    return sw.toString();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Generate some example XML for this root element.
 * @return Some example XML.
 */
public String generateExampleXml(){
  try {
    String namespace=getNamespace();
    String prefix=namespace == null ? null : ((EnunciateFreemarkerModel)FreemarkerModel.get()).getNamespacesToPrefixes().get(namespace);
    Namespace jdomNS;
    if (org.jdom.Namespace.XML_NAMESPACE.getURI().equals(namespace)) {
      jdomNS=org.jdom.Namespace.XML_NAMESPACE;
    }
 else {
      jdomNS=Namespace.getNamespace(prefix,namespace);
    }
    org.jdom.Element rootElement=new org.jdom.Element(getName(),jdomNS);
    getTypeDefinition().generateExampleXml(rootElement);
    org.jdom.Document document=new org.jdom.Document(rootElement);
    XMLOutputter out=new XMLOutputter(org.jdom.output.Format.getPrettyFormat());
    StringWriter sw=new StringWriter();
    out.output(document,sw);
    sw.flush();
    return sw.toString();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 177155
Project: 177155
Buggy source:
/** 
 * Gets the client-side package for the type, type declaration, package, or their string values.
 * @param list The arguments.
 * @return The string value of the client-side package.
 */
public Object exec(List list) throws TemplateModelException {
  if (list.size() < 1) {
    throw new TemplateModelException("String_Node_Str");
  }
  StringModel model=(StringModel)list.get(0);
  String pattern=model.getAsString();
  if (pattern.endsWith("String_Node_Str")) {
    pattern=pattern + "String_Node_Str";
  }
  return pattern;
}

Fixed version (ground truth):
/** 
 * Gets the client-side package for the type, type declaration, package, or their string values.
 * @param list The arguments.
 * @return The string value of the client-side package.
 */
public Object exec(List list) throws TemplateModelException {
  if (list.size() < 1) {
    throw new TemplateModelException("String_Node_Str");
  }
  TemplateScalarModel model=(TemplateScalarModel)list.get(0);
  String pattern=model.getAsString();
  if (pattern.endsWith("String_Node_Str")) {
    pattern=pattern + "String_Node_Str";
  }
  return pattern;
}
Program: 177157
Project: 177157
Buggy source:
public void addRuleInstances(Digester digester){
  digester.addSetProperties("String_Node_Str");
}

Fixed version (ground truth):
public void addRuleInstances(Digester digester){
  digester.addSetProperties("String_Node_Str");
  digester.addCallMethod("String_Node_Str","String_Node_Str",2);
  digester.addCallParam("String_Node_Str",0,"String_Node_Str");
  digester.addCallParam("String_Node_Str",1,"String_Node_Str");
}
Program: 177158
Project: 177158
Buggy source:
@Override protected void doBuild() throws IOException, EnunciateException {
  Enunciate enunciate=getEnunciate();
  File buildDir=getBuildDir();
  if (!enunciate.isUpToDateWithSources(buildDir)) {
    copyPreBase();
    info("String_Node_Str",buildDir);
    for (    WebAppFragment fragment : enunciate.getWebAppFragments()) {
      if (fragment.getBaseDir() != null) {
        enunciate.copyDir(fragment.getBaseDir(),buildDir);
      }
    }
    if (isDoCompile()) {
      File webinf=new File(buildDir,"String_Node_Str");
      File webinfClasses=new File(webinf,"String_Node_Str");
      enunciate.copyDir(getCompileDir(),webinfClasses);
    }
    if (isDoLibCopy()) {
      doLibCopy();
    }
 else {
      info("String_Node_Str");
    }
    generateWebXml();
    copySpringConfig();
    if (isEnableSecurity()) {
      createSecurityUI();
    }
    copyPostBase();
  }
 else {
    info("String_Node_Str");
  }
  enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",buildDir));
}

Fixed version (ground truth):
@Override protected void doBuild() throws IOException, EnunciateException {
  Enunciate enunciate=getEnunciate();
  File buildDir=getBuildDir();
  if (!enunciate.isUpToDateWithSources(buildDir)) {
    copyPreBase();
    info("String_Node_Str",buildDir);
    if (!this.globalServletFilters.isEmpty()) {
      Set<String> allServletUrls=new TreeSet<String>();
      for (      WebAppFragment fragment : enunciate.getWebAppFragments()) {
        if (fragment.getServlets() != null) {
          for (          WebAppComponent servletComponent : fragment.getServlets()) {
            allServletUrls.addAll(servletComponent.getUrlMappings());
          }
        }
      }
      for (      WebAppComponent filter : this.globalServletFilters) {
        filter.setUrlMappings(allServletUrls);
      }
      BaseWebAppFragment fragment=new BaseWebAppFragment("String_Node_Str");
      fragment.setFilters(this.globalServletFilters);
      enunciate.addWebAppFragment(fragment);
    }
    for (    WebAppFragment fragment : enunciate.getWebAppFragments()) {
      if (fragment.getBaseDir() != null) {
        enunciate.copyDir(fragment.getBaseDir(),buildDir);
      }
    }
    if (isDoCompile()) {
      File webinf=new File(buildDir,"String_Node_Str");
      File webinfClasses=new File(webinf,"String_Node_Str");
      enunciate.copyDir(getCompileDir(),webinfClasses);
    }
    if (isDoLibCopy()) {
      doLibCopy();
    }
 else {
      info("String_Node_Str");
    }
    generateWebXml();
    copySpringConfig();
    if (isEnableSecurity()) {
      createSecurityUI();
    }
    copyPostBase();
  }
 else {
    info("String_Node_Str");
  }
  enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",buildDir));
}
Program: 177159
Project: 177159
Buggy source:
@Override public void init(Enunciate enunciate) throws EnunciateException {
  super.init(enunciate);
  if (!isDisabled()) {
    if (getDefaultDependencyCheck() != null) {
      warn("String_Node_Str");
    }
    if (getDefaultAutowire() != null) {
      warn("String_Node_Str");
    }
    if (getDispatcherServletClass() != null) {
      warn("String_Node_Str");
    }
    if ((this.warConfig != null) && (this.warConfig.getDocsDir() != null)) {
      warn("String_Node_Str");
    }
    if (isEnableSecurity()) {
      if (getSecurityConfig().isEnableBasicHTTPAuth() && getSecurityConfig().isEnableDigestHTTPAuth()) {
        throw new EnunciateException("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
@Override public void init(Enunciate enunciate) throws EnunciateException {
  super.init(enunciate);
  if (!isDisabled()) {
    if (getDefaultDependencyCheck() != null) {
      warn("String_Node_Str");
    }
    if (getDefaultAutowire() != null) {
      warn("String_Node_Str");
    }
    if (getDispatcherServletClass() != null) {
      warn("String_Node_Str");
    }
    if ((this.warConfig != null) && (this.warConfig.getDocsDir() != null)) {
      warn("String_Node_Str");
    }
    if (isEnableSecurity()) {
      if (getSecurityConfig().isEnableBasicHTTPAuth() && getSecurityConfig().isEnableDigestHTTPAuth()) {
        throw new EnunciateException("String_Node_Str");
      }
    }
    if (!this.globalServletFilters.isEmpty()) {
      for (      WebAppComponent globalServletFilter : this.globalServletFilters) {
        if (globalServletFilter.getName() == null) {
          throw new EnunciateException("String_Node_Str");
        }
        if (globalServletFilter.getClassname() == null) {
          throw new EnunciateException("String_Node_Str");
        }
      }
    }
  }
}
Program: 177161
Project: 177161
Buggy source:
/** 
 * Whether to enable form-based login.
 * @param enableFormBasedLogin Whether to enable form-based login.
 */
public void setEnableFormBasedLogin(boolean enableFormBasedLogin){
  this.enableFormBasedLogin=enableFormBasedLogin;
  if (enableFormBasedLogin) {
  }
}

Fixed version (ground truth):
/** 
 * Whether to enable form-based login.
 * @param enableFormBasedLogin Whether to enable form-based login.
 */
public void setEnableFormBasedLogin(boolean enableFormBasedLogin){
  this.enableFormBasedLogin=enableFormBasedLogin;
}
Program: 177162
Project: 177162
Buggy source:
/** 
 * Load the known content types (map of content type to id).
 * @return The known content type.
 */
protected HashMap<String,String> loadKnownContentTypes(){
  HashMap<String,String> contentTypes=new HashMap<String,String>();
  contentTypes.put("String_Node_Str","String_Node_Str");
  contentTypes.put("String_Node_Str","String_Node_Str");
  contentTypes.put("String_Node_Str","String_Node_Str");
  return contentTypes;
}

Fixed version (ground truth):
/** 
 * Load the known content types (map of content type to id).
 * @return The known content type.
 */
protected HashMap<String,String> loadKnownContentTypes(){
  HashMap<String,String> contentTypes=new HashMap<String,String>();
  contentTypes.put("String_Node_Str","String_Node_Str");
  return contentTypes;
}
Program: 177163
Project: 177163
Buggy source:
/** 
 * Add a JAX-RS provider to the model.
 * @param declaration The declaration of the provider.
 */
public void addJAXRSProvider(TypeDeclaration declaration){
  this.jaxrsProviders.add(declaration);
  Produces produces=declaration.getAnnotation(Produces.class);
  if (produces != null) {
    for (    String contentType : produces.value()) {
      try {
        addContentType(MimeType.parse(contentType).toString());
      }
 catch (      Exception e) {
        addContentType(contentType);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Add a JAX-RS provider to the model.
 * @param declaration The declaration of the provider.
 */
public void addJAXRSProvider(TypeDeclaration declaration){
  this.jaxrsProviders.add(declaration);
  Produces produces=declaration.getAnnotation(Produces.class);
  if (produces != null) {
    for (    String contentType : produces.value()) {
      try {
        addContentType(MimeType.parse(contentType).toString());
      }
 catch (      Exception e) {
        addContentType(contentType);
      }
    }
  }
  Consumes consumes=declaration.getAnnotation(Consumes.class);
  if (consumes != null) {
    for (    String contentType : consumes.value()) {
      try {
        addContentType(MimeType.parse(contentType).toString());
      }
 catch (      Exception e) {
        addContentType(contentType);
      }
    }
  }
}
Program: 177165
Project: 177165
Buggy source:
/** 
 * The generate logic builds the XML documentation structure for the enunciated API.
 */
public void doFreemarkerGenerate() throws EnunciateException, IOException, TemplateException {
  if (!getEnunciate().isUpToDateWithSources(getGenerateDir())) {
    EnunciateFreemarkerModel model=getModel();
    if (this.splashPackage != null) {
      PackageDeclaration packageDeclaration=Context.getCurrentEnvironment().getPackage(this.splashPackage);
      if (packageDeclaration != null) {
        info("String_Node_Str",this.splashPackage);
        model.setVariable("String_Node_Str",new DecoratedPackageDeclaration(packageDeclaration).getJavaDoc());
      }
 else {
        warn("String_Node_Str",this.splashPackage);
      }
    }
    if (this.copyright != null) {
      debug("String_Node_Str",this.copyright);
      model.setVariable("String_Node_Str",this.copyright);
    }
    if (this.title != null) {
      debug("String_Node_Str",this.title);
      model.setVariable("String_Node_Str",this.title);
    }
    model.setVariable("String_Node_Str",new UniqueContentTypesMethod());
    processTemplate(getDocsTemplateURL(),model);
  }
 else {
    info("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * The generate logic builds the XML documentation structure for the enunciated API.
 */
public void doFreemarkerGenerate() throws EnunciateException, IOException, TemplateException {
  if (!getEnunciate().isUpToDateWithSources(getGenerateDir())) {
    EnunciateFreemarkerModel model=getModel();
    if (this.splashPackage != null) {
      PackageDeclaration packageDeclaration=Context.getCurrentEnvironment().getPackage(this.splashPackage);
      if (packageDeclaration != null) {
        info("String_Node_Str",this.splashPackage);
        model.setVariable("String_Node_Str",new DecoratedPackageDeclaration(packageDeclaration).getJavaDoc());
      }
 else {
        warn("String_Node_Str",this.splashPackage);
      }
    }
    if (this.copyright != null) {
      debug("String_Node_Str",this.copyright);
      model.setVariable("String_Node_Str",this.copyright);
    }
    if (this.title != null) {
      debug("String_Node_Str",this.title);
      model.setVariable("String_Node_Str",this.title);
    }
    model.setVariable("String_Node_Str",new UniqueContentTypesMethod(Collections.unmodifiableSet(model.getContentTypesToIds().keySet())));
    processTemplate(getDocsTemplateURL(),model);
  }
 else {
    info("String_Node_Str");
  }
}
Program: 177168
Project: 177168
Buggy source:
/** 
 * The namespace of the local element.
 * @return The namespace of the local element.
 */
public String getNamespace(){
  String namespace=elementDecl.namespace();
  if ("String_Node_Str".equals(namespace)) {
    namespace=this.registry.getSchema().getNamespace();
  }
  return namespace;
}

Fixed version (ground truth):
/** 
 * The namespace of the local element.
 * @return The namespace of the local element.
 */
public String getNamespace(){
  String namespace=elementDecl.namespace();
  if ("String_Node_Str".equals(namespace)) {
    namespace=this.registry.getSchema().getNamespace();
  }
  return "String_Node_Str".equals(namespace) ? null : namespace;
}
Program: 177169
Project: 177169
Buggy source:
/** 
 * The element xml type.
 * @return The element xml type.
 */
public XmlType getElementXmlType(){
  return elementXmlType;
}

Fixed version (ground truth):
/** 
 * The element xml type.
 * @return The element xml type.
 */
public XmlType getElementXmlType(){
  try {
    return XmlTypeFactory.getXmlType(getParameters().iterator().next().getType());
  }
 catch (  XmlTypeException e) {
    throw new ValidationException(getPosition(),e.getMessage());
  }
}
Program: 177170
Project: 177170
Buggy source:
public LocalElementDeclaration(MethodDeclaration delegate,Registry registry){
  super(delegate);
  this.registry=registry;
  elementDecl=delegate.getAnnotation(XmlElementDecl.class);
  if (elementDecl == null) {
    throw new IllegalArgumentException(getPosition() + "String_Node_Str");
  }
  Collection<ParameterDeclaration> params=getParameters();
  if (params.size() != 1) {
    throw new IllegalArgumentException(getPosition() + "String_Node_Str");
  }
  ParameterDeclaration param=params.iterator().next();
  if (!(param.getType() instanceof DeclaredType)) {
    throw new IllegalArgumentException(getPosition() + "String_Node_Str");
  }
  elementTypeDeclaration=((DeclaredType)param.getType()).getDeclaration();
  try {
    this.elementXmlType=XmlTypeFactory.getXmlType(param.getType());
  }
 catch (  XmlTypeException e) {
    throw new ValidationException(getPosition(),e.getMessage());
  }
}

Fixed version (ground truth):
public LocalElementDeclaration(MethodDeclaration delegate,Registry registry){
  super(delegate);
  this.registry=registry;
  elementDecl=delegate.getAnnotation(XmlElementDecl.class);
  if (elementDecl == null) {
    throw new IllegalArgumentException(getPosition() + "String_Node_Str");
  }
  Collection<ParameterDeclaration> params=getParameters();
  if (params.size() != 1) {
    throw new IllegalArgumentException(getPosition() + "String_Node_Str");
  }
  ParameterDeclaration param=params.iterator().next();
  if (!(param.getType() instanceof DeclaredType)) {
    throw new IllegalArgumentException(getPosition() + "String_Node_Str");
  }
  elementTypeDeclaration=((DeclaredType)param.getType()).getDeclaration();
}
Program: 177171
Project: 177171
Buggy source:
public boolean isReadable(Class type,Type genericType,Annotation[] annotations,MediaType mediaType){
  return true;
}

Fixed version (ground truth):
public boolean isReadable(Class type,Type genericType,Annotation[] annotations,MediaType mediaType){
  AMFMapper mapper=AMFMapperIntrospector.getAMFMapper(type,genericType);
  if (mapper instanceof CustomAMFMapper) {
    return type.isAssignableFrom(((CustomAMFMapper)mapper).getJaxbClass());
  }
 else {
    return ((mapper instanceof CollectionAMFMapper) || (mapper instanceof MapAMFMapper));
  }
}
Program: 177172
Project: 177172
Buggy source:
public boolean isWriteable(Class type,Type genericType,Annotation[] annotations,MediaType mediaType){
  return true;
}

Fixed version (ground truth):
public boolean isWriteable(Class type,Type genericType,Annotation[] annotations,MediaType mediaType){
  AMFMapper mapper=AMFMapperIntrospector.getAMFMapper(type,genericType);
  if (mapper instanceof CustomAMFMapper) {
    return ((CustomAMFMapper)mapper).getJaxbClass().isAssignableFrom(type);
  }
 else {
    return ((mapper instanceof CollectionAMFMapper) || (mapper instanceof MapAMFMapper));
  }
}
Program: 177173
Project: 177173
Buggy source:
/** 
 * Whether this converter is enabled to output jdk 15 compatible classes.
 * @return Whether this converter is enabled to output jdk 15 compatible classes.
 */
public boolean isJdk15(){
  return jdk15 && !FORCE_NOT_15.get();
}

Fixed version (ground truth):
/** 
 * Whether this converter is enabled to output jdk 15 compatible classes.
 * @return Whether this converter is enabled to output jdk 15 compatible classes.
 */
public boolean isJdk15(){
  return jdk15 && (FORCE_NOT_15.get() == null || !FORCE_NOT_15.get());
}
Program: 177175
Project: 177175
Buggy source:
@Override protected void doCompile() throws EnunciateException, IOException {
  Enunciate enunciate=getEnunciate();
  if (isSwcDownloadable() || this.flexApps.size() > 0) {
    doFlexCompile();
    if (this.flexApps.size() > 0) {
      enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",getSwfCompileDir()));
    }
  }
}

Fixed version (ground truth):
@Override protected void doCompile() throws EnunciateException, IOException {
  Enunciate enunciate=getEnunciate();
  if (isSwcDownloadable() || this.flexApps.size() > 0 || isAsSourcesDownloadable()) {
    doFlexCompile();
    if (this.flexApps.size() > 0) {
      enunciate.addArtifact(new FileArtifact(getName(),"String_Node_Str",getSwfCompileDir()));
    }
  }
}
Program: 177176
Project: 177176
Buggy source:
@Override public ValidationResult validateSimpleType(SimpleTypeDefinition simpleType){
  ValidationResult result=super.validateSimpleType(simpleType);
  if (!isAMFTransient(simpleType)) {
    if (!hasDefaultConstructor(simpleType)) {
      result.addError(simpleType,"String_Node_Str");
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public ValidationResult validateSimpleType(SimpleTypeDefinition simpleType){
  ValidationResult result=super.validateSimpleType(simpleType);
  if (!isAMFTransient(simpleType)) {
    if (!hasDefaultConstructor(simpleType)) {
      result.addError(simpleType,"String_Node_Str");
    }
    if ("String_Node_Str".equals(simpleType.getSimpleName())) {
      result.addError(simpleType,"String_Node_Str");
    }
  }
  return result;
}
Program: 177181
Project: 177181
Buggy source:
/** 
 * Adds all files in specified directories to a list.
 * @param list The list.
 * @param dirs The directories.
 */
protected void buildFileList(List<File> list,File... dirs){
  for (  File dir : dirs) {
    for (    File file : dir.listFiles()) {
      list.add(file);
      if (file.isDirectory()) {
        buildFileList(list,file);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds all files in specified directories to a list.
 * @param list The list.
 * @param dirs The directories.
 */
protected void buildFileList(List<File> list,File... dirs){
  for (  File dir : dirs) {
    for (    File file : dir.listFiles()) {
      if (file.isDirectory()) {
        buildFileList(list,file);
      }
 else {
        list.add(file);
      }
    }
  }
}
Program: 177182
Project: 177182
Buggy source:
/** 
 * Whether a given destination file is newer than all the specified source files. If the destination file is a directory its timestamp is the timestamp of the earliest-modified file.
 * @param sourceFiles The specified source files.
 * @param destFile The destination file.
 * @return Whether the destination file is up-to-date.
 */
protected boolean isUpToDate(List<File> sourceFiles,File destFile){
  List<File> destFiles;
  if ((sourceFiles == null) || (sourceFiles.isEmpty())) {
    return true;
  }
 else   if ((destFile == null) || (!destFile.exists())) {
    return false;
  }
 else   if (!destFile.isDirectory()) {
    destFiles=Arrays.asList(destFile);
  }
 else {
    destFiles=new ArrayList<File>();
    buildFileList(destFiles,destFile);
  }
  return !destFiles.isEmpty() && getLatestTimestamp(sourceFiles) < getEarliestTimestamp(destFiles);
}

Fixed version (ground truth):
/** 
 * Whether a given destination file is newer than all the specified source files. If the destination file is a directory its timestamp is the timestamp of the earliest-modified file.
 * @param sourceFiles The specified source files.
 * @param destFile The destination file.
 * @return Whether the destination file is up-to-date.
 */
protected boolean isUpToDate(List<File> sourceFiles,File destFile){
  List<File> destFiles;
  if ((sourceFiles == null) || (sourceFiles.isEmpty())) {
    debug("String_Node_Str",destFile);
    return true;
  }
 else   if ((destFile == null) || (!destFile.exists())) {
    debug("String_Node_Str",destFile);
    return false;
  }
 else   if (!destFile.isDirectory()) {
    destFiles=Arrays.asList(destFile);
  }
 else {
    destFiles=new ArrayList<File>();
    buildFileList(destFiles,destFile);
  }
  if (destFiles.isEmpty()) {
    debug("String_Node_Str");
    return false;
  }
 else {
    File youngestSource=getYoungest(sourceFiles);
    File oldestDest=getOldest(destFiles);
    if (youngestSource.lastModified() < oldestDest.lastModified()) {
      debug("String_Node_Str",destFile,oldestDest,youngestSource);
      return true;
    }
 else {
      debug("String_Node_Str",destFile,oldestDest,youngestSource);
      return false;
    }
  }
}
Program: 177183
Project: 177183
Buggy source:
/** 
 * Add an additional source root for Enunciate to process.
 * @param root The source root directory.
 */
public void addAdditionalSourceRoot(File root){
  this.additionalSourceRoots.add(root);
}

Fixed version (ground truth):
/** 
 * Add an additional source root for Enunciate to process.
 * @param root The source root directory.
 */
public void addAdditionalSourceRoot(File root){
  info("String_Node_Str" + root + "String_Node_Str");
  this.additionalSourceRoots.add(root);
}
Program: 177184
Project: 177184
Buggy source:
/** 
 * The generate logic builds the XML documentation structure for the enunciated API.
 */
public void doFreemarkerGenerate() throws EnunciateException, IOException, TemplateException {
  if (!getEnunciate().isUpToDateWithSources(getGenerateDir())) {
    EnunciateFreemarkerModel model=getModel();
    if (this.splashPackage != null) {
      PackageDeclaration packageDeclaration=Context.getCurrentEnvironment().getPackage(this.splashPackage);
      if (packageDeclaration != null) {
        info("String_Node_Str",this.splashPackage);
        model.setVariable("String_Node_Str",new DecoratedPackageDeclaration(packageDeclaration).getJavaDoc());
      }
 else {
        warn("String_Node_Str",this.splashPackage);
      }
    }
    if (this.copyright != null) {
      debug("String_Node_Str",this.copyright);
      model.setVariable("String_Node_Str",this.copyright);
    }
    if (this.title != null) {
      debug("String_Node_Str",this.title);
      model.setVariable("String_Node_Str",this.title);
    }
    model.setVariable("String_Node_Str",model.getBaseDeploymentAddress());
    model.setVariable("String_Node_Str",new ResourcePathMethod());
    processTemplate(getDocsTemplateURL(),model);
  }
 else {
    info("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * The generate logic builds the XML documentation structure for the enunciated API.
 */
public void doFreemarkerGenerate() throws EnunciateException, IOException, TemplateException {
  if (!getEnunciate().isUpToDateWithSources(getGenerateDir())) {
    EnunciateFreemarkerModel model=getModel();
    if (this.splashPackage != null) {
      PackageDeclaration packageDeclaration=Context.getCurrentEnvironment().getPackage(this.splashPackage);
      if (packageDeclaration != null) {
        info("String_Node_Str",this.splashPackage);
        model.setVariable("String_Node_Str",new DecoratedPackageDeclaration(packageDeclaration).getJavaDoc());
      }
 else {
        warn("String_Node_Str",this.splashPackage);
      }
    }
    if (this.copyright != null) {
      debug("String_Node_Str",this.copyright);
      model.setVariable("String_Node_Str",this.copyright);
    }
    if (this.title != null) {
      debug("String_Node_Str",this.title);
      model.setVariable("String_Node_Str",this.title);
    }
    model.setVariable("String_Node_Str",model.getBaseDeploymentAddress());
    model.setVariable("String_Node_Str",new ResourcePathMethod());
    model.setVariable("String_Node_Str",new UniqueContentTypesMethod());
    processTemplate(getDocsTemplateURL(),model);
  }
 else {
    info("String_Node_Str");
  }
}
Program: 177185
Project: 177185
Buggy source:
/** 
 * Get the GWT shell script file for the specified module, app.
 * @param appName The app name.
 * @param moduleName The module name.
 * @return The shell script file.
 */
public File getShellScriptFile(String appName,String moduleName){
  StringBuilder filename=new StringBuilder();
  if ((appName != null) && (appName.trim().length() > 0)) {
    filename.append(appName).append('-');
  }
  String moduleId=getModuleId(moduleName);
  filename.append(moduleId).append("String_Node_Str");
  File scriptDir=getGwtScriptDir();
  if (!scriptDir.exists()) {
    scriptDir.mkdirs();
  }
  return new File(scriptDir,filename.toString());
}

Fixed version (ground truth):
/** 
 * Get the GWT shell script file for the specified module, app.
 * @param appName    The app name.
 * @param moduleName The module name.
 * @return The shell script file.
 */
public File getShellScriptFile(String appName,String moduleName){
  StringBuilder filename=new StringBuilder();
  if ((appName != null) && (appName.trim().length() > 0)) {
    filename.append(appName).append('-');
  }
  String moduleId=getModuleId(moduleName);
  filename.append(moduleId).append("String_Node_Str");
  File scriptDir=getGwtScriptDir();
  if (!scriptDir.exists()) {
    scriptDir.mkdirs();
  }
  return new File(scriptDir,filename.toString());
}
Program: 177187
Project: 177187
Buggy source:
/** 
 * test getContentType
 */
public void testGetContentType() throws Exception {
  RESTContentTypeRoutingController controller=new RESTContentTypeRoutingController(new RESTResource("String_Node_Str"),null);
  HttpServletRequest request=createMock(HttpServletRequest.class);
  expect(request.getParameter("String_Node_Str")).andReturn("String_Node_Str");
  replay(request);
  assertEquals("String_Node_Str",controller.getContentType(request));
  verify(request);
  reset(request);
  expect(request.getParameter("String_Node_Str")).andReturn(null);
  expect(request.getContentType()).andReturn("String_Node_Str");
  replay(request);
  assertEquals("String_Node_Str",controller.getContentType(request));
  verify(request);
  reset(request);
}

Fixed version (ground truth):
/** 
 * test getContentType
 */
public void testGetContentType() throws Exception {
  RESTContentTypeRoutingController controller=new RESTContentTypeRoutingController(new RESTResource("String_Node_Str"),null);
  HttpServletRequest request=createMock(HttpServletRequest.class);
  expect(request.getParameter("String_Node_Str")).andReturn("String_Node_Str");
  replay(request);
  assertEquals("String_Node_Str",controller.getContentType(request));
  verify(request);
  reset(request);
}
Program: 177188
Project: 177188
Buggy source:
/** 
 * Get the content type for the specified request.
 * @param request The request.
 * @return The content type.
 */
protected String getContentType(HttpServletRequest request){
  String contentType=request.getParameter(getContentTypeParameter());
  if (contentType == null) {
    contentType=request.getContentType();
    if (contentType != null) {
      int semiIndex=contentType.indexOf(';');
      if (semiIndex >= 0) {
        contentType=contentType.substring(0,semiIndex);
      }
    }
 else {
      contentType=this.defaultContentType;
    }
  }
  return contentType;
}

Fixed version (ground truth):
/** 
 * Get the content type for the specified request.
 * @param request The request.
 * @return The content type.
 */
protected String getContentType(HttpServletRequest request){
  String contentType=request.getParameter(getContentTypeParameter());
  if (contentType == null) {
    contentType=this.defaultContentType;
  }
  return contentType;
}