Program: 20581
Project: 20581
Buggy source:
private void addMethod(ActionType actionType,Resource res,IMethodModel m,IDocInfo documentation,String returnName,String parameterName){
  Action action=new Action();
  String description=documentation.getDocumentation();
  if (!"String_Node_Str".equals(description)) {
    action.setDescription(description);
  }
  ActionType adjustedActionType=adjustActionType(m,actionType);
  action.setType(adjustedActionType);
  res.getActions().put(adjustedActionType,action);
  processResponses(m,action,documentation,returnName);
  IParameterModel[] parameters=m.getParameters();
  for (  IParameterModel pm : parameters) {
    if (pm.hasAnnotation(QUERY_PARAM)) {
      IAnnotationModel paramAnnotation=pm.getAnnotation(QUERY_PARAM);
      QueryParameter value2=new QueryParameter();
      String paramName=configureParam(pm,value2,documentation,paramAnnotation);
      action.getQueryParameters().put(paramName,value2);
    }
  }
  for (  IParameterModel pm : parameters) {
    if (pm.hasAnnotation(HEADER_PARAM)) {
      IAnnotationModel paramAnnotation=pm.getAnnotation(HEADER_PARAM);
      Header value2=new Header();
      String paramName=configureParam(pm,value2,documentation,paramAnnotation);
      action.getHeaders().put(paramName,value2);
    }
  }
  for (  IParameterModel pm : parameters) {
    if (pm.hasAnnotation(PATH_PARAM)) {
      IAnnotationModel paramAnnotation=pm.getAnnotation(PATH_PARAM);
      UriParameter value2=new UriParameter();
      String paramName=configureParam(pm,value2,documentation,paramAnnotation);
      res.getUriParameters().put(paramName,value2);
    }
  }
  boolean hasBody=m.getBodyType() != null;
  String[] consumesValue=extractMediaTypes(m,CONSUMES,classConsumes,hasBody,adjustedActionType);
  if (consumesValue != null) {
    for (    String s : consumesValue) {
      s=sanitizeMediaType(s);
      MimeType bodyType=new MimeType();
      if (s.contains(XML)) {
        bodyType.setSchema(parameterName);
        if (parameterName != null) {
          bodyType.setExample(EXAMPLES_PREFFIX + parameterName + XML_FILE_EXT);
          bodyType.setExampleOrigin(EXAMPLES_PREFFIX + parameterName + XML_FILE_EXT);
        }
      }
      if (s.contains(JSON)) {
        if (parameterName != null) {
          bodyType.setSchema(parameterName + ResourceVisitor.JSONSCHEMA);
          bodyType.setExample(EXAMPLES_PREFFIX + parameterName + JSON_FILE_EXT);
          bodyType.setExampleOrigin(EXAMPLES_PREFFIX + parameterName + JSON_FILE_EXT);
        }
      }
      bodyType.setType(s);
      if (s.contains(FORM)) {
        for (        IParameterModel pm : parameters) {
          if (pm.hasAnnotation(FORM_PARAM)) {
            IAnnotationModel paramAnnotation=pm.getAnnotation(FORM_PARAM);
            FormParameter vl=new FormParameter();
            String paramName=configureParam(pm,vl,documentation,paramAnnotation);
            ArrayList<FormParameter> arrayList=new ArrayList<FormParameter>();
            arrayList.add(vl);
            if (bodyType.getFormParameters() == null) {
              bodyType.setFormParameters(new HashMap<String,java.util.List<FormParameter>>());
            }
            bodyType.getFormParameters().put(paramName,arrayList);
          }
        }
      }
      action.getBody().put(s,bodyType);
    }
  }
}

Fixed version (ground truth):
private void addMethod(ActionType actionType,Resource res,IMethodModel m,IDocInfo documentation,String returnName,String parameterName,boolean gotBodySchemesAndExamples){
  Action action=new Action();
  String description=documentation.getDocumentation();
  if (!"String_Node_Str".equals(description)) {
    action.setDescription(description);
  }
  ActionType adjustedActionType=adjustActionType(m,actionType);
  action.setType(adjustedActionType);
  res.getActions().put(adjustedActionType,action);
  processResponses(m,action,documentation,returnName);
  IParameterModel[] parameters=m.getParameters();
  for (  IParameterModel pm : parameters) {
    if (pm.hasAnnotation(QUERY_PARAM)) {
      IAnnotationModel paramAnnotation=pm.getAnnotation(QUERY_PARAM);
      QueryParameter value2=new QueryParameter();
      String paramName=configureParam(pm,value2,documentation,paramAnnotation);
      action.getQueryParameters().put(paramName,value2);
    }
  }
  for (  IParameterModel pm : parameters) {
    if (pm.hasAnnotation(HEADER_PARAM)) {
      IAnnotationModel paramAnnotation=pm.getAnnotation(HEADER_PARAM);
      Header value2=new Header();
      String paramName=configureParam(pm,value2,documentation,paramAnnotation);
      action.getHeaders().put(paramName,value2);
    }
  }
  for (  IParameterModel pm : parameters) {
    if (pm.hasAnnotation(PATH_PARAM)) {
      IAnnotationModel paramAnnotation=pm.getAnnotation(PATH_PARAM);
      UriParameter value2=new UriParameter();
      String paramName=configureParam(pm,value2,documentation,paramAnnotation);
      res.getUriParameters().put(paramName,value2);
    }
  }
  boolean hasBody=m.getBodyType() != null;
  String[] consumesValue=extractMediaTypes(m,CONSUMES,classConsumes,hasBody,adjustedActionType);
  if (consumesValue != null) {
    for (    String s : consumesValue) {
      s=sanitizeMediaType(s);
      MimeType bodyType=new MimeType();
      if (s.contains(XML)) {
        bodyType.setSchema(parameterName);
        if (parameterName != null && gotBodySchemesAndExamples) {
          bodyType.setExample(EXAMPLES_PREFFIX + parameterName + XML_FILE_EXT);
          bodyType.setExampleOrigin(EXAMPLES_PREFFIX + parameterName + XML_FILE_EXT);
        }
      }
      if (s.contains(JSON)) {
        if (parameterName != null && gotBodySchemesAndExamples) {
          bodyType.setSchema(parameterName + ResourceVisitor.JSONSCHEMA);
          bodyType.setExample(EXAMPLES_PREFFIX + parameterName + JSON_FILE_EXT);
          bodyType.setExampleOrigin(EXAMPLES_PREFFIX + parameterName + JSON_FILE_EXT);
        }
      }
      bodyType.setType(s);
      if (s.contains(FORM)) {
        for (        IParameterModel pm : parameters) {
          if (pm.hasAnnotation(FORM_PARAM)) {
            IAnnotationModel paramAnnotation=pm.getAnnotation(FORM_PARAM);
            FormParameter vl=new FormParameter();
            String paramName=configureParam(pm,vl,documentation,paramAnnotation);
            ArrayList<FormParameter> arrayList=new ArrayList<FormParameter>();
            arrayList.add(vl);
            if (bodyType.getFormParameters() == null) {
              bodyType.setFormParameters(new HashMap<String,java.util.List<FormParameter>>());
            }
            bodyType.getFormParameters().put(paramName,arrayList);
          }
        }
      }
      action.getBody().put(s,bodyType);
    }
  }
}