auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getIsoStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; models.add ( localIsoModel ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : models ) { model.setRole ( StorageDomainType.ISO ) ; } return models ; }

Target:
private static void addTypeToStorageModels ( org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType , java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models ) { for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : models ) { model.setRole ( storageDomainType ) ; } }
Source:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity , org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel , org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGlusterHookListModel > getClusterGlusterHookListProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector ) { return new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity , org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel , org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGlusterHookListModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel.class , org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGlusterHookListModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGlusterHookListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getDisableHookCommand ( ) ) ) { return confirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public void testImagesIllegal ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksListForChecks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . when ( diskImagesValidator ) . diskImagesNotIllegal ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL.name ( ) ) ) ; }

Target:
public void testAllDomainsWithinThreshold ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public void setThreadsPerCore ( java.lang.String value ) { if ( ( ( threadsPerCore ) == null ) && ( value == null ) ) { return ; } if ( ( ( threadsPerCore ) == null ) || ( ! ( threadsPerCore.equals ( value ) ) ) ) { threadsPerCore = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "ThreadsPerCore" ) ) ; } }

Target:
public void setThreadsPerCore ( java.lang.String value ) { if ( ( ( threadsPerCore ) == null ) && ( value == null ) ) { return ; } if ( ( ( threadsPerCore ) == null ) || ( ! ( threadsPerCore.equals ( value ) ) ) ) { threadsPerCore = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "ThreadsPerCore" ) ) ; } }
Source:
private void addRow ( java.lang.String label , java.lang.String value ) { int rowCount = contents.insertRow ( contents.getRowCount ( ) ) ; contents.setHTML ( rowCount , 0 , ( ( "<B>" + label ) + ":</B>" ) ) ; contents.setText ( rowCount , 1 , value ) ; }

Target:
private void addRow ( java.lang.String label , java.lang.String value ) { int rowCount = contents.insertRow ( contents.getRowCount ( ) ) ; contents.setText ( rowCount , 0 , ( ( label + ": " ) + value ) ) ; }
Source:
protected void AsyncSearch ( ) { super . AsyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vm.getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.UICommand getScanAlignmentCommand ( ) { return privateScanAlignmentCommand ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Qos qos ) { validateParameters ( qos , "name" , "type" ) ; org.ovirt.engine.core.common.action.QosParametersBase < org.ovirt.engine.core.common.businessentities.qos.QosBase > params = new org.ovirt.engine.core.common.action.QosParametersBase ( ) ; org.ovirt.engine.api.model.QosType qosType = qos.getType ( ) ; org.ovirt.engine.core.common.businessentities.qos.QosBase qosEntity = createNewQosEntityForQosType ( qosType ) ; params.setQos ( map ( qos , qosEntity ) ) ; if ( ( dataCenterId ) != null ) { qosEntity.setStoragePoolId ( dataCenterId ) ; } return performCreate ( addActionTypeForQosType ( qosType ) , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetQosById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Qos qos ) { validateParameters ( qos , "name" , "type" ) ; org.ovirt.engine.core.common.action.QosParametersBase < org.ovirt.engine.core.common.businessentities.qos.QosBase > params = new org.ovirt.engine.core.common.action.QosParametersBase ( ) ; org.ovirt.engine.api.model.QosType qosType = qos.getType ( ) ; org.ovirt.engine.core.common.businessentities.qos.QosBase qosEntity = createNewQosEntityForQosType ( qosType ) ; params.setQos ( map ( qos , qosEntity ) ) ; if ( ( dataCenterId ) != null ) { qosEntity.setStoragePoolId ( dataCenterId ) ; } return performCreate ( addActionTypeForQosType ( qosType ) , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetQosById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public java.lang.Boolean call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( _deploy.getVds ( ) . getVdsGroupId ( ) ) ; _deploy.getParser ( ) . cliEnvironmentSet ( GlusterEnv.ENABLE , vdsGroup.supportsGlusterService ( ) ) ; return true ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getClusterDao ( ) . get ( _deploy.getVds ( ) . getClusterId ( ) ) ; _deploy.getParser ( ) . cliEnvironmentSet ( GlusterEnv.ENABLE , cluster.supportsGlusterService ( ) ) ; return true ; }
Source:
public void hasDomains ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ERROR_CANNOT_CHANGE_STORAGE_POOL_TYPE_WITH_DOMAINS ) ; }

Target:
public void hasLocalDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdc = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; sdc.setStorageType ( StorageType.LOCALFS ) ; org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createDefaultStoragePool ( ) ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sdc ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ERROR_CANNOT_CHANGE_STORAGE_POOL_TYPE_WITH_LOCAL ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , getEntity ( 0 ) ) ; setUpGetStorageServerConnectionExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateStorageDomain , org.ovirt.engine.core.common.action.StorageDomainManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , getEntity ( 0 ) ) ; setUpGetStorageServerConnectionExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateStorageDomain , org.ovirt.engine.core.common.action.StorageDomainManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { long sizeNeeded = ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) ) / ( BYTES_IN_GB ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , sizeNeeded ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }

Target:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , memoryDisksList ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }
Source:
private void endDefaultOperations ( ) { endUnlockOps ( ) ; }

Target:
private void endDefaultOperations ( ) { endUnlockOps ( ) ; if ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getBaseTemplateId ( ) ) != null ) { java.lang.String jobId = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAOneTimeJob ( this , "onTimerHandleVdsRecovering" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , 0 , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.core.bll.AddVmTemplateCommand.updateVmsJobIdMap.put ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getBaseTemplateId ( ) , jobId ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVnicProfileViewDao ( ) ; }

Target:
public void testGetAllForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > result = dao.getAllForCluster ( FixturesTool.CLUSTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; final java.util.Set < org.ovirt.engine.core.compat.Guid > clusterNetworkIds = findClusterNetworkIds ( FixturesTool.CLUSTER ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile : result ) { org.junit.Assert.assertTrue ( clusterNetworkIds.contains ( profile.getNetworkId ( ) ) ) ; } }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( getParameters ( ) . getVm ( ) . getVmName ( ) ) ) ) { return java.util.Collections.singletonMap ( getParameters ( ) . getVm ( ) . getVmName ( ) , LockingGroup.VM_NAME.name ( ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( getParameters ( ) . getVm ( ) . getVmName ( ) ) ) ) { return java.util.Collections.singletonMap ( getParameters ( ) . getVm ( ) . getVmName ( ) , LockMessagesMatchUtil.VM_NAME ) ; } return null ; }
Source:
public java.lang.Integer getMemCommitedPercent ( ) { java.lang.Integer commited = mVdsDynamic.getmem_commited ( ) ; java.lang.Integer physical = mVdsDynamic.getphysical_mem_mb ( ) ; if ( ( ( commited == null ) || ( physical == null ) ) || ( physical == 0 ) ) { return 0 ; } return ( commited * 100 ) / physical ; }

Target:
public java.lang.Integer getMemCommitedPercent ( ) { java.lang.Integer commited = mVdsDynamic.getMemCommited ( ) ; java.lang.Integer physical = mVdsDynamic.getPhysicalMemMb ( ) ; if ( ( ( commited == null ) || ( physical == null ) ) || ( physical == 0 ) ) { return 0 ; } return ( commited * 100 ) / physical ; }
Source:
private void testmanagementNetworkRequired ( boolean management , boolean required , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expected ) { org.mockito.Mockito.when ( networkCluster.isManagement ( ) ) . thenReturn ( management ) ; org.mockito.Mockito.when ( networkCluster.isRequired ( ) ) . thenReturn ( required ) ; org.junit.Assert.assertThat ( validator.managementNetworkRequired ( network ) , expected ) ; }

Target:
private void testManagementNetworkRequired ( boolean management , boolean required , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expected ) { networkCluster.setManagement ( management ) ; networkCluster.setRequired ( required ) ; org.junit.Assert.assertThat ( validator.managementNetworkRequired ( network ) , expected ) ; }
Source:
public void testPrefixChange ( ) { mcr.mockConfigValue ( ConfigValues.OvirtIsoPrefix , "a different prefix" ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . ExecuteCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.junit.Assert.assertTrue ( "Prefix was changed, no ISOs should be returned" , ( ( java.util.List < org.ovirt.engine.core.compat.RpmVersion > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) . isEmpty ( ) ) ; }

Target:
public void testPrefixChange ( ) { mcr.mockConfigValue ( ConfigValues.OvirtIsoPrefix , "a different prefix" ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.junit.Assert.assertTrue ( "Prefix was changed, no ISOs should be returned" , ( ( java.util.List < org.ovirt.engine.core.compat.RpmVersion > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) . isEmpty ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getServer ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.core.common.businessentities.VDS server = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; server.setId ( id ) ; server.setVdsName ( name ) ; server.setStatus ( VDSStatus.Up ) ; server.setVdsGroupId ( clusterId ) ; return server ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS getServer ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS server = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; server.setId ( id ) ; server.setVdsName ( name ) ; server.setStatus ( status ) ; server.setVdsGroupId ( clusterId ) ; return server ; }
Source:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.VM model , int index ) { assertNotNull ( model.getCluster ( ) . getId ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getEntity ( int index ) { org.ovirt.engine.api.restapi.resource.VM vm = new org.ovirt.engine.api.restapi.resource.VM ( ) ; return org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.setUpEntityExpectations ( vm , vm.getStatisticsData ( ) , index ) ; }
Source:
private static void initSuspendSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.suspendSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetSuspendSupport ) , callback ) ; }

Target:
private void initSuspendSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { suspendSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetSuspendSupport ) , callback ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.AsyncTasks task ) { org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.AsyncTaskParameterSource parameterSource = getTaskParameterSource ( task ) ; parameterSource.addValue ( "started_at" , task.getStartTime ( ) ) ; parameterSource.addValue ( "storage_pool_id" , task.getStoragePoolId ( ) ) ; parameterSource.addValue ( "async_task_type" , task.getTaskType ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertasync_tasks" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.AsyncTask task ) { org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.AsyncTaskParameterSource parameterSource = getTaskParameterSource ( task ) ; parameterSource.addValue ( "started_at" , task.getStartTime ( ) ) ; parameterSource.addValue ( "storage_pool_id" , task.getStoragePoolId ( ) ) ; parameterSource.addValue ( "async_task_type" , task.getTaskType ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertasync_tasks" , parameterSource ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getIrsProxy ( ) . activateStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( _result.mStorageStatus ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getIrsProxy ( ) . activateStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( _result.mStorageStatus ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.instancetypes.InstanceTypeListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.instancetypes.InstanceTypeListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getDeleteInstanceTypeCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > verifyRunAction ( int exepectedNumOfRunActionExecutions , boolean waitForResult ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runMultipleAction ( org.mockito.Matchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , callbackCaptor.capture ( ) , org.mockito.Matchers.eq ( false ) , org.mockito.Matchers.eq ( waitForResult ) ) ; return callbackCaptor.getAllValues ( ) ; }

Target:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > verifyRunAction ( int exepectedNumOfRunActionExecutions , boolean waitForResult ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runMultipleAction ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , callbackCaptor.capture ( ) , org.mockito.ArgumentMatchers.eq ( false ) , org.mockito.ArgumentMatchers.eq ( waitForResult ) ) ; return callbackCaptor.getAllValues ( ) ; }
Source:
private java.lang.String getSearchPattern ( ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.aaa.DirectoryGroup.class , false ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( ResourceConstants.AAA_GROUPS_SEARCH_TEMPLATE , parent.getDirectory ( ) . getName ( ) , "" ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=*" : constraint ) ) ; return sb.toString ( ) ; }

Target:
private java.lang.String getSearchPattern ( ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , org.ovirt.engine.core.aaa.DirectoryGroup.class , false ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( ResourceConstants.AAA_GROUPS_SEARCH_TEMPLATE , parent.getDirectory ( ) . getName ( ) , "" ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=*" : constraint ) ) ; return sb.toString ( ) ; }
Source:
public static void GetStorageDomainList ( 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.storage_domains > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void GetNetworkList ( 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void decreasePendingVms ( ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "PendingVms for the guest {0} running on host {1} was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }

Target:
public void delay ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "Try to wait for te engine update the host memory and cpu stats" ) ; try { long t = java.lang.Math.max ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( vdsId ) . getLastUpdateElapsed ( ) , java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( org.ovirt.engine.core.common.config.ConfigValues.VdsRefreshRate ) ) ) ; t = java.lang.Math.max ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ThrottlerMaxWaitForVdsUpdateInMillis ) , t ) ; getBlockingQueue ( vdsId ) . poll ( t , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } catch ( java.lang.InterruptedException e ) { } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { NON_EXISTANT_GUID } , null ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { NON_EXISTANT_GUID } , null ) ; setUriInfo ( setUpGetMatrixConstraintsExpectations ( BackendHostResource.FORCE_CONSTRAINT , false , null ) ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public org.ovirt.engine.api.v3.types.V3NIC update ( org.ovirt.engine.api.v3.types.V3NIC v3Nic ) { org.ovirt.engine.api.model.Nic v4Nic = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Nic ) ; org.ovirt.engine.api.v3.helpers.V3NICHelper.setVnicProfile ( vmId , v3Nic , v4Nic ) ; try { return org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( getDelegate ( ) . update ( v4Nic ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }

Target:
public org.ovirt.engine.api.v3.types.V3NIC update ( org.ovirt.engine.api.v3.types.V3NIC v3Nic ) { org.ovirt.engine.api.model.Nic v4Nic = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Nic ) ; if ( ( v3Nic.isSetNetwork ( ) ) || ( v3Nic.isSetPortMirroring ( ) ) ) { org.ovirt.engine.api.v3.helpers.V3NICHelper.setVnicProfile ( vmId , v3Nic , v4Nic ) ; } try { return org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( getDelegate ( ) . update ( v4Nic ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.displayTypes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.Map < java.lang.Integer , java.util.Map < org.ovirt.engine.core.compat.Version , java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > > > result = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.displayTypes = new org.ovirt.engine.ui.uicommonweb.MapWithDefaults < java.lang.Integer , java.util.Map < org.ovirt.engine.core.compat.Version , java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > > > ( result , result.get ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DEFAULT_OS_ID ) ) ; }
Source:
private org.ovirt.engine.core.bll.validator.HostValidator mockHostForProtocol ( org.ovirt.engine.core.common.businessentities.VdsProtocol protocol ) { org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( host.getProtocol ( ) ) . thenReturn ( protocol ) ; return new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; }

Target:
private org.ovirt.engine.core.bll.validator.HostValidator mockHostForUniqueId ( java.lang.String value ) { mockConfigRule.mockConfigValue ( ConfigValues.InstallVds , java.lang.Boolean.TRUE ) ; org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( host.getUniqueId ( ) ) . thenReturn ( value ) ; return new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; }
Source:
private void templateValidate ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . countAllTemplates ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { int count = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( count <= 1 ) { getModel ( ) . disableEditing ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . notAvailableWithNoTemplates ( ) ) ; } } } ) ) ; }

Target:
private void templateValidate ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . countAllTemplates ( asyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Integer > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Integer count ) { if ( count <= 1 ) { getModel ( ) . disableEditing ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . notAvailableWithNoTemplates ( ) ) ; } } } ) ) ; }
Source:
public void checkStorageDomainNotEqualWithStatusActive ( ) { setStorageDomainStatus ( StorageDomainStatus.Active ) ; org.junit.Assert.assertFalse ( cmd.checkStorageDomainStatusNotEqual ( StorageDomainStatus.Active ) ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.Assert.assertEquals ( 2 , messages.size ( ) ) ; org.junit.Assert.assertEquals ( messages.get ( 0 ) , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ; org.junit.Assert.assertEquals ( messages.get ( 1 ) , java.lang.String.format ( "$status %1$s" , StorageDomainStatus.Active ) ) ; }

Target:
public void checkStorageDomainNotEqualWithStatusActive ( ) { setStorageDomainStatus ( StorageDomainStatus.Active ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.checkStorageDomainStatusNotEqual ( StorageDomainStatus.Active ) ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , messages.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( messages.get ( 0 ) , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( messages.get ( 1 ) , java.lang.String.format ( "$status %1$s" , StorageDomainStatus.Active ) ) ; }
Source:
public void run ( ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.log.infoFormat ( "Rollback for command: {0}." , command.getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( command.getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.log.errorFormat ( "Failed to cancel tasks for command: {0}." , command.getClass ( ) . getName ( ) ) ; } }

Target:
public void cancelTasks ( final org.ovirt.engine.core.bll.CommandBase command ) { coCoAsyncTaskHelper.cancelTasks ( command , org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.log ) ; }
Source:
private void mockVdsWithOsVersion ( java.lang.String osVersion ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setvds_type ( VDSType.oVirtNode ) ; vds.sethost_os ( osVersion ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; }

Target:
private void mockVdsWithOsVersion ( java.lang.String osVersion ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsType ( VDSType.oVirtNode ) ; vds.setHostOs ( osVersion ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; }
Source:
public static void getUserMessageOfTheDayViaPublic ( 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.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getGlusterSwiftServerServices ( 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
protected < T > T performAction ( org.ovirt.engine.core.common.action.ActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase params , java.lang.Class < T > resultType ) { try { return resultType.cast ( doAction ( task , params ) . getActionReturnValue ( ) ) ; } catch ( java.lang.Exception e ) { return handleError ( resultType , e , false ) ; } }

Target:
protected < T > T performAction ( org.ovirt.engine.core.common.action.ActionType task , org.ovirt.engine.core.common.action.ActionParametersBase params , java.lang.Class < T > resultType ) { try { return resultType.cast ( doAction ( task , params ) . getActionReturnValue ( ) ) ; } catch ( java.lang.Exception e ) { return handleError ( resultType , e , false ) ; } }
Source:
protected void setUpEntityQueryExpectations ( int times , org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.ISCSI_BOND_ID } , iscsiBond ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times , org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( QueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.ISCSI_BOND_ID } , iscsiBond ) ; } }
Source:
private void updateNumOfMonitors ( ) { if ( isVncSelected ( ) ) { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } else { getNumOfMonitors ( ) . setIsChangable ( true ) ; } }

Target:
private void updateNumOfMonitors ( ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.DisplayType > selectedDisplayType = getDisplayType ( ) . getSelectedItem ( ) ; if ( ( selectedDisplayType != null ) && ( ( selectedDisplayType.getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } else { getNumOfMonitors ( ) . setIsChangable ( true ) ; } }
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 ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.ILLEGAL ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; onFinish ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.storage.CloneSingleCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; onFinish ( cmdId ) ; }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
protected boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.checkImageConfiguration ( destStorages.get ( diskInfoDestinationMap.get ( diskImage.getId ( ) ) . getStorageIds ( ) . get ( 0 ) ) . getStorageStaticData ( ) , diskImage , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.checkImageConfiguration ( destStorages.get ( diskInfoDestinationMap.get ( diskImage.getId ( ) ) . getStorageIds ( ) . get ( 0 ) ) . getStorageStaticData ( ) , diskImage , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getReturnValue ( ) . getValidationMessages ( ) ) ; }
Source:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksToCheck = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( disksToCheck ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( validate ( diskImagesValidator.diskImagesHaveNotExceededMaxNumberOfVolumesInImageChain ( ) ) ) ; }

Target:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksToCheck = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterImageDisks ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_NOT_SHAREABLE , org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_ACTIVE ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( disksToCheck ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( validate ( diskImagesValidator.diskImagesHaveNotExceededMaxNumberOfVolumesInImageChain ( ) ) ) ; }
Source:
public < T > java.util.List < T > executeReadList ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < T > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { java.util.Map < java.lang.String , java.lang.Object > resultsMap = executeImpl ( procedureName , parameterSource , createCallForRead ( procedureName , mapper , parameterSource ) , mapper ) ; return ( ( java.util.List < T > ) ( resultsMap.get ( BaseDAODbFacade.RETURN_VALUE_PARAMETER ) ) ) ; }

Target:
public < T > java.util.List < T > executeReadList ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < T > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { java.util.Map < java.lang.String , java.lang.Object > resultsMap = executeImpl ( procedureName , parameterSource , createCallForRead ( procedureName , mapper , parameterSource ) , mapper ) ; return ( ( java.util.List < T > ) ( resultsMap.get ( org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.RETURN_VALUE_PARAMETER ) ) ) ; }