auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void canSetNumaConfigurationWithVmFromParams ( ) { mockCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massRemoveNumaNodeByNumaNodeId ( org.mockito.Matchers.eq ( existingNumaNodeIds ) ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.Matchers.eq ( paramNumaNodes ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void canSetNumaConfigurationWithVmFromParams ( ) { mockCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massRemoveNumaNodeByNumaNodeId ( org.mockito.ArgumentMatchers.eq ( existingNumaNodeIds ) ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.ArgumentMatchers.eq ( paramNumaNodes ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
private boolean checkIsDomainLocked ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainMap ) { if ( ( ( domainMap.getStatus ( ) ) != null ) && ( domainMap.getStatus ( ) . isStorageDomainInProcess ( ) ) ) { addInvalidSDStatusMessage ( StorageDomainStatus.Locked ) ; return true ; } return false ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( validate ( createStorageDomainValidator ( ) . isInProcess ( ) ) ) ) { return false ; } if ( ! ( validate ( createStoragePoolValidator ( ) . isAnyDomainInProcess ( ) ) ) ) { return false ; } return org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.initializeVds ( ) ; }
Source:
public void setMappingLocator ( org.ovirt.engine.api.restapi.types.MappingLocator mappingLocator ) { this . mappingLocator = mappingLocator ; }

Target:
private void addSELinuxModes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.SELinuxMode [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { version.setSelinuxModes ( new org.ovirt.engine.api.model.SELinuxModes ( ) ) ; for ( org.ovirt.engine.api.model.SELinuxMode mode : values ) { version.getSelinuxModes ( ) . getSELinuxModes ( ) . add ( mode.value ( ) ) ; } } }
Source:
public void testValidateAndSetStorageQuotaGlobalNotExceeded ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > parameters = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; parameters.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.STORAGE_QUOTA_GLOBAL_NOT_EXCEEDED , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1 ) ) ; org.junit.Assert.assertTrue ( quotaManager.validateAndSetStorageQuota ( storage_pool , parameters , canDoActionMessages ) ) ; assertEmptyCanDoActionMessage ( ) ; assertAuditLogNotWritten ( ) ; }

Target:
private boolean consumeForStorageQuota ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper parameters = null ; try { parameters = parametersWrapper.clone ( ) ; parameters.getParameters ( ) . add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( quotaId , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1.0 ) ) ; } catch ( java.lang.CloneNotSupportedException e ) { } return quotaManager.consume ( parameters ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetworkAttachment , org.ovirt.engine.core.common.action.RemoveNetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveNetworkAttachment , org.ovirt.engine.core.common.action.RemoveNetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsed ( java.util.List < ? extends org.ovirt.engine.core.common.businessentities.Nameable > entities , org.ovirt.engine.core.dal.VdcBllMessages entitiesReplacement ) { if ( entities.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "ENTITIES_USING_NETWORK" , entities ) ; replacements.add ( entitiesReplacement.name ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE , replacements ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsed ( java.util.List < ? extends org.ovirt.engine.core.common.businessentities.Nameable > entities , org.ovirt.engine.core.common.errors.VdcBllMessages entitiesReplacement ) { if ( entities.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "ENTITIES_USING_NETWORK" , entities ) ; replacements.add ( entitiesReplacement.name ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE , replacements ) ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc reset ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.reset ( vmId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterHookRemove ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookRemove ( glusterCommand , stage , hookName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void onLoadingStateChanged ( com.google.gwt.user.cellview.client.LoadingStateChangeEvent.LoadingState state ) { super . onLoadingStateChanged ( state ) ; if ( state == ( com.google.gwt.user.cellview.client.LoadingStateChangeEvent.LoadingState.LOADED ) ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { enforceScrollPosition ( ) ; } } ) ; } }

Target:
public void setRowData ( int start , java.util.List < ? extends T > values ) { super . setRowData ( start , values ) ; selectionModel.resolveChanges ( ) ; updateTableControls ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { tableContainer.getElement ( ) . setScrollTop ( tableContainerVerticalScrollPosition ) ; } } ) ; }
Source:
private void testFillRemoteViewerUrl ( java.lang.String toRepalce , java.lang.String baseUrl , java.lang.String resourceUrl , java.lang.String expected ) { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; getQuery ( ) . fillRemoteViewerUrl ( options , toRepalce , baseUrl , resourceUrl ) ; org.junit.Assert.assertEquals ( expected , options.getRemoteViewerNewerVersionUrl ( ) ) ; }

Target:
private void testFillRemoteViewerUrl ( java.lang.String toRepalce , java.lang.String baseUrl , java.lang.String resourceUrl , java.lang.String expected ) { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; getQuery ( ) . fillRemoteViewerUrl ( options , toRepalce , baseUrl , resourceUrl ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected , options.getRemoteViewerNewerVersionUrl ( ) ) ; }
Source:
public java.util.concurrent.Future < java.util.Map < java.lang.String , java.lang.Object > > setupNetworks ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct networks , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct bonds , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options ) { return vdsServer.futureSetupNetworks ( networks.getInnerMap ( ) , bonds.getInnerMap ( ) , options.getInnerMap ( ) ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setMOMPolicyParameters ( java.util.Map < java.lang.String , java.lang.Object > key_value_store ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.setMOMPolicyParameters ( key_value_store ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( asyncTaskCreationInfo , parentCommand , description , entityType , entityIds ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during CreateTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.common.VdcObjectType vdcObjectType , org.ovirt.engine.core.compat.Guid ... entityIds ) { return createTask ( taskId , asyncTaskCreationInfo , parentCommand , createEntitiesMapForSingleEntityType ( vdcObjectType , entityIds ) ) ; }
Source:
public void updatePortNotAllowed ( ) { org.mockito.Mockito.when ( oldHost.getPort ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; org.mockito.Mockito.when ( host.getPort ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; org.junit.Assert.assertThat ( validator.updatePortAllowed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.VDS_PORT_CHANGE_REQUIRE_INSTALL ) ) ; }

Target:
public void updatePortNotAllowed ( ) { org.mockito.Mockito.when ( oldHost.getPort ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; org.mockito.Mockito.when ( host.getPort ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; org.junit.Assert.assertThat ( validator.updatePortAllowed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_PORT_CHANGE_REQUIRE_INSTALL ) ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getBroker ( ) . connectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , BuildStructFromConnectionListObject ( ) ) ; ProceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.String > returnValue = _result.convertToStatusList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.setReturnValue ( returnValue ) ; logFailedStorageConnections ( returnValue ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getBroker ( ) . connectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , BuildStructFromConnectionListObject ( ) ) ; proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.String > returnValue = _result.convertToStatusList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.setReturnValue ( returnValue ) ; logFailedStorageConnections ( returnValue ) ; }
Source:
protected void getPKITrustV1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { org.ovirt.engine.core.services.RegisterServlet.log.info ( java.lang.String.format ( "PKI Trust request: source='%s', secured='%s'" , request.getRemoteHost ( ) , request.isSecure ( ) ) ) ; try ( java.io.PrintWriter out = response.getWriter ( ) ) { response.setContentType ( PKIResources.Resource.CACertificate.getContentType ( PKIResources.Format.X509_PEM_CA ) ) ; out.print ( PKIResources.Resource.CACertificate.toString ( PKIResources.Format.X509_PEM_CA ) ) ; } }

Target:
protected void getPKITrustV1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { org.ovirt.engine.core.services.RegisterServlet.log.info ( java.lang.String.format ( "PKI Trust request: source='%s', secured='%s'" , request.getRemoteHost ( ) , request.isSecure ( ) ) ) ; try ( java.io.PrintWriter out = response.getWriter ( ) ) { response.setContentType ( org.ovirt.engine.core.utils.PKIResources.getCaCertificate ( ) . getContentType ( PKIResources.Format.X509_PEM_CA ) ) ; out.print ( org.ovirt.engine.core.utils.PKIResources.getCaCertificate ( ) . toString ( PKIResources.Format.X509_PEM_CA ) ) ; } }
Source:
private void internalEndWithFailure ( ) { log.errorFormat ( "Ending command with failure: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }

Target:
private void internalEndWithFailure ( ) { log.error ( "Ending command '{}' with failure." , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }
Source:
private org.ovirt.engine.core.bll.host.UpdateAvailable create ( org.ovirt.engine.core.common.businessentities.VDSType hostType ) { for ( org.ovirt.engine.core.bll.host.UpdateAvailable hostUpdater : hostUpdaters ) { if ( hostType == ( hostUpdater.getHostType ( ) ) ) { return hostUpdater ; } } org.ovirt.engine.core.bll.host.AvailableUpdatesFinder.log.error ( "Cannot instantiate host available strategy for unknown host type '{}'" , hostType ) ; throw new java.lang.RuntimeException ( "Cannot instantiate host available strategy for unknown host type" ) ; }

Target:
private org.ovirt.engine.core.bll.host.UpdateAvailable create ( org.ovirt.engine.core.common.businessentities.VDSType hostType ) { for ( org.ovirt.engine.core.bll.host.UpdateAvailable hostUpdater : hostUpdaters ) { java.util.EnumSet < org.ovirt.engine.core.common.businessentities.VDSType > hostTypes = hostUpdater.getHostTypes ( ) ; if ( hostTypes.contains ( hostType ) ) { return hostUpdater ; } } org.ovirt.engine.core.bll.host.AvailableUpdatesFinder.log.error ( "Cannot instantiate host available strategy for unknown host type '{}'" , hostType ) ; throw new java.lang.RuntimeException ( "Cannot instantiate host available strategy for unknown host type" ) ; }
Source:
protected int getPredictedVmCpu ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.VDS vds , boolean countThreadsAsCores ) { java.lang.Integer effectiveCpuCores = org.ovirt.engine.core.bll.scheduling.SlaValidator.getEffectiveCpuCores ( vds , countThreadsAsCores ) ; if ( ( ( vm.getUsageCpuPercent ( ) ) != null ) && ( effectiveCpuCores != null ) ) { return ( ( vm.getUsageCpuPercent ( ) ) * ( vm.getNumOfCpus ( ) ) ) / effectiveCpuCores ; } return 0 ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondaryDestinations ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED ) ) ? java.lang.Long.valueOf ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED ) ) : 0L ; return getUnderUtilizedMemoryHosts ( candidateHosts , requiredMemory , 0 ) ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; log.error ( "Failed adding disk to Cinder. ID: {}" , getDiskId ( ) ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getDiskId ( org.ovirt.engine.core.bll.storage.disk.cinder.AddCinderDiskCommand < org.ovirt.engine.core.common.action.AddDiskParameters > addCinderDiskCommand ) { return addCinderDiskCommand.getParameters ( ) . getDiskInfo ( ) . getId ( ) ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getTaskIdList ( ) { return ( getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ? getReturnValue ( ) . getInternalVdsmTaskIdList ( ) : getReturnValue ( ) . getVdsmTaskIdList ( ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcActionType getParentCommandType ( ) { org.ovirt.engine.core.common.action.VdcActionType parentCommand = org.ovirt.engine.core.common.action.VdcActionType.Unknown ; if ( parentHasCallback ( ) ) { if ( ( getTaskType ( ) ) == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ) ) { parentCommand = getParameters ( ) . getParentCommand ( ) ; } } else { parentCommand = getParameters ( ) . getParentCommand ( ) ; } return parentCommand ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc convertOva ( java.lang.String ovaPath , java.util.Map < java.lang.String , java.lang.Object > vm , java.lang.String jobUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.convertOva ( ovaPath , vm , jobUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc convertVmFromOva ( java.lang.String ovaPath , java.util.Map < java.lang.String , java.lang.Object > vm , java.lang.String jobUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.convertExternalVmFromOva ( ovaPath , vm , jobUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Down ) ; vm.setguest_os ( "rhel6" ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; mockGetForDisk ( new org.ovirt.engine.core.common.businessentities.VM ( ) ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Down ) ; vm.setguest_os ( "rhel6" ) ; vm.setId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; mockGetForDisk ( vm ) ; mockGetVmsListForDisk ( vm ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = mockStoragePool ( Version.v3_1 ) ; vm.setstorage_pool_id ( storagePool.getId ( ) ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > poolRepresentants = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > poolRepresentantsRetval = result.getReturnValues ( ) ; for ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue poolRepresentant : poolRepresentantsRetval ) { poolRepresentants.add ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( poolRepresentant.getReturnValue ( ) ) ) ) ; } consoleModelsCache.updatePoolCache ( poolRepresentants ) ; finishSearch ( all ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; updatePriority ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.action.SubTabTreeActionPanel createActionPanel ( org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider modelProvider ) { return new org.ovirt.engine.ui.common.widget.action.SubTabTreeActionPanel ( modelProvider ) ; }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetMainTabPanelContent ) ) { actionPanelContainer.add ( content ) ; } else if ( slot == ( org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.TYPE_SetActionPanel ) ) { if ( content != null ) { actionPanelContainer.add ( content ) ; } else { actionPanelContainer.clear ( ) ; } } else { super . setInSlot ( slot , content ) ; } }
Source:
public void testEvalPositive ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockVmNetworkInterface.isPlugged ( ) ) . thenReturn ( true ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.common.predicates.VmNetworkCanBeUpdatedPredicate.getInstance ( ) . eval ( mockVmNetworkInterface ) ) ; org.mockito.Mockito.verify ( mockVmNetworkInterface ) . isPlugged ( ) ; org.mockito.Mockito.verify ( mockVmNetworkInterface , org.mockito.Mockito.never ( ) ) . isLinked ( ) ; }

Target:
public void testEvalPositive ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockVmNetworkInterface.isPlugged ( ) ) . thenReturn ( true ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.common.predicates.VmNetworkCanBeUpdatedPredicate.getInstance ( ) . test ( mockVmNetworkInterface ) ) ; org.mockito.Mockito.verify ( mockVmNetworkInterface ) . isPlugged ( ) ; org.mockito.Mockito.verify ( mockVmNetworkInterface , org.mockito.Mockito.never ( ) ) . isLinked ( ) ; }
Source:
public static void GetStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void refreshHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { refreshCapabilities ( new java.util.concurrent.atomic.AtomicBoolean ( ) , vds ) ; } finally { if ( vds != null ) { updateDynamicData ( vds.getDynamicData ( ) ) ; updateNumaData ( vds ) ; monitoringStrategy.processHardwareCapabilities ( vds ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . handleVdsVersion ( vds.getId ( ) ) ; } } }

Target:
public void refreshHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { refreshCapabilities ( new java.util.concurrent.atomic.AtomicBoolean ( ) , vds ) ; } finally { if ( vds != null ) { updateDynamicData ( vds.getDynamicData ( ) ) ; updateNumaData ( vds ) ; monitoringStrategy.processHardwareCapabilities ( vds ) ; resourceManager.getEventListener ( ) . handleVdsVersion ( vds.getId ( ) ) ; } } }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnSetupNetworks" ) ) { onSetupNetworks ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnSetupNetworks" ) ) { onSetupNetworks ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }
Source:
private void _setVdsStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { _vds.setstatus ( status ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . update ( _vds.getDynamicData ( ) ) ; return null ; } } ) ; }

Target:
private void _setVdsStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { _vds.setStatus ( status ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . update ( _vds.getDynamicData ( ) ) ; return null ; } } ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; return performAction ( VdcActionType.RemoveDisk , new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guid ) ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters params = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( asGuid ( id ) ) ; boolean force = org.ovirt.engine.api.common.util.QueryHelper.getBooleanMatrixParameter ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResource.FORCE , true , false ) ; if ( force ) { params.setForceDelete ( force ) ; } java.lang.String storageDomain = org.ovirt.engine.api.common.util.QueryHelper.getMatrixConstraint ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResource.STORAGE_DOMAIN ) ; if ( storageDomain != null ) { params.setStorageDomainId ( asGuid ( storageDomain ) ) ; } return performAction ( VdcActionType.RemoveDisk , params ) ; }
Source:
public static void getRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.DetachNetworkFromClusterInternal , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToClusterCommand.getParameters ( ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval ( getPersistedNetwork ( ) ) ) { detachLabeledNetworksFromClusterHosts ( ) ; } } else { propagateFailure ( returnValue ) ; } }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.ActionReturnValue returnValue = runInternalAction ( ActionType.DetachNetworkFromClusterInternal , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToClusterCommand.getParameters ( ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval ( getPersistedNetwork ( ) ) ) { detachLabeledNetworksFromClusterHosts ( ) ; } } else { propagateFailure ( returnValue ) ; } }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand < org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters > ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < org.ovirt.engine.core.common.action.LiveMigrateDiskParameters > ( ) , vmId ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isValidSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; }

Target:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand < org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters > ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < org.ovirt.engine.core.common.action.LiveMigrateDiskParameters > ( ) , vmId ) , null ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }
Source:
private void removeMemoryImages ( ) { org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.bll.memory.MemoryImageRemoverFromExportDomain ( getVm ( ) , this , org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStorageDomainId ( ) ) ) . remove ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.compat.Guid diskId , org.ovirt.engine.core.compat.Guid imageId , boolean shouldWipe ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setId ( diskId ) ; disk.setImageId ( imageId ) ; disk.setStoragePoolId ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStoragePoolId ( ) ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; disk.setWipeAfterDelete ( shouldWipe ) ; disk.setActive ( true ) ; return disk ; }
Source:
public void canDoActionVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToVmsThatAreNotDown ( org.mockito.Matchers.anyBoolean ( ) , org.mockito.Matchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }

Target:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToVmsThatAreNotDown ( org.mockito.Matchers.anyBoolean ( ) , org.mockito.Matchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }
Source:
private void processHeartbeat ( ) { if ( ( ! ( this . isInInit ( ) ) ) && ( ( ( this . lastHeartbeat ) + ( this . policy.getHeartbeat ( ) ) ) < ( java.lang.System.currentTimeMillis ( ) ) ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.debug ( "Heartbeat exeeded. Closing channel" ) ; this . closeChannel ( ) ; } }

Target:
private void processHeartbeat ( ) { if ( ( ( ! ( this . isInInit ( ) ) ) && ( this . policy.isHeartbeat ( ) ) ) && ( ( ( this . lastHeartbeat ) + ( this . policy.getHeartbeat ( ) ) ) < ( java.lang.System.currentTimeMillis ( ) ) ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.debug ( "Heartbeat exeeded. Closing channel" ) ; this . closeChannel ( ) ; } }
Source:
private java.util.Set < java.lang.String > getRemovedNetworks ( ) { if ( ( removedNetworks ) == null ) { removedNetworks = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedNetworkAttachments ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedNetworkAttachments ( ) ) { removedNetworks.add ( getNetworkBusinessEntityMap ( ) . get ( attachment.getNetworkId ( ) ) . getName ( ) ) ; } } return removedNetworks ; }

Target:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getLabelToNic ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsToConfigureByName ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > labelToExistingNic = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nicsToConfigureByName.values ( ) ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( nic ) ) { for ( java.lang.String label : nic.getLabels ( ) ) { labelToExistingNic.put ( label , nic ) ; } } } return labelToExistingNic ; }
Source:
protected boolean canDoAction ( ) { boolean autheticated = super . canDoAction ( ) ; if ( autheticated ) { autheticated = org.ovirt.engine.core.bll.aaa.LoginAdminUserCommand.getCurrentUser ( ) . isAdmin ( ) ; if ( ! autheticated ) { addCanDoActionMessage ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; org.ovirt.engine.core.bll.aaa.LoginAdminUserCommand.logAutheticationFailure ( ) ; } } return autheticated ; }

Target:
protected boolean canDoAction ( ) { boolean autheticated = super . canDoAction ( ) ; if ( autheticated ) { autheticated = org.ovirt.engine.core.bll.aaa.LoginAdminUserCommand.getCurrentUser ( ) . isAdmin ( ) ; if ( ! autheticated ) { addCanDoActionMessage ( EngineMessage.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; org.ovirt.engine.core.bll.aaa.LoginAdminUserCommand.logAutheticationFailure ( ) ; } } return autheticated ; }