Program: 51169
Project: 51169
Buggy source:
private Request generateRequest(AbstractResource r,final AbstractResourceMethod m,Map<String,Param> wadlResourceParams){
  if (m.getParameters().size() == 0) {
    return null;
  }
  Request wadlRequest=_wadlGenerator.createRequest(r,m);
  for (  Parameter p : m.getParameters()) {
    if (p.getSource() == Parameter.Source.ENTITY) {
      for (      MediaType mediaType : m.getSupportedInputTypes()) {
        setRepresentationForMediaType(r,m,mediaType,wadlRequest);
      }
    }
 else     if (p.getAnnotation().annotationType() == FormParam.class) {
      List<MediaType> supportedInputTypes=m.getSupportedInputTypes();
      if (supportedInputTypes.size() == 0 || (supportedInputTypes.size() == 1 && supportedInputTypes.get(0).isWildcardType())) {
        supportedInputTypes=Collections.singletonList(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
      }
      for (      MediaType mediaType : m.getSupportedInputTypes()) {
        final RepresentationType wadlRepresentation=setRepresentationForMediaType(r,m,mediaType,wadlRequest);
        if (getParamByName(wadlRepresentation.getParam(),p.getSourceName()) == null) {
          final Param wadlParam=generateParam(r,m,p);
          if (wadlParam != null) {
            wadlRepresentation.getParam().add(wadlParam);
          }
        }
      }
    }
 else {
      Param wadlParam=generateParam(r,m,p);
      if (wadlParam == null) {
        continue;
      }
      if (wadlParam.getStyle() == ParamStyle.TEMPLATE) {
        wadlResourceParams.put(wadlParam.getName(),wadlParam);
      }
 else {
        wadlRequest.getParam().add(wadlParam);
      }
    }
  }
  if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) {
    return null;
  }
 else {
    return wadlRequest;
  }
}

Fixed version (ground truth):
private Request generateRequest(AbstractResource r,final AbstractResourceMethod m,Map<String,Param> wadlResourceParams){
  if (m.getParameters().size() == 0) {
    return null;
  }
  Request wadlRequest=_wadlGenerator.createRequest(r,m);
  for (  Parameter p : m.getParameters()) {
    if (p.getSource() == Parameter.Source.ENTITY) {
      for (      MediaType mediaType : m.getSupportedInputTypes()) {
        setRepresentationForMediaType(r,m,mediaType,wadlRequest);
      }
    }
 else     if (p.getAnnotation().annotationType() == FormParam.class) {
      List<MediaType> supportedInputTypes=m.getSupportedInputTypes();
      if (supportedInputTypes.size() == 0 || (supportedInputTypes.size() == 1 && supportedInputTypes.get(0).isWildcardType())) {
        supportedInputTypes=Collections.singletonList(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
      }
      for (      MediaType mediaType : supportedInputTypes) {
        final RepresentationType wadlRepresentation=setRepresentationForMediaType(r,m,mediaType,wadlRequest);
        if (getParamByName(wadlRepresentation.getParam(),p.getSourceName()) == null) {
          final Param wadlParam=generateParam(r,m,p);
          if (wadlParam != null) {
            wadlRepresentation.getParam().add(wadlParam);
          }
        }
      }
    }
 else {
      Param wadlParam=generateParam(r,m,p);
      if (wadlParam == null) {
        continue;
      }
      if (wadlParam.getStyle() == ParamStyle.TEMPLATE) {
        wadlResourceParams.put(wadlParam.getName(),wadlParam);
      }
 else {
        wadlRequest.getParam().add(wadlParam);
      }
    }
  }
  if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) {
    return null;
  }
 else {
    return wadlRequest;
  }
}