Program: 141844
Project: 141844
Buggy source:
public void process(Definition wsdlDefinition){
  populationUtil=new XSDPopulationUtil2();
  SchemaUtil schemaUtil=new SchemaUtil(wsdlDefinition);
  int index=0;
  Map<byte[],String> fileToSchemaMap=new HashMap<byte[],String>();
  for (  XmlSchema schema : schemaUtil.getSchemas().keySet()) {
    String file=initFileContent(schemaUtil.getSchemas().get(schema),index);
    fileToSchemaMap.put(schemaUtil.getSchemas().get(schema),file);
    try {
      populationUtil.addSchema(file);
    }
 catch (    IOException e) {
      ExceptionHandler.process(e);
    }
    index++;
  }
  Map<QName,Binding> bindings=wsdlDefinition.getBindings();
  List<PortType> portTypes=new ArrayList<PortType>(bindings.size());
  for (  Binding binding : bindings.values()) {
    PortType portType=binding.getPortType();
    if (!portTypes.contains(portType)) {
      portTypes.add(portType);
      List<BindingOperation> operations=binding.getBindingOperations();
      for (      BindingOperation operation : operations) {
        Operation oper=operation.getOperation();
        Input inDef=oper.getInput();
        if (inDef != null) {
          Message inMsg=inDef.getMessage();
          if (inMsg != null) {
            populateMessage2(schemaUtil.getParameterFromMessage(inMsg),portType.getQName(),oper,fileToSchemaMap);
          }
        }
        Output outDef=oper.getOutput();
        if (outDef != null) {
          Message outMsg=outDef.getMessage();
          if (outMsg != null) {
            populateMessage2(schemaUtil.getParameterFromMessage(outMsg),portType.getQName(),oper,fileToSchemaMap);
          }
        }
        Collection<Fault> faults=oper.getFaults().values();
        for (        Fault fault : faults) {
          Message faultMsg=fault.getMessage();
          if (faultMsg != null) {
            populateMessage2(schemaUtil.getParameterFromMessage(faultMsg),portType.getQName(),oper,fileToSchemaMap);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void process(Definition wsdlDefinition){
  populationUtil=new XSDPopulationUtil2();
  List<String> alreadyCreated=new ArrayList<String>();
  SchemaUtil schemaUtil=new SchemaUtil(wsdlDefinition);
  int index=0;
  Map<byte[],String> fileToSchemaMap=new HashMap<byte[],String>();
  for (  XmlSchema schema : schemaUtil.getSchemas().keySet()) {
    String file=initFileContent(schemaUtil.getSchemas().get(schema),index);
    fileToSchemaMap.put(schemaUtil.getSchemas().get(schema),file);
    try {
      populationUtil.addSchema(file);
    }
 catch (    IOException e) {
      ExceptionHandler.process(e);
    }
    index++;
  }
  Map<QName,Binding> bindings=wsdlDefinition.getBindings();
  List<PortType> portTypes=new ArrayList<PortType>(bindings.size());
  for (  Binding binding : bindings.values()) {
    PortType portType=binding.getPortType();
    if (!portTypes.contains(portType)) {
      portTypes.add(portType);
      List<BindingOperation> operations=binding.getBindingOperations();
      for (      BindingOperation operation : operations) {
        Operation oper=operation.getOperation();
        Input inDef=oper.getInput();
        if (inDef != null) {
          Message inMsg=inDef.getMessage();
          if (inMsg != null) {
            ParameterInfo parameterFromMessage=schemaUtil.getParameterFromMessage(inMsg);
            if (alreadyCreated.contains(parameterFromMessage.getName())) {
              continue;
            }
 else {
              alreadyCreated.add(parameterFromMessage.getName());
            }
            populateMessage2(parameterFromMessage,portType.getQName(),oper,fileToSchemaMap);
          }
        }
        Output outDef=oper.getOutput();
        if (outDef != null) {
          Message outMsg=outDef.getMessage();
          if (outMsg != null) {
            ParameterInfo parameterFromMessage=schemaUtil.getParameterFromMessage(outMsg);
            if (alreadyCreated.contains(parameterFromMessage.getName())) {
              continue;
            }
 else {
              alreadyCreated.add(parameterFromMessage.getName());
            }
            populateMessage2(parameterFromMessage,portType.getQName(),oper,fileToSchemaMap);
          }
        }
        Collection<Fault> faults=oper.getFaults().values();
        for (        Fault fault : faults) {
          Message faultMsg=fault.getMessage();
          if (faultMsg != null) {
            ParameterInfo parameterFromMessage=schemaUtil.getParameterFromMessage(faultMsg);
            if (alreadyCreated.contains(parameterFromMessage.getName())) {
              continue;
            }
 else {
              alreadyCreated.add(parameterFromMessage.getName());
            }
            populateMessage2(parameterFromMessage,portType.getQName(),oper,fileToSchemaMap);
          }
        }
      }
    }
  }
}