Source:
protected void executeRegisterVdsCommand() { synchronized (doubleRegistrationLock) { List<VDS> hostsByHostName = DbFacade.getInstance().getVdsDao().getAllForHostname(getParameters().getVdsName()); VDS provisionedVds = hostsByHostName.size() != 0 ? hostsByHostName.get(0) : null; if (provisionedVds != null && provisionedVds.getStatus() != VDSStatus.InstallingOS) { provisionedVds = null; } _vdssByUniqueId = null; VDS vdsByUniqueId = getVdssByUniqueId().size() != 0 ? getVdssByUniqueId().get(0) : null; if (vdsByUniqueId != null && vdsByUniqueId.getStatus() == VDSStatus.PendingApproval) { getQueryReturnValue().setSucceeded(dispatchOvirtApprovalCommand(vdsByUniqueId.getId())); return; } log.debug("RegisterVdsQuery::ExecuteCommand - Entering"); if (StringUtils.isEmpty(getParameters().getVdsName())) { getParameters().setVdsName(getParameters().getVdsUniqueId()); log.debug("RegisterVdsQuery::ExecuteCommand - VdsName empty, using VdsUnique ID as name"); } logable.addCustomValue("VdsName1", getParameters().getVdsName()); Guid vdsGroupId = getClusterId(); if (vdsGroupId == null || Guid.Empty.equals(vdsGroupId)) { reportClusterError(); getQueryReturnValue().setSucceeded(false); return; } if (provisionedVds != null) { getQueryReturnValue().setSucceeded(Register(provisionedVds, vdsGroupId, false)); } else { RefObject<Boolean> isPending = new RefObject<Boolean>(Boolean.FALSE); getQueryReturnValue().setSucceeded( HandleOldVdssWithSameHostName(vdsByUniqueId) && HandleOldVdssWithSameName(vdsByUniqueId) && CheckAutoApprovalDefinitions(isPending) && Register(vdsByUniqueId, vdsGroupId, isPending.argvalue.booleanValue())); } log.debug("RegisterVdsQuery::ExecuteCommand - Leaving Succeded value is '{}'", getQueryReturnValue().getSucceeded()); } }

Target:
protected void executeRegisterVdsCommand() { synchronized (doubleRegistrationLock) { List<VDS> hostsByHostName = DbFacade.getInstance().getVdsDao().getAllForHostname(getParameters().getVdsName()); VDS provisionedVds = hostsByHostName.size() != 0 ? hostsByHostName.get(0) : null; if (provisionedVds != null && provisionedVds.getStatus() != VDSStatus.InstallingOS) { provisionedVds = null; } _vdssByUniqueId = null; VDS vdsByUniqueId = getVdssByUniqueId().size() != 0 ? getVdssByUniqueId().get(0) : null; if (vdsByUniqueId != null && vdsByUniqueId.getStatus() == VDSStatus.PendingApproval) { getQueryReturnValue().setSucceeded(dispatchOvirtApprovalCommand(vdsByUniqueId.getId())); return; } log.debug("RegisterVdsQuery::ExecuteCommand - Entering"); if (StringUtils.isEmpty(getParameters().getVdsName())) { getParameters().setVdsName(getParameters().getVdsUniqueId()); log.debug("RegisterVdsQuery::ExecuteCommand - VdsName empty, using VdsUnique ID as name"); } logable.addCustomValue("VdsName1", getParameters().getVdsName()); Guid vdsGroupId = getClusterId(); if (Guid.isNullOrEmpty(vdsGroupId)) { reportClusterError(); return; } if (provisionedVds != null) { getQueryReturnValue().setSucceeded(Register(provisionedVds, vdsGroupId, false)); } else { RefObject<Boolean> isPending = new RefObject<Boolean>(Boolean.FALSE); getQueryReturnValue().setSucceeded( HandleOldVdssWithSameHostName(vdsByUniqueId) && HandleOldVdssWithSameName(vdsByUniqueId) && CheckAutoApprovalDefinitions(isPending) && Register(vdsByUniqueId, vdsGroupId, isPending.argvalue.booleanValue())); } log.debug("RegisterVdsQuery::ExecuteCommand - Leaving Succeded value is '{}'", getQueryReturnValue().getSucceeded()); } }