Program: 64077
Project: 64077
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;
    }
  }
}

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,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;
    }
  }
  reactor.notify(ReactorConfig.STACK_CREATE_COMPLETE_EVENT,Event.wrap(new StackCreateComplete(CloudPlatform.AZURE,stack.getId())));
}