Program: 64073
Project: 64073
Buggy source:
@Override public void buildStack(Stack stack,String userData,Map<String,Object> setupProperties){
  AzureTemplate azureTemplate=(AzureTemplate)stack.getTemplate();
  retryingStackUpdater.updateStackStatus(stack.getId(),Status.REQUESTED);
  Credential credential=(Credential)setupProperties.get(CREDENTIAL);
  String emailAsFolder=(String)setupProperties.get(EMAILASFOLDER);
  String filePath=AzureCertificateService.getUserJksFileName(credential,emailAsFolder);
  File file=new File(filePath);
  AzureClient azureClient=new AzureClient(((AzureCredential)credential).getSubscriptionId(),file.getAbsolutePath(),((AzureCredential)credential).getJks());
  retryingStackUpdater.updateStackStatus(stack.getId(),Status.CREATE_IN_PROGRESS);
  String name=stack.getName().replaceAll("String_Node_Str","String_Node_Str");
  String commonName=((AzureCredential)credential).getName().replaceAll("String_Node_Str","String_Node_Str");
  createAffinityGroup(azureClient,azureTemplate,commonName);
  createStorageAccount(azureClient,azureTemplate,commonName);
  createVirtualNetwork(azureClient,name,commonName);
  for (int i=0; i < stack.getNodeCount(); i++) {
    try {
      String vmName=getVmName(name,i);
      createCloudService(azureClient,azureTemplate,name,vmName,commonName);
      createServiceCertificate(azureClient,azureTemplate,vmName,emailAsFolder);
      createVirtualMachine(azureClient,azureTemplate,name,vmName,commonName,emailAsFolder,userData);
    }
 catch (    FileNotFoundException e) {
      LOGGER.info("String_Node_Str" + e.getMessage());
      reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(new StackCreationFailure(stack.getId(),"String_Node_Str")));
      return;
    }
catch (    CertificateException e) {
      LOGGER.info("String_Node_Str" + e.getMessage());
      reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(new StackCreationFailure(stack.getId(),"String_Node_Str")));
      return;
    }
catch (    NoSuchAlgorithmException e) {
      LOGGER.info("String_Node_Str" + e.getMessage());
      reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(new StackCreationFailure(stack.getId(),"String_Node_Str")));
      return;
    }
catch (    Exception ex) {
      LOGGER.info("String_Node_Str" + ex.getMessage());
      reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(new StackCreationFailure(stack.getId(),"String_Node_Str" + ex.getMessage())));
      return;
    }
  }
  LOGGER.info("String_Node_Str",ReactorConfig.PROVISION_COMPLETE_EVENT,stack.getId());
  reactor.notify(ReactorConfig.PROVISION_COMPLETE_EVENT,Event.wrap(new ProvisionComplete(CloudPlatform.AZURE,stack.getId())));
}

Fixed version (ground truth):
@Override public void buildStack(Stack stack,String userData,Map<String,Object> setupProperties){
  AzureTemplate azureTemplate=(AzureTemplate)stack.getTemplate();
  retryingStackUpdater.updateStackStatus(stack.getId(),Status.REQUESTED);
  Credential credential=(Credential)setupProperties.get(CREDENTIAL);
  String emailAsFolder=(String)setupProperties.get(EMAILASFOLDER);
  String filePath=AzureCertificateService.getUserJksFileName(credential,emailAsFolder);
  File file=new File(filePath);
  AzureClient azureClient=new AzureClient(((AzureCredential)credential).getSubscriptionId(),file.getAbsolutePath(),((AzureCredential)credential).getJks());
  retryingStackUpdater.updateStackStatus(stack.getId(),Status.CREATE_IN_PROGRESS);
  String name=stack.getName().replaceAll("String_Node_Str","String_Node_Str");
  String commonName=((AzureCredential)credential).getName().replaceAll("String_Node_Str","String_Node_Str");
  createAffinityGroup(azureClient,azureTemplate,commonName);
  createStorageAccount(azureClient,azureTemplate,commonName);
  createVirtualNetwork(azureClient,name,commonName);
  for (int i=0; i < stack.getNodeCount(); i++) {
    try {
      String vmName=getVmName(name,i);
      createCloudService(azureClient,azureTemplate,name,vmName,commonName);
      createServiceCertificate(azureClient,azureTemplate,vmName,emailAsFolder);
      createVirtualMachine(azureClient,azureTemplate,credential,name,vmName,commonName,userData);
    }
 catch (    FileNotFoundException e) {
      LOGGER.info("String_Node_Str" + e.getMessage());
      reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(new StackCreationFailure(stack.getId(),"String_Node_Str")));
      return;
    }
catch (    CertificateException e) {
      LOGGER.info("String_Node_Str" + e.getMessage());
      reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(new StackCreationFailure(stack.getId(),"String_Node_Str")));
      return;
    }
catch (    NoSuchAlgorithmException e) {
      LOGGER.info("String_Node_Str" + e.getMessage());
      reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(new StackCreationFailure(stack.getId(),"String_Node_Str")));
      return;
    }
catch (    Exception ex) {
      LOGGER.info("String_Node_Str" + ex.getMessage());
      reactor.notify(ReactorConfig.STACK_CREATE_FAILED_EVENT,Event.wrap(new StackCreationFailure(stack.getId(),"String_Node_Str" + ex.getMessage())));
      return;
    }
  }
  LOGGER.info("String_Node_Str",ReactorConfig.PROVISION_COMPLETE_EVENT,stack.getId());
  reactor.notify(ReactorConfig.PROVISION_COMPLETE_EVENT,Event.wrap(new ProvisionComplete(CloudPlatform.AZURE,stack.getId())));
}