Program: 112241
Project: 112241
Buggy source:
@Override public boolean incomingServerRequestMatchesMethod(RequestDetails theRequest){
  String clientPreference=theRequest.getHeader(Constants.HEADER_PREFER);
  boolean lenientHandling=false;
  if (clientPreference != null) {
    String[] preferences=clientPreference.split("String_Node_Str");
    for (    String p : preferences) {
      if ("String_Node_Str".equalsIgnoreCase(p)) {
        lenientHandling=true;
        break;
      }
    }
  }
  if (theRequest.getId() != null && myIdParamIndex == null) {
    ourLog.trace("String_Node_Str",theRequest.getId());
    return false;
  }
  if (theRequest.getRequestType() == RequestTypeEnum.GET && theRequest.getOperation() != null && !Constants.PARAM_SEARCH.equals(theRequest.getOperation())) {
    ourLog.trace("String_Node_Str",theRequest.getId(),theRequest.getOperation());
    return false;
  }
  if (theRequest.getRequestType() == RequestTypeEnum.POST && !Constants.PARAM_SEARCH.equals(theRequest.getOperation())) {
    ourLog.trace("String_Node_Str",theRequest.getId(),theRequest.getOperation());
    return false;
  }
  if (theRequest.getRequestType() != RequestTypeEnum.GET && theRequest.getRequestType() != RequestTypeEnum.POST) {
    ourLog.trace("String_Node_Str",getMethod());
    return false;
  }
  if (!StringUtils.equals(myCompartmentName,theRequest.getCompartmentName())) {
    ourLog.trace("String_Node_Str",new Object[]{getMethod(),myCompartmentName,theRequest.getCompartmentName()});
    return false;
  }
  Set<String> methodParamsTemp=new HashSet<String>();
  Set<String> unqualifiedNames=theRequest.getUnqualifiedToQualifiedNames().keySet();
  Set<String> qualifiedParamNames=theRequest.getParameters().keySet();
  for (int i=0; i < this.getParameters().size(); i++) {
    if (!(getParameters().get(i) instanceof BaseQueryParameter)) {
      continue;
    }
    BaseQueryParameter temp=(BaseQueryParameter)getParameters().get(i);
    String name=temp.getName();
    if (temp.isRequired()) {
      if (qualifiedParamNames.contains(name)) {
        QualifierDetails qualifiers=extractQualifiersFromParameterName(name);
        if (qualifiers.passes(temp.getQualifierWhitelist(),temp.getQualifierBlacklist())) {
          methodParamsTemp.add(name);
        }
      }
      if (unqualifiedNames.contains(name)) {
        List<String> qualifiedNames=theRequest.getUnqualifiedToQualifiedNames().get(name);
        qualifiedNames=processWhitelistAndBlacklist(qualifiedNames,temp.getQualifierWhitelist(),temp.getQualifierBlacklist());
        methodParamsTemp.addAll(qualifiedNames);
      }
      if (!qualifiedParamNames.contains(name) && !unqualifiedNames.contains(name)) {
        ourLog.trace("String_Node_Str",getMethod().getName(),name);
        return false;
      }
    }
 else {
      if (qualifiedParamNames.contains(name)) {
        QualifierDetails qualifiers=extractQualifiersFromParameterName(name);
        if (qualifiers.passes(temp.getQualifierWhitelist(),temp.getQualifierBlacklist())) {
          methodParamsTemp.add(name);
        }
      }
      if (unqualifiedNames.contains(name)) {
        List<String> qualifiedNames=theRequest.getUnqualifiedToQualifiedNames().get(name);
        qualifiedNames=processWhitelistAndBlacklist(qualifiedNames,temp.getQualifierWhitelist(),temp.getQualifierBlacklist());
        methodParamsTemp.addAll(qualifiedNames);
      }
      if (!qualifiedParamNames.contains(name) && !qualifiedParamNames.contains(name)) {
        methodParamsTemp.add(name);
      }
    }
  }
  if (myQueryName != null) {
    String[] queryNameValues=theRequest.getParameters().get(Constants.PARAM_QUERY);
    if (queryNameValues != null && StringUtils.isNotBlank(queryNameValues[0])) {
      String queryName=queryNameValues[0];
      if (!myQueryName.equals(queryName)) {
        ourLog.trace("String_Node_Str",myQueryName);
        return false;
      }
      methodParamsTemp.add(Constants.PARAM_QUERY);
    }
 else {
      ourLog.trace("String_Node_Str",myQueryName);
      return false;
    }
  }
 else {
    String[] queryNameValues=theRequest.getParameters().get(Constants.PARAM_QUERY);
    if (queryNameValues != null && StringUtils.isNotBlank(queryNameValues[0])) {
      ourLog.trace("String_Node_Str");
      return false;
    }
  }
  for (  String next : theRequest.getParameters().keySet()) {
    if (ALLOWED_PARAMS.contains(next)) {
      methodParamsTemp.add(next);
    }
  }
  Set<String> keySet=theRequest.getParameters().keySet();
  if (lenientHandling == true)   return true;
  if (myAllowUnknownParams == false) {
    for (    String next : keySet) {
      if (!methodParamsTemp.contains(next)) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean incomingServerRequestMatchesMethod(RequestDetails theRequest){
  String clientPreference=theRequest.getHeader(Constants.HEADER_PREFER);
  boolean lenientHandling=false;
  if (clientPreference != null) {
    String[] preferences=clientPreference.split("String_Node_Str");
    for (    String p : preferences) {
      if ("String_Node_Str".equalsIgnoreCase(p)) {
        lenientHandling=true;
        break;
      }
    }
  }
  if (theRequest.getId() != null && myIdParamIndex == null) {
    ourLog.trace("String_Node_Str",theRequest.getId());
    return false;
  }
  if (theRequest.getRequestType() == RequestTypeEnum.GET && theRequest.getOperation() != null && !Constants.PARAM_SEARCH.equals(theRequest.getOperation())) {
    ourLog.trace("String_Node_Str",theRequest.getId(),theRequest.getOperation());
    return false;
  }
  if (theRequest.getRequestType() == RequestTypeEnum.POST && !Constants.PARAM_SEARCH.equals(theRequest.getOperation())) {
    ourLog.trace("String_Node_Str",theRequest.getId(),theRequest.getOperation());
    return false;
  }
  if (theRequest.getRequestType() != RequestTypeEnum.GET && theRequest.getRequestType() != RequestTypeEnum.POST) {
    ourLog.trace("String_Node_Str",getMethod());
    return false;
  }
  if (!StringUtils.equals(myCompartmentName,theRequest.getCompartmentName())) {
    ourLog.trace("String_Node_Str",new Object[]{getMethod(),myCompartmentName,theRequest.getCompartmentName()});
    return false;
  }
  Set<String> methodParamsTemp=new HashSet<String>();
  Set<String> unqualifiedNames=theRequest.getUnqualifiedToQualifiedNames().keySet();
  Set<String> qualifiedParamNames=theRequest.getParameters().keySet();
  for (int i=0; i < this.getParameters().size(); i++) {
    if (!(getParameters().get(i) instanceof BaseQueryParameter)) {
      continue;
    }
    BaseQueryParameter temp=(BaseQueryParameter)getParameters().get(i);
    String name=temp.getName();
    if (temp.isRequired()) {
      if (qualifiedParamNames.contains(name)) {
        QualifierDetails qualifiers=extractQualifiersFromParameterName(name);
        if (qualifiers.passes(temp.getQualifierWhitelist(),temp.getQualifierBlacklist())) {
          methodParamsTemp.add(name);
        }
      }
      if (unqualifiedNames.contains(name)) {
        List<String> qualifiedNames=theRequest.getUnqualifiedToQualifiedNames().get(name);
        qualifiedNames=processWhitelistAndBlacklist(qualifiedNames,temp.getQualifierWhitelist(),temp.getQualifierBlacklist());
        methodParamsTemp.addAll(qualifiedNames);
      }
      if (!qualifiedParamNames.contains(name) && !unqualifiedNames.contains(name)) {
        ourLog.trace("String_Node_Str",getMethod().getName(),name);
        return false;
      }
    }
 else {
      if (qualifiedParamNames.contains(name)) {
        QualifierDetails qualifiers=extractQualifiersFromParameterName(name);
        if (qualifiers.passes(temp.getQualifierWhitelist(),temp.getQualifierBlacklist())) {
          methodParamsTemp.add(name);
        }
      }
      if (unqualifiedNames.contains(name)) {
        List<String> qualifiedNames=theRequest.getUnqualifiedToQualifiedNames().get(name);
        qualifiedNames=processWhitelistAndBlacklist(qualifiedNames,temp.getQualifierWhitelist(),temp.getQualifierBlacklist());
        methodParamsTemp.addAll(qualifiedNames);
      }
      if (!qualifiedParamNames.contains(name)) {
        methodParamsTemp.add(name);
      }
    }
  }
  if (myQueryName != null) {
    String[] queryNameValues=theRequest.getParameters().get(Constants.PARAM_QUERY);
    if (queryNameValues != null && StringUtils.isNotBlank(queryNameValues[0])) {
      String queryName=queryNameValues[0];
      if (!myQueryName.equals(queryName)) {
        ourLog.trace("String_Node_Str",myQueryName);
        return false;
      }
      methodParamsTemp.add(Constants.PARAM_QUERY);
    }
 else {
      ourLog.trace("String_Node_Str",myQueryName);
      return false;
    }
  }
 else {
    String[] queryNameValues=theRequest.getParameters().get(Constants.PARAM_QUERY);
    if (queryNameValues != null && StringUtils.isNotBlank(queryNameValues[0])) {
      ourLog.trace("String_Node_Str");
      return false;
    }
  }
  for (  String next : theRequest.getParameters().keySet()) {
    if (ALLOWED_PARAMS.contains(next)) {
      methodParamsTemp.add(next);
    }
  }
  Set<String> keySet=theRequest.getParameters().keySet();
  if (lenientHandling == true)   return true;
  if (myAllowUnknownParams == false) {
    for (    String next : keySet) {
      if (!methodParamsTemp.contains(next)) {
        return false;
      }
    }
  }
  return true;
}