Program: 29641
Project: 29641
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);
    if (settings.addParametersToEachOperation()) {
      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>();
            List<Parameter> existingParameters=operation.getParameters();
            for (            Parameter parameterToAdd : parameters) {
              boolean matched=false;
              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);
      String pathRef=refPath.get$ref().split("String_Node_Str")[0];
      updateLocalRefs(resolvedPath,pathRef);
      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);
    if (settings.addParametersToEachOperation()) {
      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>();
            List<Parameter> existingParameters=operation.getParameters();
            for (            Parameter parameterToAdd : parameters) {
              boolean matched=false;
              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) {
        resolvedPath=cache.loadRef(refPath.getOriginalRef(),refPath.getOriginalRefFormat(),Path.class);
      }
      String pathRef=refPath.get$ref().split("String_Node_Str")[0];
      if (resolvedPath != null) {
        updateLocalRefs(resolvedPath,pathRef);
        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);
    }
  }
}