Program: 134653
Project: 134653
Buggy source:
/** 
 * Goes through the given properties and extracts all the defined provider endpoints. Returns a map containing service id - provider endpoint key-value pairs.
 * @param endpoints endpoint properties
 * @param gatewayProperties REST Provider Gateway general properties
 * @return map containing service id - provider endpoint key-value pairs
 */
public static Map<String,ProviderEndpoint> extractProviders(Properties endpoints,Properties gatewayProperties){
  Map<String,ProviderEndpoint> results=new HashMap<String,ProviderEndpoint>();
  logger.info("String_Node_Str");
  if (endpoints == null || endpoints.isEmpty()) {
    logger.warn("String_Node_Str");
    return results;
  }
  int i=0;
  String key=Integer.toString(i);
  while (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_ID)) {
    String id=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_ID);
    String url=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_URL);
    if (id == null || id.isEmpty() || url == null || url.isEmpty()) {
      logger.warn("String_Node_Str");
      i++;
      key=Integer.toString(i);
      continue;
    }
    ProviderEndpoint endpoint=new ProviderEndpoint(id,url);
    endpoint.setHttpVerb("String_Node_Str");
    endpoint.setNamespaceDeserialize(gatewayProperties.getProperty(Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_DESERIALIZE));
    endpoint.setNamespaceSerialize(gatewayProperties.getProperty(Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_SERIALIZE));
    endpoint.setPrefix(gatewayProperties.getProperty(Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_PREFIX_SERIALIZE));
    if (gatewayProperties.containsKey(Constants.ENDPOINT_PROPS_WRAPPERS)) {
      endpoint.setProcessingWrappers(MessageHelper.strToBool(gatewayProperties.getProperty(Constants.ENDPOINT_PROPS_WRAPPERS)));
    }
    logger.info("String_Node_Str",id,url);
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_VERB)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_VERB);
      endpoint.setHttpVerb(value);
      logger.info("String_Node_Str",Constants.ENDPOINT_PROPS_VERB,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_CONTENT_TYPE)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_CONTENT_TYPE);
      endpoint.setContentType(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_CONTENT_TYPE,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_ACCEPT)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_ACCEPT);
      endpoint.setAccept(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_ACCEPT,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_ATTACHMENT)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_ATTACHMENT);
      endpoint.setAttachment(MessageHelper.strToBool(value));
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_ATTACHMENT,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_SEND_XRD_HEADERS)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_SEND_XRD_HEADERS);
      endpoint.setSendXrdHeaders(MessageHelper.strToBool(value));
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_SEND_XRD_HEADERS,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_WRAPPERS)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_WRAPPERS);
      endpoint.setProcessingWrappers(MessageHelper.strToBool(value));
      logger.info("String_Node_Str",Constants.ENDPOINT_PROPS_WRAPPERS,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_DESERIALIZE)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_DESERIALIZE);
      endpoint.setNamespaceDeserialize(value);
      logger.info("String_Node_Str",Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_DESERIALIZE,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_SERIALIZE)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_SERIALIZE);
      endpoint.setNamespaceSerialize(value);
      logger.info("String_Node_Str",Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_SERIALIZE,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_PREFIX_SERIALIZE)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_PREFIX_SERIALIZE);
      endpoint.setPrefix(value);
      logger.info("String_Node_Str",Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_PREFIX_SERIALIZE,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_CONDITION)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_CONDITION);
      endpoint.setReqParamNameFilterCondition(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_CONDITION,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_OPERATION)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_OPERATION);
      endpoint.setReqParamNameFilterOperation(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_OPERATION,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_CONDITION)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_CONDITION);
      endpoint.setReqParamValueFilterCondition(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_CONDITION,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_OPERATION)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_OPERATION);
      endpoint.setReqParamValueFilterOperation(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_OPERATION,value);
    }
    results.put(id,endpoint);
    i++;
    key=Integer.toString(i);
  }
  logger.info("String_Node_Str",results.size());
  return results;
}

Fixed version (ground truth):
/** 
 * Goes through the given properties and extracts all the defined provider endpoints. Returns a map containing service id - provider endpoint key-value pairs.
 * @param endpoints endpoint properties
 * @param gatewayProperties REST Provider Gateway general properties
 * @return map containing service id - provider endpoint key-value pairs
 */
public static Map<String,ProviderEndpoint> extractProviders(Properties endpoints,Properties gatewayProperties){
  Map<String,ProviderEndpoint> results=new HashMap<>();
  logger.info("String_Node_Str");
  if (endpoints == null || endpoints.isEmpty()) {
    logger.warn("String_Node_Str");
    return results;
  }
  int i=0;
  String key=Integer.toString(i);
  while (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_ID)) {
    String id=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_ID);
    String url=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_URL);
    if (id == null || id.isEmpty() || url == null || url.isEmpty()) {
      logger.warn("String_Node_Str");
      i++;
      key=Integer.toString(i);
      continue;
    }
    ProviderEndpoint endpoint=new ProviderEndpoint(id,url);
    endpoint.setHttpVerb("String_Node_Str");
    endpoint.setNamespaceDeserialize(gatewayProperties.getProperty(Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_DESERIALIZE));
    endpoint.setNamespaceSerialize(gatewayProperties.getProperty(Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_SERIALIZE));
    endpoint.setPrefix(gatewayProperties.getProperty(Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_PREFIX_SERIALIZE));
    if (gatewayProperties.containsKey(Constants.ENDPOINT_PROPS_WRAPPERS)) {
      endpoint.setProcessingWrappers(MessageHelper.strToBool(gatewayProperties.getProperty(Constants.ENDPOINT_PROPS_WRAPPERS)));
    }
    logger.info("String_Node_Str",id,url);
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_VERB)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_VERB);
      endpoint.setHttpVerb(value);
      logger.info("String_Node_Str",Constants.ENDPOINT_PROPS_VERB,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_CONTENT_TYPE)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_CONTENT_TYPE);
      endpoint.setContentType(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_CONTENT_TYPE,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_ACCEPT)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_ACCEPT);
      endpoint.setAccept(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_ACCEPT,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_ATTACHMENT)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_ATTACHMENT);
      endpoint.setAttachment(MessageHelper.strToBool(value));
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_ATTACHMENT,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_SEND_XRD_HEADERS)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_SEND_XRD_HEADERS);
      endpoint.setSendXrdHeaders(MessageHelper.strToBool(value));
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_SEND_XRD_HEADERS,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_WRAPPERS)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_WRAPPERS);
      endpoint.setProcessingWrappers(MessageHelper.strToBool(value));
      logger.info("String_Node_Str",Constants.ENDPOINT_PROPS_WRAPPERS,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_DESERIALIZE)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_DESERIALIZE);
      endpoint.setNamespaceDeserialize(value);
      logger.info("String_Node_Str",Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_DESERIALIZE,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_SERIALIZE)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_SERIALIZE);
      endpoint.setNamespaceSerialize(value);
      logger.info("String_Node_Str",Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_SERIALIZE,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_PREFIX_SERIALIZE)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_PREFIX_SERIALIZE);
      endpoint.setPrefix(value);
      logger.info("String_Node_Str",Constants.ENDPOINT_PROPS_SERVICE_NAMESPACE_PREFIX_SERIALIZE,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_CONDITION)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_CONDITION);
      endpoint.setReqParamNameFilterCondition(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_CONDITION,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_OPERATION)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_OPERATION);
      endpoint.setReqParamNameFilterOperation(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_REQUEST_PARAM_NAME_FILTER_OPERATION,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_CONDITION)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_CONDITION);
      endpoint.setReqParamValueFilterCondition(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_CONDITION,value);
    }
    if (endpoints.containsKey(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_OPERATION)) {
      String value=endpoints.getProperty(key + "String_Node_Str" + Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_OPERATION);
      endpoint.setReqParamValueFilterOperation(value);
      logger.info("String_Node_Str",Constants.PROVIDER_PROPS_REQUEST_PARAM_VALUE_FILTER_OPERATION,value);
    }
    results.put(id,endpoint);
    i++;
    key=Integer.toString(i);
  }
  logger.info("String_Node_Str",results.size());
  return results;
}