Source:
<code>public void onSaveHosts() { final MultipleHostsModel hostsModel = (MultipleHostsModel) getWindow(); if (hostsModel == null) { return; } if (!hostsModel.validate()) { return; } hostsModel.startProgress(null); ArrayList<VdcActionParametersBase> parametersList = new ArrayList<VdcActionParametersBase>(); for (Object object : hostsModel.getHosts().getItems()) { HostDetailModel hostDetailModel = (HostDetailModel) ((EntityModel) object).getEntity(); VDS host = new VDS(); host.setVdsName(hostDetailModel.getName()); host.setHostName(hostDetailModel.getAddress()); host.setSSHKeyFingerprint(hostDetailModel.getFingerprint()); host.setPort(54321); host.setVdsGroupId(getEntity().getId()); host.setpm_enabled(false); AddVdsActionParameters parameters = new AddVdsActionParameters(); parameters.setVdsId(host.getId()); parameters.setvds(host); parameters.setPassword(hostDetailModel.getPassword()); <START> parameters.setUsername("root"); END> parameters.setOverrideFirewall(false); parameters.setRebootAfterInstallation(getEntity().supportsVirtService()); parametersList.add(parameters); } Frontend.RunMultipleAction(VdcActionType.AddVds, parametersList, true, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { hostsModel.stopProgress(); boolean isAllCanDoPassed = true; for (VdcReturnValueBase returnValueBase : result.getReturnValue()) { isAllCanDoPassed = isAllCanDoPassed && returnValueBase.getCanDoAction(); if (!isAllCanDoPassed) { break; } } if (isAllCanDoPassed) { updateAlerts(); cancel(); } } }, null); }</code><technical_language>hardcode</technical_language>

Target:
public void onSaveHosts() { final MultipleHostsModel hostsModel = (MultipleHostsModel) getWindow(); if (hostsModel == null) { return; } if (!hostsModel.validate()) { return; } hostsModel.startProgress(null); ArrayList<VdcActionParametersBase> parametersList = new ArrayList<VdcActionParametersBase>(); for (Object object : hostsModel.getHosts().getItems()) { HostDetailModel hostDetailModel = (HostDetailModel) ((EntityModel) object).getEntity(); VDS host = new VDS(); host.setVdsName(hostDetailModel.getName()); host.setHostName(hostDetailModel.getAddress()); host.setSSHKeyFingerprint(hostDetailModel.getFingerprint()); host.setPort(54321); host.setSSHPort(22); host.setSSHUsername("root"); host.setVdsGroupId(getEntity().getId()); host.setpm_enabled(false); AddVdsActionParameters parameters = new AddVdsActionParameters(); parameters.setVdsId(host.getId()); parameters.setvds(host); parameters.setPassword(hostDetailModel.getPassword()); parameters.setOverrideFirewall(false); parameters.setRebootAfterInstallation(getEntity().supportsVirtService()); parametersList.add(parameters); } Frontend.RunMultipleAction(VdcActionType.AddVds, parametersList, true, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { hostsModel.stopProgress(); boolean isAllCanDoPassed = true; for (VdcReturnValueBase returnValueBase : result.getReturnValue()) { isAllCanDoPassed = isAllCanDoPassed && returnValueBase.getCanDoAction(); if (!isAllCanDoPassed) { break; } } if (isAllCanDoPassed) { updateAlerts(); cancel(); } } }, null); }