Program: 177219
Project: 177219
Buggy source:
public WebMethod(MethodDeclaration delegate,EndpointInterface endpointInterface){
  super(delegate);
  this.annotation=getAnnotation(javax.jws.WebMethod.class);
  this.oneWay=getAnnotation(Oneway.class) != null;
  this.endpointInterface=endpointInterface;
  this.webResult=new WebResult(getReturnType(),this);
  Collection<ParameterDeclaration> parameters=getParameters();
  Collection<WebParam> webParameters=new ArrayList<WebParam>(parameters.size());
  for (  ParameterDeclaration parameter : parameters) {
    webParameters.add(new WebParam(parameter,this));
  }
  this.webParams=webParameters;
  Collection<WebFault> webFaults=new ArrayList<WebFault>();
  for (  ReferenceType referenceType : getThrownTypes()) {
    if (!(referenceType instanceof DeclaredType)) {
      throw new ValidationException(getPosition(),"String_Node_Str");
    }
    TypeDeclaration declaration=((DeclaredType)referenceType).getDeclaration();
    if (declaration == null) {
      throw new ValidationException(getPosition(),"String_Node_Str" + referenceType);
    }
    webFaults.add(new WebFault((ClassDeclaration)declaration));
  }
  this.webFaults=webFaults;
  Collection<WebMessage> messages=new ArrayList<WebMessage>();
  SOAPBinding.Style bindingStyle=getSoapBindingStyle();
  for (  WebParam webParam : webParameters) {
    if (webParam.isHeader()) {
      messages.add(webParam);
    }
  }
  if (webResult.isHeader()) {
    messages.add(webResult);
  }
  if (bindingStyle == SOAPBinding.Style.DOCUMENT) {
    SOAPBinding.ParameterStyle parameterStyle=getSoapParameterStyle();
    if (parameterStyle == SOAPBinding.ParameterStyle.WRAPPED) {
      messages.add(new RequestWrapper(this));
      if (!isOneWay()) {
        messages.add(new ResponseWrapper(this));
      }
      messages.addAll(webFaults);
    }
 else {
      for (      WebParam webParam : webParameters) {
        if (!webParam.isHeader()) {
          messages.add(webParam);
        }
      }
      if ((!isOneWay()) && (!(getReturnType() instanceof VoidType))) {
        messages.add(webResult);
      }
      messages.addAll(webFaults);
    }
  }
 else {
    messages.add(new RPCInputMessage(this));
    messages.add(new RPCOutputMessage(this));
    messages.addAll(webFaults);
  }
  this.messages=messages;
}

Fixed version (ground truth):
public WebMethod(MethodDeclaration delegate,EndpointInterface endpointInterface){
  super(delegate);
  this.annotation=getAnnotation(javax.jws.WebMethod.class);
  this.oneWay=getAnnotation(Oneway.class) != null;
  this.endpointInterface=endpointInterface;
  TypeMirror returnType=getReturnType();
  MapType mapType=MapTypeUtil.findMapType(returnType);
  if (mapType != null) {
    returnType=mapType;
  }
  this.webResult=new WebResult(returnType,this);
  Collection<ParameterDeclaration> parameters=getParameters();
  Collection<WebParam> webParameters=new ArrayList<WebParam>(parameters.size());
  for (  ParameterDeclaration parameter : parameters) {
    webParameters.add(new WebParam(parameter,this));
  }
  this.webParams=webParameters;
  Collection<WebFault> webFaults=new ArrayList<WebFault>();
  for (  ReferenceType referenceType : getThrownTypes()) {
    if (!(referenceType instanceof DeclaredType)) {
      throw new ValidationException(getPosition(),"String_Node_Str");
    }
    TypeDeclaration declaration=((DeclaredType)referenceType).getDeclaration();
    if (declaration == null) {
      throw new ValidationException(getPosition(),"String_Node_Str" + referenceType);
    }
    webFaults.add(new WebFault((ClassDeclaration)declaration));
  }
  this.webFaults=webFaults;
  Collection<WebMessage> messages=new ArrayList<WebMessage>();
  SOAPBinding.Style bindingStyle=getSoapBindingStyle();
  for (  WebParam webParam : webParameters) {
    if (webParam.isHeader()) {
      messages.add(webParam);
    }
  }
  if (webResult.isHeader()) {
    messages.add(webResult);
  }
  if (bindingStyle == SOAPBinding.Style.DOCUMENT) {
    SOAPBinding.ParameterStyle parameterStyle=getSoapParameterStyle();
    if (parameterStyle == SOAPBinding.ParameterStyle.WRAPPED) {
      messages.add(new RequestWrapper(this));
      if (!isOneWay()) {
        messages.add(new ResponseWrapper(this));
      }
      messages.addAll(webFaults);
    }
 else {
      for (      WebParam webParam : webParameters) {
        if (!webParam.isHeader()) {
          messages.add(webParam);
        }
      }
      if ((!isOneWay()) && (!(getReturnType() instanceof VoidType))) {
        messages.add(webResult);
      }
      messages.addAll(webFaults);
    }
  }
 else {
    messages.add(new RPCInputMessage(this));
    messages.add(new RPCOutputMessage(this));
    messages.addAll(webFaults);
  }
  this.messages=messages;
}