Program: 20575
Project: 20575
Buggy source:
private void visit(IMethodModel m,String path){
  boolean hasPath=m.hasAnnotation(PATH);
  if (hasPath) {
    String localPath=m.getAnnotationValue(PATH);
    if (path.endsWith("String_Node_Str")) {
      if (localPath.startsWith("String_Node_Str")) {
        localPath=localPath.substring(1);
      }
    }
    path+=localPath;
  }
  boolean isWs=hasPath;
  for (  ActionType q : ActionType.values()) {
    boolean hasAnnotation=m.hasAnnotation(q.name());
    isWs|=hasAnnotation;
  }
  if (isWs) {
    Resource res=new Resource();
    IDocInfo documentation=getDocumentation(m);
    String returnName=null;
    String parameterName=null;
    ITypeModel returnedType=m.getReturnedType();
    if (returnedType != null) {
      if (returnedType.hasAnnotation(XML_ROOT_ELEMENT)) {
        generateXMLSchema(returnedType);
        returnName=returnedType.getName().toLowerCase();
      }
      if (hasPath) {
        if (consumedTypes.add(returnedType)) {
          ResourceVisitor resourceVisitor=createResourceVisitor();
          resourceVisitor.consumedTypes.addAll(this.consumedTypes);
          resourceVisitor.basePath=path;
          resourceVisitor.spec=this.spec;
          resourceVisitor.visit(returnedType);
        }
      }
    }
    ITypeModel bodyType=m.getBodyType();
    if (bodyType != null) {
      if (bodyType.hasAnnotation(XML_ROOT_ELEMENT)) {
        generateXMLSchema(bodyType);
        parameterName=bodyType.getName().toLowerCase();
      }
    }
    if (path.endsWith("String_Node_Str")) {
      res.setRelativeUri(path.substring(0,path.length() - 1));
    }
 else {
      res.setRelativeUri(path);
    }
    for (    ActionType q : ActionType.values()) {
      boolean hasAnnotation=m.hasAnnotation(q.name());
      if (hasAnnotation) {
        addMethod(q,res,m,documentation,returnName,parameterName);
      }
    }
    spec.addResource(res);
  }
}

Fixed version (ground truth):
private void visit(IMethodModel m,String path){
  boolean hasPath=m.hasAnnotation(PATH);
  if (hasPath) {
    String localPath=m.getAnnotationValue(PATH);
    if (path.endsWith("String_Node_Str")) {
      if (localPath.startsWith("String_Node_Str")) {
        localPath=localPath.substring(1);
      }
    }
    path+=localPath;
  }
  boolean isWs=hasPath;
  for (  ActionType q : ActionType.values()) {
    boolean hasAnnotation=m.hasAnnotation(q.name());
    isWs|=hasAnnotation;
  }
  if (isWs) {
    Resource res=new Resource();
    IDocInfo documentation=getDocumentation(m);
    String returnName=null;
    String parameterName=null;
    ITypeModel returnedType=m.getReturnedType();
    if (returnedType != null) {
      if (returnedType.hasAnnotation(XML_ROOT_ELEMENT)) {
        generateXMLSchema(returnedType,null);
        returnName=returnedType.getName().toLowerCase();
      }
      if (hasPath) {
        if (consumedTypes.add(returnedType)) {
          ResourceVisitor resourceVisitor=createResourceVisitor();
          resourceVisitor.consumedTypes.addAll(this.consumedTypes);
          resourceVisitor.basePath=path;
          resourceVisitor.spec=this.spec;
          resourceVisitor.visit(returnedType);
        }
      }
    }
    ITypeModel bodyType=m.getBodyType();
    if (bodyType != null) {
      if (bodyType.hasAnnotation(XML_ROOT_ELEMENT)) {
        generateXMLSchema(bodyType,null);
        parameterName=bodyType.getName().toLowerCase();
      }
    }
    if (path.endsWith("String_Node_Str")) {
      res.setRelativeUri(path.substring(0,path.length() - 1));
    }
 else {
      res.setRelativeUri(path);
    }
    for (    ActionType q : ActionType.values()) {
      boolean hasAnnotation=m.hasAnnotation(q.name());
      if (hasAnnotation) {
        addMethod(q,res,m,documentation,returnName,parameterName);
      }
    }
    spec.addResource(res);
  }
}