Program: 115909
Project: 115909
Buggy source:
private void addApplicationSignUp(ApplicationContext applicationContext,String applicationKey){
  try {
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",applicationContext.getApplicationId()));
    }
    ComponentContext components=applicationContext.getComponents();
    if (components != null) {
      ApplicationSignUp applicationSignUp=new ApplicationSignUp();
      applicationSignUp.setApplicationId(applicationContext.getApplicationId());
      applicationSignUp.setTenantId(applicationContext.getTenantId());
      List<ArtifactRepository> artifactRepositoryList=new ArrayList<ArtifactRepository>();
      CartridgeContext[] cartridgeContexts=components.getCartridgeContexts();
      if (cartridgeContexts != null) {
        updateArtifactRepositoryList(artifactRepositoryList,cartridgeContexts);
      }
      GroupContext[] groupContexts=components.getGroupContexts();
      if (groupContexts != null) {
        for (        GroupContext groupContext : groupContexts) {
          if (groupContext != null) {
            updateArtifactRepositoryList(artifactRepositoryList,groupContext.getCartridgeContexts());
          }
        }
      }
      ArtifactRepository[] artifactRepositoryArray=artifactRepositoryList.toArray(new ArtifactRepository[artifactRepositoryList.size()]);
      applicationSignUp.setArtifactRepositories(artifactRepositoryArray);
      encryptRepositoryPasswords(applicationSignUp,applicationKey);
      StratosManagerServiceClient serviceClient=StratosManagerServiceClient.getInstance();
      serviceClient.addApplicationSignUp(applicationSignUp);
      if (log.isInfoEnabled()) {
        log.info(String.format("String_Node_Str",applicationContext.getApplicationId()));
      }
    }
  }
 catch (  Exception e) {
    String message="String_Node_Str";
    log.error(message,e);
    throw new RuntimeException(message,e);
  }
}

Fixed version (ground truth):
/** 
 * Add application signup.
 * @param applicationContext
 * @param applicationKey
 * @param clusterIds
 */
private void addApplicationSignUp(ApplicationContext applicationContext,String applicationKey,List<String> clusterIds){
  try {
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",applicationContext.getApplicationId()));
    }
    ComponentContext components=applicationContext.getComponents();
    if (components != null) {
      ApplicationSignUp applicationSignUp=new ApplicationSignUp();
      applicationSignUp.setApplicationId(applicationContext.getApplicationId());
      applicationSignUp.setTenantId(applicationContext.getTenantId());
      String[] clusterIdsArray=clusterIds.toArray(new String[clusterIds.size()]);
      applicationSignUp.setClusterIds(clusterIdsArray);
      List<ArtifactRepository> artifactRepositoryList=new ArrayList<ArtifactRepository>();
      CartridgeContext[] cartridgeContexts=components.getCartridgeContexts();
      if (cartridgeContexts != null) {
        updateArtifactRepositoryList(artifactRepositoryList,cartridgeContexts);
      }
      GroupContext[] groupContexts=components.getGroupContexts();
      if (groupContexts != null) {
        for (        GroupContext groupContext : groupContexts) {
          if (groupContext != null) {
            updateArtifactRepositoryList(artifactRepositoryList,groupContext.getCartridgeContexts());
          }
        }
      }
      ArtifactRepository[] artifactRepositoryArray=artifactRepositoryList.toArray(new ArtifactRepository[artifactRepositoryList.size()]);
      applicationSignUp.setArtifactRepositories(artifactRepositoryArray);
      encryptRepositoryPasswords(applicationSignUp,applicationKey);
      StratosManagerServiceClient serviceClient=StratosManagerServiceClient.getInstance();
      serviceClient.addApplicationSignUp(applicationSignUp);
      if (log.isInfoEnabled()) {
        log.info(String.format("String_Node_Str",applicationContext.getApplicationId()));
      }
    }
  }
 catch (  Exception e) {
    String message="String_Node_Str";
    log.error(message,e);
    throw new RuntimeException(message,e);
  }
}