Program: 116670
Project: 116670
Buggy source:
private org.apache.axis2.clustering.Member findNextMember(MessageContext synCtx){
  String targetHost=extractTargetHost(synCtx);
  if (!requestDelegator.isTargetHostValid(targetHost)) {
    throwSynapseException(synCtx,404,String.format("String_Node_Str",targetHost));
  }
  Member member=null;
  if (LoadBalancerConfiguration.getInstance().isMultiTenancyEnabled()) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    String url=extractUrl(synCtx);
    int tenantId=scanUrlForTenantId(url);
    if (tenantExists(tenantId)) {
      member=requestDelegator.findNextMemberFromTenantId(targetHost,tenantId);
    }
 else {
      member=requestDelegator.findNextMemberFromHostName(targetHost);
    }
  }
 else {
    member=requestDelegator.findNextMemberFromHostName(targetHost);
  }
  if (member == null)   return null;
  String transport=extractTransport(synCtx);
  Port transportPort=member.getPort(transport);
  if (transportPort == null) {
    if (log.isErrorEnabled()) {
      log.error(String.format("String_Node_Str",transport,member.getMemberId()));
    }
    throwSynapseException(synCtx,500,"String_Node_Str");
  }
  int memberPort=transportPort.getValue();
  org.apache.axis2.clustering.Member axis2Member=new org.apache.axis2.clustering.Member(getMemberIp(synCtx,member),memberPort);
  axis2Member.setDomain(member.getClusterId());
  Port httpPort=member.getPort("String_Node_Str");
  if (httpPort != null)   axis2Member.setHttpPort(httpPort.getValue());
  Port httpsPort=member.getPort("String_Node_Str");
  if (httpsPort != null)   axis2Member.setHttpsPort(httpsPort.getValue());
  axis2Member.setActive(member.isActive());
  synCtx.setProperty(Constants.CLUSTER_ID,member.getClusterId());
  return axis2Member;
}

Fixed version (ground truth):
private org.apache.axis2.clustering.Member findNextMember(MessageContext synCtx){
  String targetHost=extractTargetHost(synCtx);
  if (!requestDelegator.isTargetHostValid(targetHost)) {
    throwSynapseException(synCtx,404,String.format("String_Node_Str",targetHost));
  }
  Member member=null;
  if (LoadBalancerConfiguration.getInstance().isMultiTenancyEnabled()) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    String url=extractUrl(synCtx);
    int tenantId=scanUrlForTenantId(url);
    if (tenantExists(tenantId)) {
      member=requestDelegator.findNextMemberFromTenantId(targetHost,tenantId);
    }
 else {
      member=requestDelegator.findNextMemberFromHostName(targetHost);
    }
  }
 else {
    member=requestDelegator.findNextMemberFromHostName(targetHost);
  }
  if (member == null)   return null;
  String transport=extractTransport(synCtx);
  Port transportPort=member.getPort(transport);
  if (transportPort == null) {
    if (log.isErrorEnabled()) {
      log.error(String.format("String_Node_Str",transport,member.getMemberId()));
    }
    throwSynapseException(synCtx,500,"String_Node_Str");
  }
  int memberPort=transportPort.getValue();
  org.apache.axis2.clustering.Member axis2Member=new org.apache.axis2.clustering.Member(getMemberIp(synCtx,member),memberPort);
  axis2Member.setDomain(member.getClusterId());
  Port httpPort=member.getPort("String_Node_Str");
  if (httpPort != null)   axis2Member.setHttpPort(httpPort.getValue());
  Port httpsPort=member.getPort("String_Node_Str");
  if (httpsPort != null)   axis2Member.setHttpsPort(httpsPort.getValue());
  axis2Member.setActive(member.isActive());
  axis2Member.getProperties().setProperty(Constants.CLUSTER_ID,member.getClusterId());
  return axis2Member;
}