Program: 29676
Project: 29676
Buggy source:
public void processPaths(){
  final Map<String,Path> pathMap=swagger.getPaths();
  if (pathMap == null) {
    return;
  }
  for (  String pathStr : pathMap.keySet()) {
    Path path=pathMap.get(pathStr);
    List<Parameter> parameters=path.getParameters();
    if (parameters != null) {
      List<Operation> operations=path.getOperations();
      List<Parameter> parametersToAdd=new ArrayList<Parameter>();
      if (operations != null) {
        for (        Operation operation : operations) {
          boolean matched=false;
          List<Parameter> existingParameters=operation.getParameters();
          for (          Parameter parameterToAdd : parameters) {
            for (            Parameter existingParameter : existingParameters) {
              if (parameterToAdd.getIn() != null && parameterToAdd.getIn().equals(existingParameter.getIn()) && parameterToAdd.getName().equals(existingParameter.getName())) {
                matched=true;
              }
            }
            if (!matched) {
              parametersToAdd.add(parameterToAdd);
            }
          }
          if (parametersToAdd.size() > 0) {
            operation.getParameters().addAll(0,parametersToAdd);
          }
        }
      }
    }
    path.setParameters(null);
    if (path instanceof RefPath) {
      RefPath refPath=(RefPath)path;
      Path resolvedPath=cache.loadRef(refPath.get$ref(),refPath.getRefFormat(),Path.class);
      if (resolvedPath != null) {
        swagger.path(pathStr,resolvedPath);
        path=resolvedPath;
      }
    }
    final List<Parameter> processedPathParameters=parameterProcessor.processParameters(path.getParameters());
    path.setParameters(processedPathParameters);
    final Map<HttpMethod,Operation> operationMap=path.getOperationMap();
    for (    HttpMethod httpMethod : operationMap.keySet()) {
      Operation operation=operationMap.get(httpMethod);
      operationProcessor.processOperation(operation);
    }
  }
}

Fixed version (ground truth):
public void processPaths(){
  final Map<String,Path> pathMap=swagger.getPaths();
  if (pathMap == null) {
    return;
  }
  for (  String pathStr : pathMap.keySet()) {
    Path path=pathMap.get(pathStr);
    List<Parameter> parameters=path.getParameters();
    if (parameters != null) {
      List<Operation> operations=path.getOperations();
      if (operations != null) {
        for (        Operation operation : operations) {
          List<Parameter> parametersToAdd=new ArrayList<Parameter>();
          boolean matched=false;
          List<Parameter> existingParameters=operation.getParameters();
          for (          Parameter parameterToAdd : parameters) {
            for (            Parameter existingParameter : existingParameters) {
              if (parameterToAdd.getIn() != null && parameterToAdd.getIn().equals(existingParameter.getIn()) && parameterToAdd.getName().equals(existingParameter.getName())) {
                matched=true;
              }
            }
            if (!matched) {
              parametersToAdd.add(parameterToAdd);
            }
          }
          if (parametersToAdd.size() > 0) {
            operation.getParameters().addAll(0,parametersToAdd);
          }
        }
      }
    }
    path.setParameters(null);
    if (path instanceof RefPath) {
      RefPath refPath=(RefPath)path;
      Path resolvedPath=cache.loadRef(refPath.get$ref(),refPath.getRefFormat(),Path.class);
      if (resolvedPath != null) {
        swagger.path(pathStr,resolvedPath);
        path=resolvedPath;
      }
    }
    final List<Parameter> processedPathParameters=parameterProcessor.processParameters(path.getParameters());
    path.setParameters(processedPathParameters);
    final Map<HttpMethod,Operation> operationMap=path.getOperationMap();
    for (    HttpMethod httpMethod : operationMap.keySet()) {
      Operation operation=operationMap.get(httpMethod);
      operationProcessor.processOperation(operation);
    }
  }
}