auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.dao.VmTemplateDAO getVmTemplateDAO ( ) { final org.ovirt.engine.core.dao.VmTemplateDAO vt = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmTemplateDAO.class ) ; final org.ovirt.engine.core.common.businessentities.VmTemplate t = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; t.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; t.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; org.mockito.Mockito.when ( vt.get ( Guid.Empty ) ) . thenReturn ( t ) ; org.mockito.Mockito.when ( vt.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) ; return vt ; }

Target:
public org.ovirt.engine.core.dao.VmTemplateDao getVmTemplateDao ( ) { final org.ovirt.engine.core.dao.VmTemplateDao vt = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmTemplateDao.class ) ; final org.ovirt.engine.core.common.businessentities.VmTemplate t = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; t.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; t.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; org.mockito.Mockito.when ( vt.get ( Guid.Empty ) ) . thenReturn ( t ) ; org.mockito.Mockito.when ( vt.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) ; return vt ; }
Source:
private void removeVmStatlessImages ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }

Target:
private void removeVmStatlessImages ( ) { runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }
Source:
private void clearAddressOnInterfaceChange ( org.ovirt.engine.core.common.businessentities.Disk diskToUpdate , org.ovirt.engine.core.common.businessentities.Disk diskWithUserChanges ) { if ( ( diskToUpdate.getDiskInterface ( ) ) != ( diskWithUserChanges.getDiskInterface ( ) ) ) { getVmDeviceDao ( ) . clearDeviceAddress ( getVmDeviceDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( diskToUpdate.getId ( ) , getVmId ( ) ) ) . getDeviceId ( ) ) ; } }

Target:
private void clearAddressOnInterfaceChange ( ) { if ( ( getOldDisk ( ) . getDiskInterface ( ) ) != ( getNewDisk ( ) . getDiskInterface ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmDeviceId deviceId = new org.ovirt.engine.core.common.businessentities.VmDeviceId ( getOldDisk ( ) . getId ( ) , getVmId ( ) ) ; getVmDeviceDao ( ) . clearDeviceAddress ( getVmDeviceDao ( ) . get ( deviceId ) . getDeviceId ( ) ) ; } }
Source:
public void testRemove ( ) { org.ovirt.engine.core.dao.network.DnsResolverConfigurationDao dnsResolverConfigurationDao = dbFacade.getDnsResolverConfigurationDao ( ) ; org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( result.getDnsResolverConfiguration ( ) . getId ( ) , FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ; dao.remove ( result.getId ( ) ) ; org.junit.Assert.assertNull ( dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ) ; org.junit.Assert.assertNull ( dnsResolverConfigurationDao.get ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ) ; }

Target:
public void testGetByNameWithInvalidName ( ) { org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByNameAndCluster ( "farkle" , FixturesTool.CLUSTER ) ; org.junit.Assert.assertNull ( result ) ; }
Source:
public void loadTemplateData ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( template ) ; if ( ( ( template.getInterfaces ( ) ) == null ) || ( template.getInterfaces ( ) . isEmpty ( ) ) ) { template.setInterfaces ( getVmNetworkInterfaceDao ( ) . getAllForTemplate ( template.getId ( ) ) ) ; } }

Target:
public void loadTemplateData ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { vmDeviceUtils.setVmDevices ( template ) ; if ( ( ( template.getInterfaces ( ) ) == null ) || ( template.getInterfaces ( ) . isEmpty ( ) ) ) { template.setInterfaces ( getVmNetworkInterfaceDao ( ) . getAllForTemplate ( template.getId ( ) ) ) ; } }
Source:
public static java.lang.Integer getEffectiveCpuCores ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( vds.getvds_group_id ( ) ) ; if ( ( ( ( vds.getCpuThreads ( ) ) != null ) && ( vdsGroup != null ) ) && ( java.lang.Boolean.TRUE.equals ( vdsGroup.getCountThreadsAsCores ( ) ) ) ) { return vds.getCpuThreads ( ) ; } else { return vds.getcpu_cores ( ) ; } }

Target:
public static java.lang.Integer getEffectiveCpuCores ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( vds.getVdsGroupId ( ) ) ; if ( ( ( ( vds.getCpuThreads ( ) ) != null ) && ( vdsGroup != null ) ) && ( java.lang.Boolean.TRUE.equals ( vdsGroup.getCountThreadsAsCores ( ) ) ) ) { return vds.getCpuThreads ( ) ; } else { return vds.getCpuCores ( ) ; } }
Source:
public void asMapTwoConvItems ( ) { schedule.addStallingStep ( new org.ovirt.engine.core.common.migration.ConvergenceItemWithStallingLimit ( 8 , "action" , 10 ) ) . addStallingStep ( new org.ovirt.engine.core.common.migration.ConvergenceItemWithStallingLimit ( 12 , "action2" , 12 ) ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.bll.migration.ConvergenceScheduleTest.ExpectedConvergence ( ) . addStalling ( 8 , "action" , 10 ) . addStalling ( 12 , "action2" , 12 ) , schedule.asMap ( ) ) ; }

Target:
public void asMapTwoConvItems ( ) { schedule.addStallingStep ( new org.ovirt.engine.core.common.migration.ConvergenceItemWithStallingLimit ( 8 , "action" , 10 ) ) . addStallingStep ( new org.ovirt.engine.core.common.migration.ConvergenceItemWithStallingLimit ( 12 , "action2" , 12 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( new org.ovirt.engine.core.bll.migration.ConvergenceScheduleTest.ExpectedConvergence ( ) . addStalling ( 8 , "action" , 10 ) . addStalling ( 12 , "action2" , 12 ) , schedule.asMap ( ) ) ; }
Source:
private java.util.Set < java.lang.String > getRemovedBonds ( ) { if ( ( removedBonds ) == null ) { removedBonds = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) ) { removedBonds.add ( bond.getName ( ) ) ; } } return removedBonds ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getRemovedBonds ( ) { if ( ( removedBonds ) == null ) { java.util.Set < org.ovirt.engine.core.compat.Guid > removedBondIds = org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) ; removedBonds = org.ovirt.engine.core.common.businessentities.Entities.filterEntitiesByRequiredIds ( removedBondIds , getExistingNics ( ) ) ; } return removedBonds ; }
Source:
public static void GetDataCentersWithPermittedActionOnClusters ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDataCentersWithPermittedActionOnClusters , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public static void GetRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters ( roleId ) , aQuery ) ; }
Source:
public void testListLimitResults ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( false ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.Tag > results = getCollection ( ) ; assertNotNull ( collection ) ; assertEquals ( 3 , results.size ( ) ) ; }

Target:
public void testListLimitResults ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( false ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.Tag > results = getCollection ( ) ; org.junit.Assert.assertNotNull ( collection ) ; org.junit.Assert.assertEquals ( 3 , results.size ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getByName ( java.lang.String name , boolean isCaseSensitive ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_group_name" , name ) . addValue ( "is_case_sensitive" , isCaseSensitive ) ; return getCallsHandler ( ) . executeReadList ( "GetVdsGroupByVdsGroupName" , org.ovirt.engine.core.dao.VdsGroupDaoImpl.VdsGroupRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > getByName ( java.lang.String name , boolean isCaseSensitive ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_name" , name ) . addValue ( "is_case_sensitive" , isCaseSensitive ) ; return getCallsHandler ( ) . executeReadList ( "GetClusterByClusterName" , org.ovirt.engine.core.dao.ClusterDaoImpl.ClusterRowMapper.instance , parameterSource ) ; }
Source:
public void updateJobLastUpdateTime ( org.ovirt.engine.core.compat.Guid jobId , java.util.Date lastUpdateTime ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "job_id" , jobId ) . addValue ( "last_update_time" , lastUpdateTime ) ; getCallsHandler ( ) . executeModification ( "UpdateJobLastUpdateTime" , parameterSource ) ; }

Target:
public void deleteCompletedJobs ( final java.util.Date succeededJobs , final java.util.Date failedJobs ) { updateQuery ( entityManager.createNamedQuery ( "Job.deleteCompletedJobs" ) . setParameter ( "successEndTime" , succeededJobs ) . setParameter ( "failedEndTime" , failedJobs ) . setParameter ( "failStatus" , java.util.EnumSet.of ( JobExecutionStatus.FAILED , JobExecutionStatus.ABORTED , JobExecutionStatus.UNKNOWN ) ) . setParameter ( "successStatus" , JobExecutionStatus.FINISHED ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType , java.lang.String [ ] devicesList ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = null ; if ( devicesList != null ) { xmlRpcReturnValue = vdsServer.getDeviceList ( storageType , devicesList ) ; } else { xmlRpcReturnValue = vdsServer.getDeviceList ( storageType ) ; } org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( 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.HostJobsReturnForXmlRpc getHostJobs ( java.lang.String jobType , java.util.List < java.lang.String > jobIds ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getHostJobs ( jobType , jobIds ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void SyncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getGlusterHooks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > glusterHooks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ) ( returnValue ) ) ; setItems ( glusterHooks ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getGlusterHooks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > glusterHooks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ) ( returnValue ) ) ; setItems ( glusterHooks ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
public void saveNewSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( model.getSelectedItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { onSaveSanStorage ( ) ; } else { forceCreationWarning ( usedLunsMessages ) ; } }

Target:
public void saveNewSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( model.getCurrentStorageItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { onSaveSanStorage ( ) ; } else { forceCreationWarning ( usedLunsMessages ) ; } }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.VdsStatic vds ) { org.ovirt.engine.core.compat.Guid id = vds.getId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; vds.setId ( id ) ; } new org.springframework.jdbc.core.simple.SimpleJdbcCall ( jdbcTemplate ) . withProcedureName ( "InsertVdsStatic" ) . execute ( getInsertOrUpdateParams ( vds ) ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.VdsStatic vds ) { org.ovirt.engine.core.compat.Guid id = vds.getId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; vds.setId ( id ) ; } new org.springframework.jdbc.core.simple.SimpleJdbcCall ( getJdbcTemplate ( ) ) . withProcedureName ( "InsertVdsStatic" ) . execute ( getInsertOrUpdateParams ( vds ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.vds_spm_id_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.vds_spm_id_map entity = new org.ovirt.engine.core.common.businessentities.vds_spm_id_map ( ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "vds_id" ) ) ) ; entity.setvds_spm_id ( rs.getInt ( "vds_spm_id" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.vds_spm_id_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.vds_spm_id_map entity = new org.ovirt.engine.core.common.businessentities.vds_spm_id_map ( ) ; entity.setstorage_pool_id ( getGuidDefaultEmpty ( rs , "storage_pool_id" ) ) ; entity.setId ( getGuidDefaultEmpty ( rs , "vds_id" ) ) ; entity.setvds_spm_id ( rs.getInt ( "vds_spm_id" ) ) ; return entity ; }
Source:
private void expectAndTestForVmAndInterface ( ) { org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( networkId ) ; vm.setId ( vmId ) ; vmNetworkInterface.setVmId ( vmId ) ; org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > vmInterfaceVmPair = new org.ovirt.engine.core.common.utils.PairQueryable ( vmNetworkInterface , vm ) ; java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > > expected = java.util.Collections.singletonList ( vmInterfaceVmPair ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( "Wrong result returned" , expected , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
private void expectAndTestForVmAndInterface ( ) { org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( networkId ) ; vm.setId ( vmId ) ; vmNetworkInterface.setVmId ( vmId ) ; org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > vmInterfaceVmPair = new org.ovirt.engine.core.common.utils.PairQueryable ( vmNetworkInterface , vm ) ; java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > > expected = java.util.Collections.singletonList ( vmInterfaceVmPair ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) , "Wrong result returned" ) ; }
Source:
public void testBootFromNetworkNoNetwork ( ) { org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao.class ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) . when ( dao ) . getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( dao ) . when ( runVmValidator ) . getVmNetworkInterfaceDao ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.N , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_NETWORK_WITHOUT_NETWORK ) ; }

Target:
public void testBootFromNetworkNoNetwork ( ) { org.ovirt.engine.core.dao.network.VmNicDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNicDao.class ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNic > ( ) ) . when ( dao ) . getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( dao ) . when ( runVmValidator ) . getVmNicDao ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.N , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_NETWORK_WITHOUT_NETWORK ) ; }
Source:
public void vmTypeChanged ( org.ovirt.engine.core.common.businessentities.VmType vmType ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( ( vmType == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) ) ; getModel ( ) . getAllowConsoleReconnect ( ) . setEntity ( ( vmType == ( org.ovirt.engine.core.common.businessentities.VmType.Server ) ) ) ; }

Target:
public void vmTypeChanged ( org.ovirt.engine.core.common.businessentities.VmType vmType ) { if ( basedOnCustomInstanceType ( ) ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( ( vmType == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) ) ; } getModel ( ) . getAllowConsoleReconnect ( ) . setEntity ( ( vmType == ( org.ovirt.engine.core.common.businessentities.VmType.Server ) ) ) ; }
Source:
public void SetDefaultNames4 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDataCenterListByName ( new org.ovirt.engine.ui.frontend.AsyncQuery ( null , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.dataCenterList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; SetDefaultNames5 ( ) ; } } , frontendHash ) , ( ( getCommonName ( ) ) + "*" ) ) ; }

Target:
public void setDefaultNames4 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDataCenterListByName ( new org.ovirt.engine.ui.frontend.AsyncQuery ( null , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.dataCenterList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; setDefaultNames5 ( ) ; } } , frontendHash ) , ( ( getCommonName ( ) ) + "*" ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.TagsVmPoolMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.TagsVmPoolMap entity = new org.ovirt.engine.core.common.businessentities.TagsVmPoolMap ( ) ; entity.settag_id ( getGuidDefaultEmpty ( rs , "tag_id" ) ) ; entity.setvm_pool_id ( getGuidDefaultEmpty ( rs , "vm_pool_id" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.TagsTemplateMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.TagsTemplateMap entity = new org.ovirt.engine.core.common.businessentities.TagsTemplateMap ( ) ; entity.settag_id ( getGuidDefaultEmpty ( rs , "tag_id" ) ) ; entity.settemplate_id ( getGuidDefaultEmpty ( rs , "vm_id" ) ) ; entity.setDefaultDisplayType ( ( ( java.lang.Integer ) ( rs.getObject ( "DefaultDisplayType" ) ) ) ) ; return entity ; }
Source:
public static void getDataCentersByStorageDomain ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getClusterDesktopMemoryOverCommit ( 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > mockVfsOnNetDevice ( int numOfVfs ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > vfs = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < numOfVfs ; ++ i ) { org.ovirt.engine.core.common.businessentities.HostDevice vfPciDevice = new org.ovirt.engine.core.common.businessentities.HostDevice ( ) ; vfPciDevice.setParentPhysicalFunction ( pciDevice.getDeviceName ( ) ) ; vfPciDevice.setDeviceName ( java.lang.String.valueOf ( i ) ) ; vfPciDevice.setHostId ( org.ovirt.engine.core.bll.network.host.HostNicVfsConfigHelperImplTest.HOST_ID ) ; vfs.add ( vfPciDevice ) ; } return vfs ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > mockVfsOnNetDevice ( int numOfVfs , org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > vfs = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < numOfVfs ; ++ i ) { org.ovirt.engine.core.common.businessentities.HostDevice vfPciDevice = new org.ovirt.engine.core.common.businessentities.HostDevice ( ) ; vfPciDevice.setParentPhysicalFunction ( pciDevice.getDeviceName ( ) ) ; vfPciDevice.setDeviceName ( java.lang.String.valueOf ( i ) ) ; vfPciDevice.setHostId ( org.ovirt.engine.core.bll.network.host.HostNicVfsConfigHelperImplTest.HOST_ID ) ; vfPciDevice.setVmId ( vmId ) ; vfs.add ( vfPciDevice ) ; } return vfs ; }
Source:
public void onResizeEnd ( com.google.gwt.user.cellview.client.Column < T , ? > column , com.google.gwt.dom.client.Element headerElement ) { headerElement.getStyle ( ) . clearBackgroundColor ( ) ; org.ovirt.engine.ui.common.widget.table.resize.ColumnResizeCellTable.redraw ( ) ; }

Target:
public void onResizeEnd ( com.google.gwt.user.cellview.client.Column < T , ? > column , com.google.gwt.dom.client.Element headerElement ) { headerElement.getStyle ( ) . clearBackgroundColor ( ) ; org.ovirt.engine.ui.common.widget.table.resize.ColumnResizeCellTable.redraw ( ) ; if ( columnResizePersistenceEnabled ) { java.lang.String width = getColumnWidth ( column ) ; saveColumnWidth ( column , width ) ; } }
Source:
protected void initSoundCard ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSoundcardEnabled ( 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 ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) , id ) ; }

Target:
protected void updateHostPinning ( org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport ) { java.util.List < org.ovirt.engine.core.common.businessentities.MigrationSupport > supportedModes = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.MigrationSupport > ) ( getModel ( ) . getMigrationMode ( ) . getItems ( ) ) ) ; if ( supportedModes.contains ( migrationSupport ) ) { getModel ( ) . getMigrationMode ( ) . setSelectedItem ( migrationSupport ) ; } }
Source:
public static void GetCustomPropertiesList ( 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.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
private void initCommand ( org.ovirt.engine.core.common.businessentities.OvfEntityData resultOvfEntityData ) { org.ovirt.engine.core.common.action.ImportVmParameters parameters = createParametersWhenImagesExistOnTargetStorageDomain ( ) ; initUnregisteredOVFData ( resultOvfEntityData ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand < org.ovirt.engine.core.common.action.ImportVmParameters > ( parameters ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override protected org.ovirt.engine.core.dao.UnregisteredOVFDataDAO getUnregisteredOVFDataDao ( ) { return unregisteredOVFDataDao ; } public org.ovirt.engine.core.common.businessentities.VDSGroup getVdsGroup ( ) { return vdsGroup ; } } ) ; mockStoragePool ( ) ; org.mockito.Mockito.doReturn ( storagePool ) . when ( cmd ) . getStoragePool ( ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImages ( ) { return java.util.Collections.emptyList ( ) ; }
Source:
private boolean containsWithItemsToIgnore ( java.lang.String pf ) { for ( java.lang.String item : itemsToIgnore ) { if ( pf.toUpperCase ( ) . contains ( ( ( org.ovirt.engine.ui.uicommonweb.StringConstants.SPACE ) + ( item.trim ( ) . toUpperCase ( ) ) ) ) ) { return true ; } } return false ; }

Target:
private boolean containsWithItemsToIgnore ( java.lang.String pf ) { for ( java.lang.String item : itemsToIgnore ) { if ( pf.toUpperCase ( ) . contains ( ( ( org.ovirt.engine.ui.uicommonweb.StringConstants.SPACE ) + ( item.trim ( ) . toUpperCase ( ) ) ) ) ) { for ( java.lang.String exception : exceptions ) { if ( pf.toUpperCase ( ) . contains ( exception ) ) { return false ; } } return true ; } } return false ; }
Source:
public synchronized org.ovirt.engine.sdk.decorators.DataCenterStorageDomainDisks getDisks ( ) { if ( ( this . dataCenterStorageDomainDisks ) == null ) { this . dataCenterStorageDomainDisks = new org.ovirt.engine.sdk.decorators.DataCenterStorageDomainDisks ( proxy , this ) ; } return dataCenterStorageDomainDisks ; }

Target:
public org.ovirt.engine.sdk.decorators.DataCenterStorageDomainDisks getDisks ( ) { if ( ( this . dataCenterStorageDomainDisks ) == null ) { synchronized ( this . LOCK ) { if ( ( this . dataCenterStorageDomainDisks ) == null ) { this . dataCenterStorageDomainDisks = new org.ovirt.engine.sdk.decorators.DataCenterStorageDomainDisks ( proxy , this ) ; } } } return dataCenterStorageDomainDisks ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) != null ) { } else { setItems ( null ) ; } }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterVolumeGeoRepStatusForMasterVolume ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > geoRepSessions = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ) ( returnValue ) ) ; java.util.Collections.sort ( geoRepSessions , new org.ovirt.engine.ui.uicommonweb.Linq.GlusterVolumeGeoRepSessionComparer ( ) ) ; setItems ( geoRepSessions ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
public void getDataCenterMaxNameLength ( 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 ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , 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.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getProviderStorageDomain ( ) { if ( ( storageDomain ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.getDbFacade ( ) . getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; storageDomain = storageDomains.get ( 0 ) ; } return storageDomain ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getProviderStorageDomain ( ) { if ( ( storageDomain ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.StorageDomainDao.class ) . getAllByConnectionId ( provider.getId ( ) ) ; storageDomain = storageDomains.get ( 0 ) ; } return storageDomain ; }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StorageDomainAccessError : org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.common.errors.VDSError tempVar = new org.ovirt.engine.core.common.errors.VDSError ( ) ; tempVar.setCode ( VdcBllErrors.StorageDomainAccessError ) ; tempVar.setMessage ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getReturnStatus ( ) . mMessage ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getVDSReturnValue ( ) . setVdsError ( tempVar ) ; break ; default : super . ProceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StorageDomainAccessError : org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.common.errors.VDSError tempVar = new org.ovirt.engine.core.common.errors.VDSError ( ) ; tempVar.setCode ( VdcBllErrors.StorageDomainAccessError ) ; tempVar.setMessage ( org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getReturnStatus ( ) . mMessage ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStoragePoolVDSCommand.getVDSReturnValue ( ) . setVdsError ( tempVar ) ; break ; default : super . proceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }
Source:
public void testGetEntityNameByIdAndTypeForStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = dbFacade.getStorageDomainDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( storageDomain ) ; java.lang.String name = storageDomain.getstorage_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID , VdcObjectType.Storage ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = dbFacade.getStorageDomainDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( storageDomain ) ; java.lang.String name = storageDomain.getStorageName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID , VdcObjectType.Storage ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.gluster.TransportType getRawValue ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity object ) { return org.ovirt.engine.core.common.businessentities.gluster.TransportType.TCP ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity object ) { java.lang.String transportTypes = "" ; java.util.Iterator < org.ovirt.engine.core.common.businessentities.gluster.TransportType > iterator = object.getTransportTypes ( ) . iterator ( ) ; while ( iterator.hasNext ( ) ) { org.ovirt.engine.core.common.businessentities.gluster.TransportType transportType = iterator.next ( ) ; if ( transportTypeTranslator.containsKey ( transportType ) ) { transportTypes += transportTypeTranslator.get ( transportType ) ; } else { transportTypes += transportType.toString ( ) ; } if ( iterator.hasNext ( ) ) { transportTypes += ", " ; } } return transportTypes ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn hotPlugNic ( java.util.Map info ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.hotplugNic" ) . withParameter ( "vmID" , getVmId ( info ) ) . withParameter ( "params" , info ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn cleanStorageDomainMetaData ( java.lang.String sdUUID , java.lang.String spUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.detach" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "force" , true ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
private void mockExistingIfacesWithBond ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifacesToBond ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > existingIfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ifacesToBond ) ; existingIfaces.add ( createVdsInterface ( bond.getName ( ) , true , null , null , null ) ) ; org.mockito.Mockito.when ( interfaceDAO.getAllInterfacesForVds ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( existingIfaces ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createNic ( java.lang.String nicName , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , nicName , false , null , null , networkName ) ; }
Source:
private boolean validateInputManagementNetwork ( ) { managementNetwork = getManagementNetworkById ( ) ; if ( ( managementNetwork ) == null ) { addCanDoActionMessage ( VdcBllMessages.NETWORK_NOT_EXISTS ) ; return false ; } final org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.networkBelongsToClusterDataCenter ( org.ovirt.engine.core.bll.AddVdsGroupCommand.getVdsGroup ( ) , managementNetwork ) ) ) && ( validate ( networkClusterValidator.managementNetworkRequired ( managementNetwork ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkNotExternal ( managementNetwork ) ) ) ; }

Target:
private boolean validateInputManagementNetwork ( ) { managementNetwork = getManagementNetworkById ( ) ; if ( ( managementNetwork ) == null ) { addCanDoActionMessage ( EngineMessage.NETWORK_NOT_EXISTS ) ; return false ; } final org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.networkBelongsToClusterDataCenter ( org.ovirt.engine.core.bll.AddVdsGroupCommand.getVdsGroup ( ) , managementNetwork ) ) ) && ( validate ( networkClusterValidator.managementNetworkRequired ( managementNetwork ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkNotExternal ( managementNetwork ) ) ) ; }
Source:
public void moveFloatingDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getMoveDiskParametersList ( ) . size ( ) ) ; }

Target:
public void liveMigrateDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.init ( ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getLiveMigrateVmDisksParametersList ( ) . size ( ) ) ; }
Source:
private void addOrUpdateServerHook ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > serverHooks , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VDS , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > pairResult ) { if ( ( getServerHookFromList ( serverHooks , pairResult.getFirst ( ) . getId ( ) ) ) == null ) { addServerHook ( pairResult.getFirst ( ) . getId ( ) ) ; } else { updateServerHookStatusInDb ( entity.getId ( ) , pairResult.getFirst ( ) . getId ( ) , getNewStatus ( ) ) ; } }

Target:
private void addOrUpdateServerHook ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > serverHooks , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VDS , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > pairResult ) { if ( ( getServerHookFromList ( serverHooks , pairResult.getFirst ( ) . getId ( ) ) ) == null ) { addServerHook ( pairResult.getFirst ( ) . getId ( ) ) ; } else { updateServerHookStatusInDb ( getGlusterHook ( ) . getId ( ) , pairResult.getFirst ( ) . getId ( ) , getNewStatus ( ) ) ; } }
Source:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.isVmReadyForUpgrade ( invalidVM ) ) . contains ( UPGRADE_ERROR.VM_NUMA_PINNED ) ; }

Target:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( UpgradeError.VM_NUMA_PINNED ) ; }
Source:
public boolean isCacheUpdateNeeded ( ) { int quotaCount = getQuotaDAO ( ) . getQuotaCount ( ) ; int cacheCount = 0 ; org.ovirt.engine.core.bll.quota.QuotaManager.lock.readLock ( ) . lock ( ) ; try { for ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.Quota > quotaMap : org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.values ( ) ) { cacheCount += quotaMap.size ( ) ; } } finally { org.ovirt.engine.core.bll.quota.QuotaManager.lock.readLock ( ) . unlock ( ) ; } return cacheCount < ( ( quotaCount * ( org.ovirt.engine.core.bll.quota.QuotaManager.MINIMUM_CACHE_FACTOR ) ) / 100 ) ; }

Target:
public boolean isCacheUpdateNeeded ( ) { int quotaCount = getQuotaDAO ( ) . getQuotaCount ( ) ; int cacheCount = 0 ; org.ovirt.engine.core.bll.quota.QuotaManager.lock.readLock ( ) . lock ( ) ; try { for ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.Quota > quotaMap : org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.values ( ) ) { cacheCount += quotaMap.size ( ) ; } } finally { org.ovirt.engine.core.bll.quota.QuotaManager.lock.readLock ( ) . unlock ( ) ; } return cacheCount < ( ( quotaCount * ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MinimumPercentageToUpdateQuotaCache ) ) ) / 100 ) ; }