Program: 64082
Project: 64082
Buggy source:
private void createVirtualMachine(AzureClient azureClient,AzureTemplate azureTemplate,String name,String vmName,String commonName,User user,String hash) throws FileNotFoundException, CertificateException, NoSuchAlgorithmException {
  byte[] encoded=Base64.encodeBase64(vmName.getBytes());
  String label=new String(encoded);
  Map<String,Object> props=new HashMap<>();
  List<Port> ports=new ArrayList<>();
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  props.put(NAME,vmName);
  props.put(DEPLOYMENTSLOT,PRODUCTION);
  props.put(LABEL,label);
  props.put(IMAGENAME,azureTemplate.getImageName());
  props.put(IMAGESTOREURI,String.format("String_Node_Str",commonName,vmName));
  props.put(HOSTNAME,vmName);
  props.put(USERNAME,DEFAULT_USER_NAME);
  if (azureTemplate.getPassword() != null && !azureTemplate.getPassword().isEmpty()) {
    props.put(PASSWORD,azureTemplate.getPassword());
  }
 else {
    X509Certificate sshCert=new X509Certificate(AzureCertificateService.getCerFile(user.emailAsFolder(),azureTemplate.getId()));
    props.put(SSHPUBLICKEYFINGERPRINT,sshCert.getSha1Fingerprint());
    props.put(SSHPUBLICKEYPATH,String.format("String_Node_Str",DEFAULT_USER_NAME));
  }
  props.put(SERVICENAME,vmName);
  props.put(SUBNETNAME,name);
  Map<String,String> map=new HashMap<>();
  map.put("String_Node_Str",hash);
  props.put(CUSTOMDATA,new String(Base64.encodeBase64(userDataBuilder.build(CloudPlatform.AZURE,map).getBytes())));
  props.put(VIRTUALNETWORKNAME,name);
  props.put(PORTS,ports);
  props.put(VMTYPE,AzureVmType.valueOf(azureTemplate.getVmType()).vmType().replaceAll("String_Node_Str","String_Node_Str"));
  HttpResponseDecorator virtualMachineResponse=(HttpResponseDecorator)azureClient.createVirtualMachine(props);
  String requestId=(String)azureClient.getRequestId(virtualMachineResponse);
  azureClient.waitUntilComplete(requestId);
}

Fixed version (ground truth):
private void createVirtualMachine(AzureClient azureClient,AzureTemplate azureTemplate,String name,String vmName,String commonName,User user,String hash) throws FileNotFoundException, CertificateException, NoSuchAlgorithmException {
  byte[] encoded=Base64.encodeBase64(vmName.getBytes());
  String label=new String(encoded);
  Map<String,Object> props=new HashMap<>();
  List<Port> ports=new ArrayList<>();
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  ports.add(new Port("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  props.put(NAME,vmName);
  props.put(DEPLOYMENTSLOT,PRODUCTION);
  props.put(LABEL,label);
  props.put(IMAGENAME,azureTemplate.getImageName());
  props.put(IMAGESTOREURI,String.format("String_Node_Str",commonName,vmName));
  props.put(HOSTNAME,vmName);
  props.put(USERNAME,DEFAULT_USER_NAME);
  if (azureTemplate.getPassword() != null && !azureTemplate.getPassword().isEmpty()) {
    props.put(PASSWORD,azureTemplate.getPassword());
  }
 else {
    X509Certificate sshCert=new X509Certificate(AzureCertificateService.getCerFile(user.emailAsFolder(),azureTemplate.getId()));
    props.put(SSHPUBLICKEYFINGERPRINT,sshCert.getSha1Fingerprint().toUpperCase());
    props.put(SSHPUBLICKEYPATH,String.format("String_Node_Str",DEFAULT_USER_NAME));
  }
  props.put(SERVICENAME,vmName);
  props.put(SUBNETNAME,name);
  Map<String,String> map=new HashMap<>();
  map.put("String_Node_Str",hash);
  props.put(CUSTOMDATA,new String(Base64.encodeBase64(userDataBuilder.build(CloudPlatform.AZURE,map).getBytes())));
  props.put(VIRTUALNETWORKNAME,name);
  props.put(PORTS,ports);
  props.put(VMTYPE,AzureVmType.valueOf(azureTemplate.getVmType()).vmType().replaceAll("String_Node_Str","String_Node_Str"));
  HttpResponseDecorator virtualMachineResponse=(HttpResponseDecorator)azureClient.createVirtualMachine(props);
  String requestId=(String)azureClient.getRequestId(virtualMachineResponse);
  azureClient.waitUntilComplete(requestId);
}