nus-yam/ex-repair huggingface dataset:
Program: 116672
Project: 116672
Buggy source:
/** 
 * Setup load balancer message context properties to be used by the out block of the main sequence. These values will be used to update the Location value in the response header.
 * @param synCtx
 */
private void setupLoadBalancerContextProperties(MessageContext synCtx){
  String lbHostName=extractTargetHost(synCtx);
  org.apache.axis2.context.MessageContext axis2MsgCtx=((Axis2MessageContext)synCtx).getAxis2MessageContext();
  TransportInDescription httpTransportIn=axis2MsgCtx.getConfigurationContext().getAxisConfiguration().getTransportIn("String_Node_Str");
  TransportInDescription httpsTransportIn=axis2MsgCtx.getConfigurationContext().getAxisConfiguration().getTransportIn("String_Node_Str");
  String lbHttpPort=(String)httpTransportIn.getParameter("String_Node_Str").getValue();
  String lbHttpsPort=(String)httpsTransportIn.getParameter("String_Node_Str").getValue();
  synCtx.setProperty(Constants.LB_HOST_NAME,lbHostName);
  synCtx.setProperty(Constants.LB_HTTP_PORT,lbHttpPort);
  synCtx.setProperty(Constants.LB_HTTPS_PORT,lbHttpsPort);
}

Fixed version (ground truth):
/** 
 * Setup load balancer message context properties to be used by the out block of the main sequence. These values will be used to update the Location value in the response header.
 * @param synCtx
 * @param currentMember
 */
private void setupLoadBalancerContextProperties(MessageContext synCtx,org.apache.axis2.clustering.Member currentMember){
  String lbHostName=extractTargetHost(synCtx);
  org.apache.axis2.context.MessageContext axis2MsgCtx=((Axis2MessageContext)synCtx).getAxis2MessageContext();
  TransportInDescription httpTransportIn=axis2MsgCtx.getConfigurationContext().getAxisConfiguration().getTransportIn("String_Node_Str");
  TransportInDescription httpsTransportIn=axis2MsgCtx.getConfigurationContext().getAxisConfiguration().getTransportIn("String_Node_Str");
  String lbHttpPort=(String)httpTransportIn.getParameter("String_Node_Str").getValue();
  String lbHttpsPort=(String)httpsTransportIn.getParameter("String_Node_Str").getValue();
  String clusterId=currentMember.getProperties().getProperty(Constants.CLUSTER_ID);
  synCtx.setProperty(Constants.LB_HOST_NAME,lbHostName);
  synCtx.setProperty(Constants.LB_HTTP_PORT,lbHttpPort);
  synCtx.setProperty(Constants.LB_HTTPS_PORT,lbHttpsPort);
  synCtx.setProperty(Constants.CLUSTER_ID,clusterId);
}
Program: 116673
Project: 116673
Buggy source:
public static org.apache.stratos.rest.endpoint.bean.topology.Cluster getCluster(String cartridgeType,String subscriptionAlias,ConfigurationContext configurationContext){
  Cluster cluster=TopologyClusterInformationModel.getInstance().getCluster(ApplicationManagementUtil.getTenantId(configurationContext),cartridgeType,subscriptionAlias);
  return PojoConverter.populateClusterPojos(cluster);
}

Fixed version (ground truth):
public static org.apache.stratos.rest.endpoint.bean.topology.Cluster getCluster(String cartridgeType,String subscriptionAlias,ConfigurationContext configurationContext) throws RestAPIException {
  Cluster cluster=TopologyClusterInformationModel.getInstance().getCluster(ApplicationManagementUtil.getTenantId(configurationContext),cartridgeType,subscriptionAlias);
  if (cluster == null) {
    throw new RestAPIException();
  }
 else {
    return PojoConverter.populateClusterPojos(cluster);
  }
}
Program: 116674
Project: 116674
Buggy source:
/** 
 * Unsubscribe from a Cartridge
 * @param tenantDomain Tenant's domain
 * @param alias Alias given at subscription time
 * @throws ADCException
 * @throws NotSubscribedException
 */
public void unsubscribeFromCartridge(String tenantDomain,String alias) throws ADCException, NotSubscribedException {
  DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager=new DataInsertionAndRetrievalManager();
  CartridgeSubscription cartridgeSubscription=dataInsertionAndRetrievalManager.getCartridgeSubscription(CarbonContext.getThreadLocalCarbonContext().getTenantId(),alias);
  if (cartridgeSubscription != null) {
    cartridgeSubscription.removeSubscription();
    try {
      dataInsertionAndRetrievalManager.removeSubscription(cartridgeSubscription.getSubscriber().getTenantId(),alias);
    }
 catch (    PersistenceManagerException e) {
      String errorMsg="String_Node_Str" + tenantDomain + "String_Node_Str"+ cartridgeSubscription.getAlias();
      log.error(errorMsg);
      throw new ADCException(errorMsg,e);
    }
    CartridgeSubscriptionUtils.publishTenantUnSubscribedEvent(cartridgeSubscription.getSubscriber().getTenantId(),cartridgeSubscription.getCartridgeInfo().getType());
  }
 else {
    String errorMsg="String_Node_Str" + alias + "String_Node_Str"+ tenantDomain;
    log.error(errorMsg);
    throw new NotSubscribedException(errorMsg,alias);
  }
}

Fixed version (ground truth):
/** 
 * Unsubscribe from a Cartridge
 * @param tenantDomain Tenant's domain
 * @param alias Alias given at subscription time
 * @throws ADCException
 * @throws NotSubscribedException
 */
public void unsubscribeFromCartridge(String tenantDomain,String alias) throws ADCException, NotSubscribedException {
  DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager=new DataInsertionAndRetrievalManager();
  CartridgeSubscription cartridgeSubscription=dataInsertionAndRetrievalManager.getCartridgeSubscription(CarbonContext.getThreadLocalCarbonContext().getTenantId(),alias);
  if (cartridgeSubscription != null) {
    cartridgeSubscription.removeSubscription();
    TopologyClusterInformationModel.getInstance().removeCluster(cartridgeSubscription.getSubscriber().getTenantId(),cartridgeSubscription.getType(),cartridgeSubscription.getAlias());
    try {
      dataInsertionAndRetrievalManager.removeSubscription(cartridgeSubscription.getSubscriber().getTenantId(),alias);
    }
 catch (    PersistenceManagerException e) {
      String errorMsg="String_Node_Str" + tenantDomain + "String_Node_Str"+ cartridgeSubscription.getAlias();
      log.error(errorMsg);
      throw new ADCException(errorMsg,e);
    }
    CartridgeSubscriptionUtils.publishTenantUnSubscribedEvent(cartridgeSubscription.getSubscriber().getTenantId(),cartridgeSubscription.getCartridgeInfo().getType());
  }
 else {
    String errorMsg="String_Node_Str" + alias + "String_Node_Str"+ tenantDomain;
    log.error(errorMsg);
    throw new NotSubscribedException(errorMsg,alias);
  }
}
Program: 116676
Project: 116676
Buggy source:
public void removeCluster(int tenantId,String cartridgeType,String subscriptionAlias){
  Set<CartridgeTypeContext> cartridgeTypeContextSet=null;
  Set<SubscriptionAliasContext> subscriptionAliasContextSet=null;
  writeLock.lock();
  try {
    cartridgeTypeContextSet=tenantIdToCartridgeTypeContextMap.get(tenantId);
    if (cartridgeTypeContextSet != null) {
      CartridgeTypeContext cartridgeTypeContext=null;
      Iterator<CartridgeTypeContext> typeCtxIterator=cartridgeTypeContextSet.iterator();
      while (typeCtxIterator.hasNext()) {
        cartridgeTypeContext=typeCtxIterator.next();
        if (cartridgeTypeContext.getType().equals(cartridgeType)) {
          subscriptionAliasContextSet=cartridgeTypeContext.getSubscriptionAliasContextSet();
          break;
        }
      }
      if (subscriptionAliasContextSet != null) {
        Iterator<SubscriptionAliasContext> aliasIterator=subscriptionAliasContextSet.iterator();
        while (aliasIterator.hasNext()) {
          SubscriptionAliasContext subscriptionAliasContext=aliasIterator.next();
          if (subscriptionAliasContext.getSubscriptionAlias().equals(subscriptionAlias)) {
            aliasIterator.remove();
            break;
          }
        }
      }
    }
  }
  finally {
    writeLock.unlock();
  }
}

Fixed version (ground truth):
public void removeCluster(int tenantId,String cartridgeType,String subscriptionAlias){
  Set<CartridgeTypeContext> cartridgeTypeContextSet=null;
  Set<SubscriptionAliasContext> subscriptionAliasContextSet=null;
  writeLock.lock();
  try {
    cartridgeTypeContextSet=tenantIdToCartridgeTypeContextMap.get(tenantId);
    if (cartridgeTypeContextSet != null) {
      CartridgeTypeContext cartridgeTypeContext=null;
      Iterator<CartridgeTypeContext> typeCtxIterator=cartridgeTypeContextSet.iterator();
      while (typeCtxIterator.hasNext()) {
        cartridgeTypeContext=typeCtxIterator.next();
        if (cartridgeTypeContext.getType().equals(cartridgeType)) {
          subscriptionAliasContextSet=cartridgeTypeContext.getSubscriptionAliasContextSet();
          break;
        }
      }
      if (subscriptionAliasContextSet != null) {
        Iterator<SubscriptionAliasContext> aliasIterator=subscriptionAliasContextSet.iterator();
        while (aliasIterator.hasNext()) {
          SubscriptionAliasContext subscriptionAliasContext=aliasIterator.next();
          if (subscriptionAliasContext.getSubscriptionAlias().equals(subscriptionAlias)) {
            aliasIterator.remove();
            if (log.isDebugEnabled()) {
              log.debug("String_Node_Str" + tenantId + "String_Node_Str"+ cartridgeType+ "String_Node_Str"+ subscriptionAlias);
            }
            break;
          }
        }
      }
    }
  }
  finally {
    writeLock.unlock();
  }
}
Program: 116678
Project: 116678
Buggy source:
public int hashCode(){
  int subscriptionAliasHashCode=0;
  if (subscriptionAlias != null) {
    subscriptionAliasHashCode=subscriptionAlias.hashCode();
  }
  return (tenantId * 3 + subscriptionAliasHashCode * 5);
}

Fixed version (ground truth):
public int hashCode(){
  return subscriptionAlias.hashCode();
}
Program: 116679
Project: 116679
Buggy source:
public boolean equals(Object other){
  if (this == other) {
    return true;
  }
  if (!(other instanceof TenantIdAndTypeTopologyKey)) {
    return false;
  }
  TenantIdAndTypeTopologyKey that=(TenantIdAndTypeTopologyKey)other;
  return ((this.tenantId == that.tenantId) && (this.subscriptionAlias == that.subscriptionAlias));
}

Fixed version (ground truth):
public boolean equals(Object other){
  if (this == other) {
    return true;
  }
  if (!(other instanceof SubscriptionAliasContext)) {
    return false;
  }
  SubscriptionAliasContext that=(SubscriptionAliasContext)other;
  return this.subscriptionAlias.equals(that.subscriptionAlias);
}
Program: 116684
Project: 116684
Buggy source:
private Set<String> getLbIpList(Cartridge cartridge,DefaultHttpClient httpClient){
  Set<String> lbIpSet=new HashSet<String>();
  Member[] members=getMembers(cartridge.getCartridgeType(),cartridge.getCartridgeAlias(),httpClient);
  Set<String> lbClusterIdSet=new HashSet<String>();
  for (  Member member : members) {
    lbClusterIdSet.add(member.getLbClusterId());
  }
  for (  String clusterId : lbClusterIdSet) {
    HttpResponse responseCluster=restClientService.doGet(httpClient,restClientService.getUrl() + listClusterRestEndpoint + "String_Node_Str"+ clusterId,restClientService.getUsername(),restClientService.getPassword());
    String resultStringCluster=getHttpResponseString(responseCluster);
    Cluster cluster=getClusterObjectFromString(resultStringCluster);
    if (cluster == null) {
      System.out.println("String_Node_Str");
      return null;
    }
    Member[] lbMembers=new Member[cluster.getMember().size()];
    lbMembers=cluster.getMember().toArray(lbMembers);
    for (    Member lbMember : lbMembers) {
      lbIpSet.add(lbMember.getMemberPublicIp());
    }
  }
  return lbIpSet;
}

Fixed version (ground truth):
private Map<String,Set<String>> getLbIpList(Cartridge cartridge,DefaultHttpClient httpClient){
  Map<String,Set<String>> privateFloatingLBIPMap=new HashMap<String,Set<String>>();
  Set<String> lbFloatingIpSet=new HashSet<String>();
  Set<String> lbPrivateIpSet=new HashSet<String>();
  Member[] members=getMembers(cartridge.getCartridgeType(),cartridge.getCartridgeAlias(),httpClient);
  Set<String> lbClusterIdSet=new HashSet<String>();
  for (  Member member : members) {
    lbClusterIdSet.add(member.getLbClusterId());
  }
  for (  String clusterId : lbClusterIdSet) {
    HttpResponse responseCluster=restClientService.doGet(httpClient,restClientService.getUrl() + listClusterRestEndpoint + "String_Node_Str"+ clusterId,restClientService.getUsername(),restClientService.getPassword());
    String resultStringCluster=getHttpResponseString(responseCluster);
    Cluster cluster=getClusterObjectFromString(resultStringCluster);
    if (cluster == null) {
      System.out.println("String_Node_Str");
      return null;
    }
    Member[] lbMembers=new Member[cluster.getMember().size()];
    lbMembers=cluster.getMember().toArray(lbMembers);
    for (    Member lbMember : lbMembers) {
      lbPrivateIpSet.add(lbMember.getMemberIp());
      lbFloatingIpSet.add(lbMember.getMemberPublicIp());
    }
  }
  privateFloatingLBIPMap.put("String_Node_Str",lbPrivateIpSet);
  privateFloatingLBIPMap.put("String_Node_Str",lbFloatingIpSet);
  return privateFloatingLBIPMap;
}
Program: 116685
Project: 116685
Buggy source:
private String getAccessURLs(Cartridge cartridge){
  String[] accessURLs=cartridge.getAccessURLs();
  StringBuilder urlBuilder=new StringBuilder();
  if (accessURLs != null) {
    for (int i=0; i < accessURLs.length; i++) {
      String url=accessURLs[i];
      if (url != null) {
        if (i > 0) {
          urlBuilder.append("String_Node_Str");
        }
        urlBuilder.append(url);
      }
    }
  }
  return urlBuilder.toString();
}

Fixed version (ground truth):
private String getAccessURLs(Cartridge cartridge){
  PortMapping[] portMappings=cartridge.getPortMappings();
  StringBuilder urlBuilder=new StringBuilder();
  for (  PortMapping portMapping : portMappings) {
    String url=portMapping.getProtocol() + "String_Node_Str" + cartridge.getHostName()+ "String_Node_Str"+ portMapping.getProxyPort()+ "String_Node_Str";
    urlBuilder.append(url).append("String_Node_Str");
  }
  return urlBuilder.toString();
}
Program: 116687
Project: 116687
Buggy source:
public void scheduleSyncTask(RepositoryInformation repoInformation,long delay){
  int tenantId=Integer.parseInt(repoInformation.getTenantId());
  RepositoryContext repoCtxt=tenantToRepoContextMap.get(tenantId);
  if (repoCtxt == null) {
    log.error("String_Node_Str" + tenantId);
    return;
  }
  if (repoCtxt.getArtifactSyncSchedular() == null) {
synchronized (repoCtxt) {
      if (repoCtxt.getArtifactSyncSchedular() == null) {
        final ScheduledExecutorService artifactSyncScheduler=Executors.newScheduledThreadPool(1,new ArtifactSyncTaskThreadFactory(repoInformation));
        artifactSyncScheduler.scheduleAtFixedRate(new ArtifactSyncTask(repoInformation),delay,delay,TimeUnit.SECONDS);
        repoCtxt.setArtifactSyncSchedular(artifactSyncScheduler);
        log.info("String_Node_Str" + repoCtxt.getGitLocalRepoPath());
      }
 else {
        log.info("String_Node_Str" + repoCtxt.getGitLocalRepoPath() + "String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
public void scheduleSyncTask(RepositoryInformation repoInformation,long delay){
  int tenantId=Integer.parseInt(repoInformation.getTenantId());
  RepositoryContext repoCtxt=tenantToRepoContextMap.get(tenantId);
  if (repoCtxt == null) {
    log.error("String_Node_Str" + tenantId);
    return;
  }
  if (repoCtxt.getArtifactSyncSchedular() == null) {
synchronized (repoCtxt) {
      if (repoCtxt.getArtifactSyncSchedular() == null) {
        final ScheduledExecutorService artifactSyncScheduler=Executors.newScheduledThreadPool(1,new ArtifactSyncTaskThreadFactory(repoCtxt.getGitLocalRepoPath()));
        artifactSyncScheduler.scheduleAtFixedRate(new ArtifactSyncTask(repoInformation),delay,delay,TimeUnit.SECONDS);
        repoCtxt.setArtifactSyncSchedular(artifactSyncScheduler);
        log.info("String_Node_Str" + repoCtxt.getGitLocalRepoPath());
      }
 else {
        log.info("String_Node_Str" + repoCtxt.getGitLocalRepoPath() + "String_Node_Str");
      }
    }
  }
}
Program: 116688
Project: 116688
Buggy source:
public Thread newThread(Runnable r){
  return new Thread(r,"String_Node_Str" + repositoryInformation.getRepoPath());
}

Fixed version (ground truth):
public Thread newThread(Runnable r){
  return new Thread(r,"String_Node_Str" + localRepoPath);
}
Program: 116690
Project: 116690
Buggy source:
public ArtifactSyncTaskThreadFactory(RepositoryInformation repositoryInformation){
  this.repositoryInformation=repositoryInformation;
}

Fixed version (ground truth):
public ArtifactSyncTaskThreadFactory(String localRepoPath){
  this.localRepoPath=localRepoPath;
}
Program: 116692
Project: 116692
Buggy source:
private static String getRepoPathForTenantId(int tenantId,String gitLocalRepoPath){
  StringBuilder repoPathBuilder=new StringBuilder();
  if (tenantId == -1234) {
    repoPathBuilder.append(gitLocalRepoPath).append(SUPER_TENANT_APP_PATH);
  }
 else {
    createTenantDir(tenantId,gitLocalRepoPath);
    repoPathBuilder.append(gitLocalRepoPath).append(TENANT_PATH).append(tenantId);
  }
  String repoPath=repoPathBuilder.toString();
  log.info("String_Node_Str" + repoPath);
  return repoPath;
}

Fixed version (ground truth):
private static String getRepoPathForTenantId(int tenantId,String gitLocalRepoPath,boolean isMultitenant){
  StringBuilder repoPathBuilder=new StringBuilder();
  String repoPath=null;
  if (isMultitenant) {
    if (tenantId == SUPER_TENANT_ID) {
      repoPathBuilder.append(gitLocalRepoPath).append(SUPER_TENANT_APP_PATH);
    }
 else {
      createTenantDir(tenantId,gitLocalRepoPath);
      repoPathBuilder.append(gitLocalRepoPath).append(TENANT_PATH).append(tenantId);
    }
    repoPath=repoPathBuilder.toString();
  }
 else {
    repoPath=gitLocalRepoPath;
  }
  log.info("String_Node_Str" + repoPath);
  return repoPath;
}
Program: 116694
Project: 116694
Buggy source:
private CartridgeAgentConfiguration(){
  serviceName=readParameterValue(CartridgeAgentConstants.SERVICE_NAME);
  clusterId=readParameterValue(CartridgeAgentConstants.CLUSTER_ID);
  networkPartitionId=readParameterValue(CartridgeAgentConstants.NETWORK_PARTITION_ID);
  partitionId=readParameterValue(CartridgeAgentConstants.PARTITION_ID);
  memberId=readParameterValue(CartridgeAgentConstants.MEMBER_ID);
  cartridgeKey=readParameterValue(CartridgeAgentConstants.CARTRIDGE_KEY);
  appPath=readParameterValue(CartridgeAgentConstants.APP_PATH);
  repoUrl=readParameterValue(CartridgeAgentConstants.REPO_URL);
  ports=readPorts();
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str");
  }
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",serviceName));
    log.debug(String.format("String_Node_Str",clusterId));
    log.debug(String.format("String_Node_Str",networkPartitionId));
    log.debug(String.format("String_Node_Str",partitionId));
    log.debug(String.format("String_Node_Str",memberId));
    log.debug(String.format("String_Node_Str",cartridgeKey));
    log.debug(String.format("String_Node_Str",appPath));
    log.debug(String.format("String_Node_Str",repoUrl));
    log.debug(String.format("String_Node_Str",ports.toString()));
  }
}

Fixed version (ground truth):
private CartridgeAgentConfiguration(){
  serviceName=readParameterValue(CartridgeAgentConstants.SERVICE_NAME);
  clusterId=readParameterValue(CartridgeAgentConstants.CLUSTER_ID);
  networkPartitionId=readParameterValue(CartridgeAgentConstants.NETWORK_PARTITION_ID);
  partitionId=readParameterValue(CartridgeAgentConstants.PARTITION_ID);
  memberId=readParameterValue(CartridgeAgentConstants.MEMBER_ID);
  cartridgeKey=readParameterValue(CartridgeAgentConstants.CARTRIDGE_KEY);
  appPath=readParameterValue(CartridgeAgentConstants.APP_PATH);
  repoUrl=readParameterValue(CartridgeAgentConstants.REPO_URL);
  ports=readPorts();
  isMultitenant=readMultitenant(CartridgeAgentConstants.MULTITENANT);
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str");
  }
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",serviceName));
    log.debug(String.format("String_Node_Str",clusterId));
    log.debug(String.format("String_Node_Str",networkPartitionId));
    log.debug(String.format("String_Node_Str",partitionId));
    log.debug(String.format("String_Node_Str",memberId));
    log.debug(String.format("String_Node_Str",cartridgeKey));
    log.debug(String.format("String_Node_Str",appPath));
    log.debug(String.format("String_Node_Str",repoUrl));
    log.debug(String.format("String_Node_Str",ports.toString()));
  }
}
Program: 116695
Project: 116695
Buggy source:
public void deploy() throws ADCException, UnregisteredCartridgeException {
  setClusterId(type + "String_Node_Str" + cartridgeInfo.getHostName()+ "String_Node_Str");
  setHostName(cartridgeInfo.getHostName());
  BasicPayloadData basicPayloadData=CartridgeSubscriptionUtils.createBasicPayload(this);
  basicPayloadData.populatePayload();
  PayloadData payloadData=PayloadFactory.getPayloadDataInstance(cartridgeInfo.getProvider(),cartridgeInfo.getType(),basicPayloadData);
  if (cartridgeInfo.getProperties() != null && cartridgeInfo.getProperties().length != 0) {
    for (    Property property : cartridgeInfo.getProperties()) {
      if (property.getName().startsWith(CartridgeConstants.CUSTOM_PAYLOAD_PARAM_NAME_PREFIX)) {
        String payloadParamName=property.getName();
        payloadData.add(payloadParamName.substring(payloadParamName.indexOf("String_Node_Str") + 1),property.getValue());
      }
    }
  }
  setPayloadData(payloadData);
}

Fixed version (ground truth):
public void deploy(Properties properties) throws ADCException, UnregisteredCartridgeException {
  setClusterId(type + "String_Node_Str" + cartridgeInfo.getHostName()+ "String_Node_Str");
  setHostName(cartridgeInfo.getHostName());
  BasicPayloadData basicPayloadData=CartridgeSubscriptionUtils.createBasicPayload(this);
  basicPayloadData.populatePayload();
  PayloadData payloadData=PayloadFactory.getPayloadDataInstance(cartridgeInfo.getProvider(),cartridgeInfo.getType(),basicPayloadData);
  if (cartridgeInfo.getProperties() != null && cartridgeInfo.getProperties().length != 0) {
    for (    Property property : cartridgeInfo.getProperties()) {
      if (property.getName().startsWith(CartridgeConstants.CUSTOM_PAYLOAD_PARAM_NAME_PREFIX)) {
        String payloadParamName=property.getName();
        payloadData.add(payloadParamName.substring(payloadParamName.indexOf("String_Node_Str") + 1),property.getValue());
      }
    }
  }
  setPayloadData(payloadData);
}
Program: 116697
Project: 116697
Buggy source:
@Override public void deploy() throws ADCException, UnregisteredCartridgeException {
  super.deploy();
  ApplicationManagementUtil.registerService(getType(),getClusterId(),CartridgeConstants.DEFAULT_SUBDOMAIN,getPayloadData().getCompletePayloadData(),getTenantRange(),getHostName(),getAutoscalingPolicyName(),getDeploymentPolicyName(),null);
}

Fixed version (ground truth):
@Override public void deploy(Properties properties) throws ADCException, UnregisteredCartridgeException {
  super.deploy(properties);
  ApplicationManagementUtil.registerService(getType(),getClusterId(),CartridgeConstants.DEFAULT_SUBDOMAIN,getPayloadData().getCompletePayloadData(),getTenantRange(),getHostName(),getAutoscalingPolicyName(),getDeploymentPolicyName(),properties);
}
Program: 116698
Project: 116698
Buggy source:
@Override public void deploy() throws ADCException, UnregisteredCartridgeException {
  super.deploy();
  ApplicationManagementUtil.registerService(getType(),getClusterId(),CartridgeConstants.DEFAULT_SUBDOMAIN,getPayloadData().getCompletePayloadData(),getTenantRange(),getHostName(),getAutoscalingPolicyName(),getDeploymentPolicyName(),null);
}

Fixed version (ground truth):
@Override public void deploy(Properties properties) throws ADCException, UnregisteredCartridgeException {
  super.deploy(properties);
  ApplicationManagementUtil.registerService(getType(),getClusterId(),CartridgeConstants.DEFAULT_SUBDOMAIN,getPayloadData().getCompletePayloadData(),getTenantRange(),getHostName(),getAutoscalingPolicyName(),getDeploymentPolicyName(),properties);
}
Program: 116700
Project: 116700
Buggy source:
public void removeSubscription(String clusterId,String subscriptionAlias){
  Set<CartridgeSubscription> existingSubscriptions=clusterIdToCartridgeSubscription.get(clusterId);
  if (existingSubscriptions != null && !existingSubscriptions.isEmpty()) {
    Iterator<CartridgeSubscription> iterator=existingSubscriptions.iterator();
    while (iterator.hasNext()) {
      CartridgeSubscription cartridgeSubscription=iterator.next();
      if (cartridgeSubscription.getAlias().equals(subscriptionAlias)) {
        iterator.remove();
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + clusterId + "String_Node_Str");
        }
        break;
      }
    }
  }
  if (existingSubscriptions != null && existingSubscriptions.isEmpty()) {
    clusterIdToCartridgeSubscription.remove(clusterId);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterId + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void removeSubscription(String clusterId,String subscriptionAlias){
  Set<CartridgeSubscription> existingSubscriptions=clusterIdToCartridgeSubscription.get(clusterId);
  if (existingSubscriptions != null && !existingSubscriptions.isEmpty()) {
    Iterator<CartridgeSubscription> iterator=existingSubscriptions.iterator();
    while (iterator.hasNext()) {
      CartridgeSubscription cartridgeSubscription=iterator.next();
      if (cartridgeSubscription.getAlias().equals(subscriptionAlias)) {
        iterator.remove();
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + clusterId + "String_Node_Str");
        }
        break;
      }
    }
  }
  if (existingSubscriptions == null || existingSubscriptions.isEmpty()) {
    clusterIdToCartridgeSubscription.remove(clusterId);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterId + "String_Node_Str");
    }
  }
}
Program: 116701
Project: 116701
Buggy source:
public void addSubscription(CartridgeSubscription cartridgeSubscription){
  String clusterDomain=cartridgeSubscription.getClusterDomain();
  if (clusterIdToCartridgeSubscription.containsKey(clusterDomain)) {
    Set<CartridgeSubscription> existingSubscriptions=clusterIdToCartridgeSubscription.get(clusterDomain);
    if (existingSubscriptions.remove(cartridgeSubscription)) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + clusterDomain + "String_Node_Str");
      }
    }
    existingSubscriptions.add(cartridgeSubscription);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterDomain + "String_Node_Str");
    }
  }
 else {
    Set<CartridgeSubscription> subscriptions=new HashSet<CartridgeSubscription>();
    subscriptions.add(cartridgeSubscription);
    clusterIdToCartridgeSubscription.put(clusterDomain,subscriptions);
  }
}

Fixed version (ground truth):
public void addSubscription(CartridgeSubscription cartridgeSubscription){
  String clusterDomain=cartridgeSubscription.getClusterDomain();
  if (clusterIdToCartridgeSubscription.containsKey(clusterDomain)) {
    Set<CartridgeSubscription> existingSubscriptions=clusterIdToCartridgeSubscription.get(clusterDomain);
    if (existingSubscriptions.remove(cartridgeSubscription)) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + clusterDomain + "String_Node_Str");
      }
    }
    existingSubscriptions.add(cartridgeSubscription);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterDomain + "String_Node_Str");
    }
  }
 else {
    Set<CartridgeSubscription> subscriptions=new HashSet<CartridgeSubscription>();
    subscriptions.add(cartridgeSubscription);
    clusterIdToCartridgeSubscription.put(clusterDomain,subscriptions);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterDomain + "String_Node_Str");
    }
  }
}
Program: 116702
Project: 116702
Buggy source:
public void putSubscription(CartridgeSubscription cartridgeSubscription){
  clusterIdToSubscription.addSubscription(cartridgeSubscription);
  SubscriptionContext existingSubscriptionCtx=tenantIdToSubscriptionContext.getSubscriptionContext(cartridgeSubscription.getSubscriber().getTenantId());
  if (existingSubscriptionCtx != null) {
    existingSubscriptionCtx.addSubscription(cartridgeSubscription);
  }
 else {
    SubscriptionContext subscriptionContext=new SubscriptionContext();
    subscriptionContext.addSubscription(cartridgeSubscription);
    tenantIdToSubscriptionContext.addSubscriptionContext(cartridgeSubscription.getSubscriber().getTenantId(),subscriptionContext);
  }
}

Fixed version (ground truth):
public void putSubscription(CartridgeSubscription cartridgeSubscription){
  clusterIdToSubscription.addSubscription(cartridgeSubscription);
  SubscriptionContext existingSubscriptionCtx=tenantIdToSubscriptionContext.getSubscriptionContext(cartridgeSubscription.getSubscriber().getTenantId());
  if (existingSubscriptionCtx != null) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + cartridgeSubscription.getSubscriber().getTenantId());
    }
    existingSubscriptionCtx.addSubscription(cartridgeSubscription);
  }
 else {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + cartridgeSubscription.getSubscriber().getTenantId());
    }
    SubscriptionContext subscriptionContext=new SubscriptionContext();
    subscriptionContext.addSubscription(cartridgeSubscription);
    tenantIdToSubscriptionContext.addSubscriptionContext(cartridgeSubscription.getSubscriber().getTenantId(),subscriptionContext);
  }
}
Program: 116703
Project: 116703
Buggy source:
public CartridgeSubscription getSubscriptionForAlias(int tenantId,String subscriptionAlias){
  SubscriptionContext subscriptionContext=tenantIdToSubscriptionContext.getSubscriptionContext(tenantId);
  if (subscriptionContext == null) {
    return null;
  }
  return subscriptionContext.getSubscriptionForAlias(subscriptionAlias);
}

Fixed version (ground truth):
public CartridgeSubscription getSubscriptionForAlias(int tenantId,String subscriptionAlias){
  SubscriptionContext subscriptionContext=tenantIdToSubscriptionContext.getSubscriptionContext(tenantId);
  if (subscriptionContext == null) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + tenantId + "String_Node_Str"+ subscriptionAlias);
    }
    return null;
  }
  return subscriptionContext.getSubscriptionForAlias(subscriptionAlias);
}
Program: 116704
Project: 116704
Buggy source:
public void deleteSubscription(String type,String subscriptionAlias){
  Set<CartridgeSubscription> existingSubscriptions=cartridgeTypeToSubscriptions.get(type);
  if (existingSubscriptions != null && !existingSubscriptions.isEmpty()) {
    Iterator<CartridgeSubscription> iterator=existingSubscriptions.iterator();
    while (iterator.hasNext()) {
      CartridgeSubscription cartridgeSubscription=iterator.next();
      if (cartridgeSubscription.getAlias().equals(subscriptionAlias)) {
        iterator.remove();
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + subscriptionAlias + "String_Node_Str"+ type+ "String_Node_Str");
        }
        break;
      }
    }
  }
  if (existingSubscriptions != null && existingSubscriptions.isEmpty()) {
    cartridgeTypeToSubscriptions.remove(type);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + type + "String_Node_Str");
    }
  }
  if (aliasToSubscription.remove(subscriptionAlias) != null) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + subscriptionAlias + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void deleteSubscription(String type,String subscriptionAlias){
  Set<CartridgeSubscription> existingSubscriptions=cartridgeTypeToSubscriptions.get(type);
  if (existingSubscriptions != null && !existingSubscriptions.isEmpty()) {
    Iterator<CartridgeSubscription> iterator=existingSubscriptions.iterator();
    while (iterator.hasNext()) {
      CartridgeSubscription cartridgeSubscription=iterator.next();
      if (cartridgeSubscription.getAlias().equals(subscriptionAlias)) {
        iterator.remove();
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + subscriptionAlias + "String_Node_Str"+ type+ "String_Node_Str");
        }
        break;
      }
    }
  }
  if (existingSubscriptions == null || existingSubscriptions.isEmpty()) {
    cartridgeTypeToSubscriptions.remove(type);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + type + "String_Node_Str");
    }
  }
  if (aliasToSubscription.remove(subscriptionAlias) != null) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + subscriptionAlias + "String_Node_Str");
    }
  }
}
Program: 116705
Project: 116705
Buggy source:
public void removeSubscriptionContext(int tenantId,String type,String subscriptionAlias){
  if (tenantIdToSubscriptionContext.containsKey(tenantId)) {
    SubscriptionContext subscriptionContext=tenantIdToSubscriptionContext.get(tenantId);
    subscriptionContext.deleteSubscription(type,subscriptionAlias);
    if (subscriptionContext.getSubscriptionsOfType(type) == null && subscriptionContext.getSubscriptionForAlias(subscriptionAlias) == null) {
      tenantIdToSubscriptionContext.remove(tenantId);
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + tenantId);
      }
    }
  }
}

Fixed version (ground truth):
public void removeSubscriptionContext(int tenantId,String type,String subscriptionAlias){
  if (tenantIdToSubscriptionContext.containsKey(tenantId)) {
    SubscriptionContext subscriptionContext=tenantIdToSubscriptionContext.get(tenantId);
    subscriptionContext.deleteSubscription(type,subscriptionAlias);
    if (subscriptionContext.isEmpty()) {
      tenantIdToSubscriptionContext.remove(tenantId);
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + tenantId);
      }
    }
  }
}
Program: 116706
Project: 116706
Buggy source:
public void removeSubscription(int tenantId,String subscriptionAlias) throws PersistenceManagerException {
  CartridgeSubscription cartridgeSubscription=getCartridgeSubscription(tenantId,subscriptionAlias);
  String cartridgeType=cartridgeSubscription.getType();
  String clusterId=cartridgeSubscription.getClusterDomain();
  LookupDataHolder.getInstance().acquireWriteLock();
  try {
    try {
      persistenceManager.removeCartridgeSubscription(tenantId,cartridgeType,subscriptionAlias);
    }
 catch (    PersistenceManagerException e) {
      String errorMsg="String_Node_Str";
      log.error(errorMsg,e);
      throw e;
    }
    LookupDataHolder.getInstance().removeSubscription(tenantId,cartridgeType,subscriptionAlias,clusterId);
  }
  finally {
    LookupDataHolder.getInstance().releaseWriteLock();
  }
}

Fixed version (ground truth):
public void removeSubscription(int tenantId,String subscriptionAlias) throws PersistenceManagerException {
  CartridgeSubscription cartridgeSubscription=getCartridgeSubscription(tenantId,subscriptionAlias);
  if (cartridgeSubscription == null) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + tenantId + "String_Node_Str"+ subscriptionAlias);
    }
    return;
  }
  String cartridgeType=cartridgeSubscription.getType();
  String clusterId=cartridgeSubscription.getClusterDomain();
  LookupDataHolder.getInstance().acquireWriteLock();
  try {
    try {
      persistenceManager.removeCartridgeSubscription(tenantId,cartridgeType,subscriptionAlias);
    }
 catch (    PersistenceManagerException e) {
      String errorMsg="String_Node_Str";
      log.error(errorMsg,e);
      throw e;
    }
    LookupDataHolder.getInstance().removeSubscription(tenantId,cartridgeType,subscriptionAlias,clusterId);
  }
  finally {
    LookupDataHolder.getInstance().releaseWriteLock();
  }
}
Program: 116707
Project: 116707
Buggy source:
public Set<CartridgeSubscription> getCartridgeSubscription(String clusterId){
  LookupDataHolder.getInstance().acquireReadLock();
  try {
    Set<CartridgeSubscription> cartridgeSubscriptions=LookupDataHolder.getInstance().getSubscription(clusterId);
    return cartridgeSubscriptions;
  }
  finally {
    LookupDataHolder.getInstance().releaseReadLock();
  }
}

Fixed version (ground truth):
public CartridgeSubscription getCartridgeSubscription(int tenantId,String subscriptionAlias){
  LookupDataHolder.getInstance().acquireReadLock();
  try {
    CartridgeSubscription cartridgeSubscription=LookupDataHolder.getInstance().getSubscriptionForAlias(tenantId,subscriptionAlias);
    return cartridgeSubscription;
  }
  finally {
    LookupDataHolder.getInstance().releaseReadLock();
  }
}
Program: 116708
Project: 116708
Buggy source:
private Set<CartridgeSubscription> getCartridgeSubscription(String clusterDomain){
  try {
    return new DataInsertionAndRetrievalManager().getCartridgeSubscription(clusterDomain);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + clusterDomain,e);
    return null;
  }
}

Fixed version (ground truth):
private Set<CartridgeSubscription> getCartridgeSubscription(String clusterDomain){
  try {
    return new DataInsertionAndRetrievalManager().getCartridgeSubscriptionForCluster(clusterDomain);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + clusterDomain,e);
    return null;
  }
}
Program: 116710
Project: 116710
Buggy source:
@Override public void unregisterService(String clusterId) throws UnregisteredClusterException {
  ClusterContext ctxt=dataHolder.getClusterContext(clusterId);
  if (ctxt == null) {
    String msg="String_Node_Str" + clusterId;
    log.error(msg);
    throw new UnregisteredClusterException(msg);
  }
  TopologyBuilder.handleClusterRemoved(ctxt);
  dataHolder.removeClusterContext(clusterId);
  dataHolder.removeMemberContext(clusterId);
  persist();
}

Fixed version (ground truth):
@Override public void unregisterService(String clusterId) throws UnregisteredClusterException {
  final String clusterId_=clusterId;
  Runnable r=new Runnable(){
    public void run(){
      ClusterContext ctxt=dataHolder.getClusterContext(clusterId_);
      Collection<Member> members=TopologyManager.getTopology().getService(ctxt.getCartridgeType()).getCluster(clusterId_).getMembers();
      while (members.size() > 0) {
        CloudControllerUtil.sleep(1000);
      }
      if (ctxt == null) {
        String msg="String_Node_Str" + clusterId_;
        log.error(msg);
      }
      log.info("String_Node_Str" + clusterId_);
      TopologyBuilder.handleClusterRemoved(ctxt);
      dataHolder.removeClusterContext(clusterId_);
      dataHolder.removeMemberContext(clusterId_);
      persist();
    }
  }
;
  new Thread(r).start();
}
Program: 116711
Project: 116711
Buggy source:
@Override public void run(){
  String clusterId=memberContext.getClusterId();
  Partition partition=memberContext.getPartition();
  try {
    String autoAssignIpProp=iaasProvider.getProperty(CloudControllerConstants.AUTO_ASSIGN_IP_PROPERTY);
    String ip="String_Node_Str";
    if (autoAssignIpProp == null || (autoAssignIpProp != null && autoAssignIpProp.equals("String_Node_Str"))) {
      Iaas iaas=iaasProvider.getIaas();
      ip=iaas.associateAddress(iaasProvider,node);
      memberContext.setAllocatedIpAddress(ip);
      log.info("String_Node_Str" + memberContext.toString());
    }
    if (node.getPublicAddresses() != null && node.getPublicAddresses().iterator().hasNext()) {
      ip=node.getPublicAddresses().iterator().next();
      memberContext.setPublicIpAddress(ip);
      log.info("String_Node_Str" + memberContext.toString());
    }
    if (node.getPrivateAddresses() != null && node.getPrivateAddresses().iterator().hasNext()) {
      ip=node.getPrivateAddresses().iterator().next();
      memberContext.setPrivateIpAddress(ip);
      log.info("String_Node_Str" + memberContext.toString());
    }
    dataHolder.addMemberContext(memberContext);
    persist();
    String memberID=memberContext.getMemberId();
    TopologyBuilder.handleMemberSpawned(memberID,cartridgeType,clusterId,memberContext.getNetworkPartitionId(),partition.getId(),ip,memberContext.getLbClusterId());
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + node.toString());
    }
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + memberContext.toString();
    log.error(msg,e);
    throw new CloudControllerException(msg,e);
  }
}

Fixed version (ground truth):
public void run(){
  ClusterContext ctxt=dataHolder.getClusterContext(clusterId_);
  Collection<Member> members=TopologyManager.getTopology().getService(ctxt.getCartridgeType()).getCluster(clusterId_).getMembers();
  while (members.size() > 0) {
    CloudControllerUtil.sleep(1000);
  }
  if (ctxt == null) {
    String msg="String_Node_Str" + clusterId_;
    log.error(msg);
  }
  log.info("String_Node_Str" + clusterId_);
  TopologyBuilder.handleClusterRemoved(ctxt);
  dataHolder.removeClusterContext(clusterId_);
  dataHolder.removeMemberContext(clusterId_);
  persist();
}
Program: 116712
Project: 116712
Buggy source:
public static String getLbClusterId(String lbRefType,PartitionContext partitionCtxt,NetworkPartitionContext nwPartitionCtxt){
  String lbClusterId=null;
  if (lbRefType != null) {
    if (lbRefType.equals(org.apache.stratos.messaging.util.Constants.DEFAULT_LOAD_BALANCER)) {
      lbClusterId=nwPartitionCtxt.getDefaultLbClusterId();
    }
 else     if (lbRefType.equals(org.apache.stratos.messaging.util.Constants.SERVICE_AWARE_LOAD_BALANCER)) {
      String serviceName=partitionCtxt.getServiceName();
      lbClusterId=nwPartitionCtxt.getLBClusterIdOfService(serviceName);
    }
 else {
      log.warn("String_Node_Str" + lbRefType);
    }
  }
  return lbClusterId;
}

Fixed version (ground truth):
public static String getLbClusterId(String lbRefType,PartitionContext partitionCtxt,NetworkPartitionContext nwPartitionCtxt){
  String lbClusterId=null;
  if (lbRefType != null) {
    if (lbRefType.equals(org.apache.stratos.messaging.util.Constants.DEFAULT_LOAD_BALANCER)) {
      lbClusterId=PartitionManager.getInstance().getNetworkPartition(nwPartitionCtxt.getId()).getDefaultLbClusterId();
    }
 else     if (lbRefType.equals(org.apache.stratos.messaging.util.Constants.SERVICE_AWARE_LOAD_BALANCER)) {
      String serviceName=partitionCtxt.getServiceName();
      lbClusterId=PartitionManager.getInstance().getNetworkPartition(serviceName).getLBClusterIdOfService(nwPartitionCtxt.getId());
    }
 else {
      log.warn("String_Node_Str" + lbRefType);
    }
  }
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str" + "String_Node_Str",lbRefType,partitionCtxt.getPartitionId(),nwPartitionCtxt.getId(),lbClusterId));
  }
  return lbClusterId;
}
Program: 116720
Project: 116720
Buggy source:
public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null || args.length > 0) {
    String resourcePath=null;
    String partionDeployment=null;
    final CommandLineParser parser=new GnuParser();
    CommandLine commandLine;
    try {
      commandLine=parser.parse(options,args);
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str");
      }
      if (commandLine.hasOption(CliConstants.RESOURCE_PATH)) {
        if (logger.isTraceEnabled()) {
          logger.trace("String_Node_Str");
        }
        resourcePath=commandLine.getOptionValue(CliConstants.RESOURCE_PATH);
        partionDeployment=readResource(resourcePath);
      }
      if (resourcePath == null) {
        System.out.println("String_Node_Str" + getName() + "String_Node_Str");
        return CliConstants.BAD_ARGS_CODE;
      }
      RestCommandLineService.getInstance().deployPartition(partionDeployment);
      return CliConstants.SUCCESSFUL_CODE;
    }
 catch (    ParseException e) {
      if (logger.isErrorEnabled()) {
        logger.error("String_Node_Str",e);
      }
      System.out.println(e.getMessage());
      return CliConstants.BAD_ARGS_CODE;
    }
catch (    IOException e) {
      System.out.println("String_Node_Str");
      return CliConstants.BAD_ARGS_CODE;
    }
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.BAD_ARGS_CODE;
  }
}

Fixed version (ground truth):
public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length > 0) {
    String resourcePath=null;
    String partionDeployment=null;
    final CommandLineParser parser=new GnuParser();
    CommandLine commandLine;
    try {
      commandLine=parser.parse(options,args);
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str");
      }
      if (commandLine.hasOption(CliConstants.RESOURCE_PATH)) {
        if (logger.isTraceEnabled()) {
          logger.trace("String_Node_Str");
        }
        resourcePath=commandLine.getOptionValue(CliConstants.RESOURCE_PATH);
        partionDeployment=readResource(resourcePath);
      }
      if (resourcePath == null) {
        System.out.println("String_Node_Str" + getName() + "String_Node_Str");
        return CliConstants.BAD_ARGS_CODE;
      }
      RestCommandLineService.getInstance().deployPartition(partionDeployment);
      return CliConstants.SUCCESSFUL_CODE;
    }
 catch (    ParseException e) {
      if (logger.isErrorEnabled()) {
        logger.error("String_Node_Str",e);
      }
      System.out.println(e.getMessage());
      return CliConstants.BAD_ARGS_CODE;
    }
catch (    IOException e) {
      System.out.println("String_Node_Str");
      return CliConstants.BAD_ARGS_CODE;
    }
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.BAD_ARGS_CODE;
  }
}
Program: 116722
Project: 116722
Buggy source:
public IpAllocator(MemberContext memberContext,ComputeService computeService,Template template,IaasProvider iaasProvider,String cartridgeType,NodeMetadata node){
  this.memberContext=memberContext;
  this.computeService=computeService;
  this.template=template;
  this.iaasProvider=iaasProvider;
  this.cartridgeType=cartridgeType;
  this.node=node;
}

Fixed version (ground truth):
public IpAllocator(MemberContext memberContext,IaasProvider iaasProvider,String cartridgeType,NodeMetadata node){
  this.memberContext=memberContext;
  this.iaasProvider=iaasProvider;
  this.cartridgeType=cartridgeType;
  this.node=node;
}