Program: 115823
Project: 115823
Buggy source:
/** 
 * 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);
  }
}

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);
      }
      CartridgeContext[] cartridgeContextsOfGroups=getCartridgeContextsOfGroupsRecursively(components.getGroupContexts());
      if (cartridgeContextsOfGroups != null) {
        updateArtifactRepositoryList(artifactRepositoryList,cartridgeContextsOfGroups);
      }
      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);
  }
}