Program: 115440
Project: 115440
Buggy source:
/** 
 * Add member object to the topology and publish member created event
 * @param memberContext
 */
public static void handleMemberCreatedEvent(MemberContext memberContext) throws RegistryException {
  Topology topology=TopologyHolder.getTopology();
  Service service=topology.getService(memberContext.getCartridgeType());
  String clusterId=memberContext.getClusterId();
  Cluster cluster=service.getCluster(clusterId);
  String applicationId=service.getCluster(memberContext.getClusterId()).getAppId();
  String memberId=memberContext.getMemberId();
  String clusterInstanceId=memberContext.getClusterInstanceId();
  String networkPartitionId=memberContext.getNetworkPartitionId();
  String partitionId=memberContext.getPartition().getId();
  String clusterAlias=CloudControllerUtil.getAliasFromClusterId(memberContext.getClusterId());
  String lbClusterId=memberContext.getLbClusterId();
  long initTime=memberContext.getInitTime();
  if (cluster.memberExists(memberId)) {
    throw new RuntimeException(String.format("String_Node_Str",memberId));
  }
  try {
    TopologyHolder.acquireWriteLock();
    Member member=new Member(service.getServiceName(),clusterId,memberId,clusterInstanceId,networkPartitionId,partitionId,memberContext.getLoadBalancingIPType(),initTime);
    member.setStatus(MemberStatus.Created);
    member.setLbClusterId(lbClusterId);
    member.setProperties(CloudControllerUtil.toJavaUtilProperties(memberContext.getProperties()));
    cluster.addMember(member);
    TopologyHolder.updateTopology(topology);
    Long timestamp=System.currentTimeMillis();
    MemberStatusPublisher memStatusPublisher=CloudControllerPublisherFactory.createMemberStatusPublisher(StatisticsPublisherType.WSO2DAS);
    if (memStatusPublisher.isEnabled()) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str");
      }
      memStatusPublisher.publish(timestamp,applicationId,memberContext.getClusterId(),clusterAlias,memberContext.getClusterInstanceId(),memberContext.getCartridgeType(),memberContext.getNetworkPartitionId(),memberContext.getPartition().getId(),memberContext.getMemberId(),MemberStatus.Created.toString());
    }
 else {
      log.warn("String_Node_Str");
    }
  }
  finally {
    TopologyHolder.releaseWriteLock();
  }
  TopologyEventPublisher.sendMemberCreatedEvent(memberContext);
}

Fixed version (ground truth):
/** 
 * Add member object to the topology and publish member created event
 * @param memberContext
 */
public static void handleMemberCreatedEvent(MemberContext memberContext) throws RegistryException {
  Topology topology=TopologyHolder.getTopology();
  Service service=topology.getService(memberContext.getCartridgeType());
  String clusterId=memberContext.getClusterId();
  Cluster cluster=service.getCluster(clusterId);
  String applicationId=service.getCluster(memberContext.getClusterId()).getAppId();
  String memberId=memberContext.getMemberId();
  String clusterInstanceId=memberContext.getClusterInstanceId();
  String networkPartitionId=memberContext.getNetworkPartitionId();
  String partitionId=memberContext.getPartition().getId();
  String clusterAlias=CloudControllerUtil.getAliasFromClusterId(memberContext.getClusterId());
  String lbClusterId=memberContext.getLbClusterId();
  long initTime=memberContext.getInitTime();
  if (cluster.memberExists(memberId)) {
    throw new RuntimeException(String.format("String_Node_Str",memberId));
  }
  try {
    TopologyHolder.acquireWriteLock();
    Member member=new Member(service.getServiceName(),clusterId,memberId,clusterInstanceId,networkPartitionId,partitionId,memberContext.getLoadBalancingIPType(),initTime);
    member.setStatus(MemberStatus.Created);
    member.setLbClusterId(lbClusterId);
    member.setProperties(CloudControllerUtil.toJavaUtilProperties(memberContext.getProperties()));
    cluster.addMember(member);
    TopologyHolder.updateTopology(topology);
    Long timestamp=System.currentTimeMillis();
    if (memStatusPublisher.isEnabled()) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str");
      }
      memStatusPublisher.publish(timestamp,applicationId,memberContext.getClusterId(),clusterAlias,memberContext.getClusterInstanceId(),memberContext.getCartridgeType(),memberContext.getNetworkPartitionId(),memberContext.getPartition().getId(),memberContext.getMemberId(),MemberStatus.Created.toString());
    }
  }
  finally {
    TopologyHolder.releaseWriteLock();
  }
  TopologyEventPublisher.sendMemberCreatedEvent(memberContext);
}