Program: 134655
Project: 134655
Buggy source:
/** 
 * Filters request parameter names and values according to the rules defined by the ProviderEndpoint. Filter can be applied to only parameter name or value or both of them. Filter condition and operation are defined individually for parameter name and value.
 * @param request request which parameters are filtered
 * @param endpoint endpoint that contains the rules for filtering
 */
public static void filterRequestParameters(ServiceRequest request,ProviderEndpoint endpoint){
  logger.debug("String_Node_Str");
  List<String> keys=new ArrayList<>(((Map<String,String>)request.getRequestData()).keySet());
  for (  String orgKey : keys) {
    if (!orgKey.equals(Constants.PARAM_REQUEST_BODY) && !orgKey.equals(Constants.PARAM_RESOURCE_ID)) {
      boolean update=false;
      String key=orgKey;
      List<String> values=((Map<String,List<String>>)request.getRequestData()).get(orgKey);
      if (endpoint.getReqParamNameFilterCondition() != null && endpoint.getReqParamNameFilterOperation() != null) {
        logger.trace("String_Node_Str",orgKey,endpoint.getReqParamNameFilterCondition());
        Pattern regex=Pattern.compile(endpoint.getReqParamNameFilterCondition());
        Matcher m=regex.matcher(orgKey);
        if (m.find()) {
          key=m.replaceAll(endpoint.getReqParamNameFilterOperation());
          logger.trace("String_Node_Str",endpoint.getReqParamNameFilterOperation(),orgKey,key);
          update=true;
        }
      }
      if (endpoint.getReqParamValueFilterCondition() != null && endpoint.getReqParamValueFilterOperation() != null) {
        for (int i=0; i < values.size(); i++) {
          String orgValue=values.get(i);
          String value=orgValue;
          logger.trace("String_Node_Str",orgValue,endpoint.getReqParamValueFilterCondition());
          Pattern regex=Pattern.compile(endpoint.getReqParamValueFilterCondition());
          Matcher m=regex.matcher(orgValue);
          if (m.find()) {
            value=m.replaceAll(endpoint.getReqParamValueFilterOperation());
            logger.trace("String_Node_Str",endpoint.getReqParamValueFilterOperation(),orgValue,value);
            values.set(i,value);
            update=true;
          }
        }
      }
      if (update) {
        ((Map<String,List<String>>)request.getRequestData()).remove(orgKey);
        ((Map<String,List<String>>)request.getRequestData()).put(key,values);
      }
    }
 else {
      logger.trace("String_Node_Str",Constants.PARAM_REQUEST_BODY,Constants.PARAM_RESOURCE_ID);
    }
  }
  logger.debug("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Filters request parameter names and values according to the rules defined by the ProviderEndpoint. Filter can be applied to only parameter name or value or both of them. Filter condition and operation are defined individually for parameter name and value.
 * @param request request which parameters are filtered
 * @param endpoint endpoint that contains the rules for filtering
 */
public static void filterRequestParameters(ServiceRequest request,ProviderEndpoint endpoint){
  logger.debug("String_Node_Str");
  List<String> keys=new ArrayList<>(((Map<String,String>)request.getRequestData()).keySet());
  for (  String orgKey : keys) {
    if (!orgKey.equals(Constants.PARAM_REQUEST_BODY) && !orgKey.equals(Constants.PARAM_RESOURCE_ID)) {
      boolean update=false;
      String key=orgKey;
      List<String> values=((Map<String,List<String>>)request.getRequestData()).get(orgKey);
      if (endpoint.getReqParamNameFilterCondition() != null && endpoint.getReqParamNameFilterOperation() != null) {
        logger.trace("String_Node_Str",orgKey,endpoint.getReqParamNameFilterCondition());
        Pattern regex=Pattern.compile(endpoint.getReqParamNameFilterCondition());
        Matcher m=regex.matcher(orgKey);
        if (m.find()) {
          key=m.replaceAll(endpoint.getReqParamNameFilterOperation());
          logger.trace("String_Node_Str",endpoint.getReqParamNameFilterOperation(),orgKey,key);
          update=true;
        }
      }
      if (endpoint.getReqParamValueFilterCondition() != null && endpoint.getReqParamValueFilterOperation() != null) {
        for (int i=0; i < values.size(); i++) {
          String orgValue=values.get(i);
          logger.trace("String_Node_Str",orgValue,endpoint.getReqParamValueFilterCondition());
          Pattern regex=Pattern.compile(endpoint.getReqParamValueFilterCondition());
          Matcher m=regex.matcher(orgValue);
          if (m.find()) {
            String value=m.replaceAll(endpoint.getReqParamValueFilterOperation());
            logger.trace("String_Node_Str",endpoint.getReqParamValueFilterOperation(),orgValue,value);
            values.set(i,value);
            update=true;
          }
        }
      }
      if (update) {
        ((Map<String,List<String>>)request.getRequestData()).remove(orgKey);
        ((Map<String,List<String>>)request.getRequestData()).put(key,values);
      }
    }
 else {
      logger.trace("String_Node_Str",Constants.PARAM_REQUEST_BODY,Constants.PARAM_RESOURCE_ID);
    }
  }
  logger.debug("String_Node_Str");
}