Program: 89552
Project: 89552
Buggy source:
/** 
 * The constructor. Starts by initialising the parent abstract class, then sets the operating system dependent variables.
 * @param subTreeRoot The XML root element.
 * @param parentSettings The Settings to be inherited from the PhysicalLocation, where this machine is placed.
 * @param param The machine parameters to be inherited from the PhysicalLocation.
 * @param netarchiveSuiteSource The name of the NetarchiveSuite package file. Must end with '.zip'.
 * @param securityPolicy The security policy file, to be copied into machine directory.
 * @param dbFile The name of the database file.
 * @param arcdbFile The name of the archive file.
 * @param resetDir Whether the temporary directory should be reset.
 * @param externalJarFolder The folder containing the external jar library files.
 * @param deployConfiguration The general deployment configuration.
 */
public LinuxMachine(Element subTreeRoot,XmlStructure parentSettings,Parameters param,String netarchiveSuiteSource,File slf4JConfig,File securityPolicy,File dbFile,File arcdbFile,boolean resetDir,File externalJarFolder,DeployConfiguration deployConfiguration){
  super(subTreeRoot,parentSettings,param,netarchiveSuiteSource,slf4JConfig,securityPolicy,dbFile,arcdbFile,resetDir,externalJarFolder);
  operatingSystem=Constants.OPERATING_SYSTEM_LINUX_ATTRIBUTE;
  scriptExtension=Constants.SCRIPT_EXTENSION_LINUX;
  String[] bundlesArr;
  String[] certificatesArr;
  String srcStr;
  String dstStr;
  int idx;
  for (  Application app : applications) {
    if (app.isBundledHarvester()) {
      bundlesArr=app.getSettingsValues(Constants.SETTINGS_HARVEST_HERITRIX3_BUNDLE_LEAF);
      if ((bundlesArr != null || bundlesArr.length == 0) && deployConfiguration.getDefaultBundlerZip().isPresent()) {
        bundlesArr=new String[]{deployConfiguration.getDefaultBundlerZip().get().getAbsolutePath()};
      }
 else       if ((bundlesArr == null || bundlesArr.length == 0) && !deployConfiguration.getDefaultBundlerZip().isPresent()) {
        throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
      }
      certificatesArr=app.getSettingsValues(Constants.SETTINGS_HARVEST_HERITRIX3_CERTIFICATE_LEAF);
      if (bundlesArr != null && bundlesArr.length > 0 && certificatesArr != null) {
        for (int i=0; i < bundlesArr.length; ++i) {
          srcStr=bundlesArr[i];
          if (!bundles.containsKey(srcStr)) {
            idx=srcStr.lastIndexOf('/');
            if (idx != -1) {
              dstStr=srcStr.substring(idx + 1);
            }
 else {
              dstStr=srcStr;
            }
            dstStr=machineParameters.getInstallDirValue() + "String_Node_Str" + getEnvironmentName()+ "String_Node_Str"+ dstStr;
            bundles.put(srcStr,dstStr);
            System.out.println(srcStr + "String_Node_Str" + dstStr);
          }
        }
        for (int i=0; i < certificatesArr.length; ++i) {
          srcStr=certificatesArr[i];
          if (!certificates.containsKey(srcStr)) {
            idx=srcStr.lastIndexOf('/');
            if (idx != -1) {
              dstStr=srcStr.substring(idx + 1);
            }
 else {
              dstStr=srcStr;
            }
            dstStr=machineParameters.getInstallDirValue() + "String_Node_Str" + getEnvironmentName()+ "String_Node_Str"+ dstStr;
            certificates.put(srcStr,dstStr);
            System.out.println(srcStr + "String_Node_Str" + dstStr);
          }
        }
        XmlStructure appSettings=app.getSettings();
        Element heritrixBundleElement=appSettings.getSubChild(Constants.SETTINGS_HARVEST_HERITRIX3_BUNDLE_LEAF);
        if (heritrixBundleElement == null) {
          appSettings.getSubChild(Constants.SETTINGS_HERITRIX_BRANCH).addElement("String_Node_Str");
          heritrixBundleElement=appSettings.getSubChild(Constants.SETTINGS_HARVEST_HERITRIX3_BUNDLE_LEAF);
          heritrixBundleElement.setText((String)bundles.values().toArray()[0]);
        }
 else {
          heritrixBundleElement.setText(bundles.get(heritrixBundleElement.getText()));
        }
        Element h3KeystoreElement=appSettings.getSubChild(Constants.SETTINGS_HARVEST_HERITRIX3_CERTIFICATE_LEAF);
        if (h3KeystoreElement != null) {
          String h3KeystoreName=certificates.get(h3KeystoreElement.getText());
          if (h3KeystoreName != null) {
            h3KeystoreElement.setText(h3KeystoreName);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * The constructor. Starts by initialising the parent abstract class, then sets the operating system dependent variables.
 * @param subTreeRoot The XML root element.
 * @param parentSettings The Settings to be inherited from the PhysicalLocation, where this machine is placed.
 * @param param The machine parameters to be inherited from the PhysicalLocation.
 * @param netarchiveSuiteSource The name of the NetarchiveSuite package file. Must end with '.zip'.
 * @param securityPolicy The security policy file, to be copied into machine directory.
 * @param dbFile The name of the database file.
 * @param arcdbFile The name of the archive file.
 * @param resetDir Whether the temporary directory should be reset.
 * @param externalJarFolder The folder containing the external jar library files.
 * @param deployConfiguration The general deployment configuration.
 */
public LinuxMachine(Element subTreeRoot,XmlStructure parentSettings,Parameters param,String netarchiveSuiteSource,File slf4JConfig,File securityPolicy,File dbFile,File arcdbFile,boolean resetDir,File externalJarFolder,DeployConfiguration deployConfiguration){
  super(subTreeRoot,parentSettings,param,netarchiveSuiteSource,slf4JConfig,securityPolicy,dbFile,arcdbFile,resetDir,externalJarFolder);
  operatingSystem=Constants.OPERATING_SYSTEM_LINUX_ATTRIBUTE;
  scriptExtension=Constants.SCRIPT_EXTENSION_LINUX;
  String[] bundlesArr;
  String[] certificatesArr;
  String srcStr;
  String dstStr;
  int idx;
  for (  Application app : applications) {
    if (app.isBundledHarvester()) {
      bundlesArr=app.getSettingsValues(Constants.SETTINGS_HARVEST_HERITRIX3_BUNDLE_LEAF);
      if ((bundlesArr == null || bundlesArr.length == 0) && deployConfiguration.getDefaultBundlerZip().isPresent()) {
        bundlesArr=new String[]{deployConfiguration.getDefaultBundlerZip().get().getAbsolutePath()};
      }
 else       if ((bundlesArr == null || bundlesArr.length == 0) && !deployConfiguration.getDefaultBundlerZip().isPresent()) {
        throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
      }
      certificatesArr=app.getSettingsValues(Constants.SETTINGS_HARVEST_HERITRIX3_CERTIFICATE_LEAF);
      if (bundlesArr != null && bundlesArr.length > 0 && certificatesArr != null) {
        for (int i=0; i < bundlesArr.length; ++i) {
          srcStr=bundlesArr[i];
          if (!bundles.containsKey(srcStr)) {
            idx=srcStr.lastIndexOf('/');
            if (idx != -1) {
              dstStr=srcStr.substring(idx + 1);
            }
 else {
              dstStr=srcStr;
            }
            dstStr=machineParameters.getInstallDirValue() + "String_Node_Str" + getEnvironmentName()+ "String_Node_Str"+ dstStr;
            bundles.put(srcStr,dstStr);
            System.out.println(srcStr + "String_Node_Str" + dstStr);
          }
        }
        for (int i=0; i < certificatesArr.length; ++i) {
          srcStr=certificatesArr[i];
          if (!certificates.containsKey(srcStr)) {
            idx=srcStr.lastIndexOf('/');
            if (idx != -1) {
              dstStr=srcStr.substring(idx + 1);
            }
 else {
              dstStr=srcStr;
            }
            dstStr=machineParameters.getInstallDirValue() + "String_Node_Str" + getEnvironmentName()+ "String_Node_Str"+ dstStr;
            certificates.put(srcStr,dstStr);
            System.out.println(srcStr + "String_Node_Str" + dstStr);
          }
        }
        XmlStructure appSettings=app.getSettings();
        Element heritrixBundleElement=appSettings.getSubChild(Constants.SETTINGS_HARVEST_HERITRIX3_BUNDLE_LEAF);
        if (heritrixBundleElement == null) {
          appSettings.getSubChild(Constants.SETTINGS_HERITRIX_BRANCH).addElement("String_Node_Str");
          heritrixBundleElement=appSettings.getSubChild(Constants.SETTINGS_HARVEST_HERITRIX3_BUNDLE_LEAF);
          heritrixBundleElement.setText((String)bundles.values().toArray()[0]);
        }
 else {
          heritrixBundleElement.setText(bundles.get(heritrixBundleElement.getText()));
        }
        Element h3KeystoreElement=appSettings.getSubChild(Constants.SETTINGS_HARVEST_HERITRIX3_CERTIFICATE_LEAF);
        if (h3KeystoreElement != null) {
          String h3KeystoreName=certificates.get(h3KeystoreElement.getText());
          if (h3KeystoreName != null) {
            h3KeystoreElement.setText(h3KeystoreName);
          }
        }
      }
    }
  }
}