auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.common.businessentities.VDSGroup get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_group_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeRead ( "GetVdsGroupByVdsGroupId" , org.ovirt.engine.core.dao.VdsGroupDaoImpl.VdsGroupRowMapper.instance , parameterSource ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.Cluster get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeRead ( "GetClusterByClusterId" , org.ovirt.engine.core.dao.ClusterDaoImpl.ClusterRowMapper.instance , parameterSource ) ; }
Source:
public void testGetStoragePoolIsoMap ( ) { org.ovirt.engine.core.common.businessentities.storage_pool_iso_map result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; assertNotNull ( result ) ; assertEquals ( existingStoragePoolIsoMap , result ) ; }

Target:
public void testGetStoragePoolIsoMap ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; assertNotNull ( result ) ; assertEquals ( existingStoragePoolIsoMap , result ) ; }
Source:
public void InitCdImage ( ) { updateUserCdImage ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getModel ( ) . getDataCenter ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; }

Target:
public void initCdImage ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( getModel ( ) . getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; if ( ( dataCenterWithCluster == null ) || ( ( dataCenterWithCluster.getDataCenter ( ) ) == null ) ) { return ; } updateUserCdImage ( dataCenterWithCluster.getDataCenter ( ) . getId ( ) ) ; }
Source:
private void logLowDiskSpaceOnHostDisks ( java.util.List < java.lang.String > disksWithLowSpace , final java.lang.Integer lowSpaceThreshold , org.ovirt.engine.core.common.AuditLogType logType ) { if ( ! ( disksWithLowSpace.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( _vds.getId ( ) ) ; logable.AddCustomValue ( "DiskSpace" , lowSpaceThreshold.toString ( ) ) ; logable.AddCustomValue ( "Disks" , org.apache.commons.lang.StringUtils.join ( disksWithLowSpace , ", " ) ) ; auditLog ( logable , logType ) ; } }

Target:
private void logLowDiskSpaceOnHostDisks ( java.util.List < java.lang.String > disksWithLowSpace , final java.lang.Integer lowSpaceThreshold , org.ovirt.engine.core.common.AuditLogType logType ) { if ( ! ( disksWithLowSpace.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( _vds.getId ( ) ) ; logable.addCustomValue ( "DiskSpace" , lowSpaceThreshold.toString ( ) ) ; logable.addCustomValue ( "Disks" , org.apache.commons.lang.StringUtils.join ( disksWithLowSpace , ", " ) ) ; auditLog ( logable , logType ) ; } }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByStoragePoolId , org.ovirt.engine.core.common.queries.StorageDomainAndPoolQueryParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public boolean canRunVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > messages ) { return validateVmProperties ( vm , messages ) ; }

Target:
public boolean canRunVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > messages , java.util.List < org.ovirt.engine.core.common.businessentities.Disk > vmDisks , org.ovirt.engine.core.common.businessentities.BootSequence bootSequence ) { if ( ! ( validateVmProperties ( vm , messages ) ) ) { return false ; } org.ovirt.engine.core.bll.ValidationResult result = validateBootSequence ( vm , bootSequence , vmDisks ) ; if ( ! ( result.isValid ( ) ) ) { messages.add ( result.getMessage ( ) . toString ( ) ) ; return false ; } return true ; }
Source:
public void testFetchGlobalQuotaUsageForGlobalCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( null , FixturesTool.QUOTA_GENERAL ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.Assert.assertEquals ( 1 , quotaClusterList.size ( ) ) ; org.junit.Assert.assertNotNull ( quotaCluster ) ; org.junit.Assert.assertTrue ( ( ( quotaCluster.getMemSizeMBUsage ( ) ) > 0 ) ) ; org.junit.Assert.assertEquals ( java.lang.Integer.valueOf ( 100 ) , quotaCluster.getVirtualCpu ( ) ) ; }

Target:
public void testFetchGlobalQuotaUsageForGlobalCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( null , FixturesTool.QUOTA_GENERAL ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , quotaClusterList.size ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( quotaCluster ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( quotaCluster.getMemSizeMBUsage ( ) ) > 0 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.lang.Integer.valueOf ( 100 ) , quotaCluster.getVirtualCpu ( ) ) ; }
Source:
private void init ( ) { org.ovirt.engine.core.bll.tasks.CommandCallbacksPoller.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; pollingRate = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AsyncCommandPollingLoopInSeconds ) ; initCommandExecutor ( ) ; executor.scheduleWithFixedDelay ( this :: invokeCallbackMethods , pollingRate , pollingRate , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.core.bll.tasks.CommandCallbacksPoller.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; }

Target:
private void init ( ) { org.ovirt.engine.core.bll.tasks.CommandCallbacksPoller.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; pollingRate = org.ovirt.engine.core.common.config.Config.< java.lang.Long > getValue ( ConfigValues.AsyncCommandPollingLoopInSeconds ) ; initCommandExecutor ( ) ; executor.scheduleWithFixedDelay ( this :: invokeCallbackMethods , pollingRate , pollingRate , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.core.bll.tasks.CommandCallbacksPoller.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( getParameters ( ) . getBricks ( ) . isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED ) ; } if ( ( ! ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskOfType ( volume , GlusterTaskType.REMOVE_BRICK ) ) ) || ( ! ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskStatus ( volume , JobExecutionStatus.FINISHED ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_FINISHED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( getParameters ( ) . getBricks ( ) . isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED ) ; } if ( ( ! ( getGlusterTaskUtils ( ) . isTaskOfType ( volume , GlusterTaskType.REMOVE_BRICK ) ) ) || ( ! ( getGlusterTaskUtils ( ) . isTaskStatus ( volume , JobExecutionStatus.FINISHED ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_FINISHED ) ; } return true ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostExternalNetworkProviderConfigurationResourceTest.PROVIDER_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostExternalNetworkProviderConfigurationResourceTest.PROVIDER_ID } , java.util.Collections.emptyList ( ) ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.resource.get ( ) ) ) ; }
Source:
public boolean existsVmDeviceByVmIdAndType ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) . addValue ( "type" , type.getValue ( ) ) ; return getCallsHandler ( ) . executeRead ( "ExistsVmDeviceByVmIdAndType" , createBooleanMapper ( ) , parameterSource ) ; }

Target:
public boolean existsVmDeviceByVmIdAndType ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) . addValue ( "type" , type.getValue ( ) ) ; return getCallsHandler ( ) . executeRead ( "ExistsVmDeviceByVmIdAndType" , org.springframework.jdbc.core.SingleColumnRowMapper.newInstance ( java.lang.Boolean.class ) , parameterSource ) ; }
Source:
protected boolean canDoAction ( ) { if ( getParameters ( ) . getPubKeys ( ) . isEmpty ( ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_NO_PUB_KEYS_PASSED ) ; } if ( ( getParameters ( ) . getId ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean validate ( ) { if ( getParameters ( ) . getPubKeys ( ) . isEmpty ( ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_NO_PUB_KEYS_PASSED ) ; } if ( ( getParameters ( ) . getId ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; } return super . validate ( ) ; }
Source:
private void addInlineDisks ( org.ovirt.engine.api.model.VM vm ) { org.ovirt.engine.api.restapi.resource.BackendVmDisksResource disksResource = inject ( new org.ovirt.engine.api.restapi.resource.BackendVmDisksResource ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( vm.getId ( ) ) , org.ovirt.engine.core.common.queries.VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( vm.getId ( ) ) ) ) ) ; org.ovirt.engine.api.model.Disks disks = disksResource.list ( ) ; vm.setDisks ( disks ) ; }

Target:
private void addInlineDisks ( org.ovirt.engine.api.model.Vm vm ) { org.ovirt.engine.api.restapi.resource.BackendVmDisksResource disksResource = inject ( new org.ovirt.engine.api.restapi.resource.BackendVmDisksResource ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( vm.getId ( ) ) , org.ovirt.engine.core.common.queries.VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( vm.getId ( ) ) ) ) ) ; org.ovirt.engine.api.model.Disks disks = disksResource.list ( ) ; vm.setDisks ( disks ) ; }
Source:
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.gluster.GlusterVolumeOptionInfo > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ) ; }

Target:
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.gluster.GlusterVolumeOptionInfo > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ) ( source ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo cifsOption = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ( ) ; cifsOption.setKey ( "user.cifs" ) ; list.add ( cifsOption ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ) ; }
Source:
public void reportCompleted ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean success = ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAndPause ( ) ) ) && ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , success ) ; }

Target:
protected void endExecutionMonitoring ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean runAndPausedSucceeded = ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAndPause ( ) ) ) && ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , runAndPausedSucceeded ) ; }
Source:
public void setManagement ( boolean management ) { this . management = management ; }

Target:
public void setDisplayNetwork ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model , boolean value ) { if ( ! ( isMultiDisplay ( ) ) ) { if ( ( getDisplayNetwork ( ) ) != null ) { getDisplayNetwork ( ) . setDisplayNetwork ( ( ! value ) ) ; } } model.setDisplayNetwork ( value ) ; }
Source:
public static void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }

Target:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
public void canAddVm ( ) { java.util.List < java.lang.String > reasons = new java.util.ArrayList < > ( ) ; initCommandMethods ( ) ; cmd.init ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) , org.mockito.ArgumentMatchers.anyListOf ( java.lang.String.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateSpaceRequirements ( ) ; org.junit.Assert.assertTrue ( "vm could not be added" , cmd.canAddVm ( reasons , java.util.Collections.singletonList ( createStorageDomain ( ) ) ) ) ; }

Target:
public void canAddVm ( ) { java.util.List < java.lang.String > reasons = new java.util.ArrayList < > ( ) ; initCommandMethods ( ) ; cmd.init ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateSpaceRequirements ( ) ; org.junit.Assert.assertTrue ( "vm could not be added" , cmd.canAddVm ( reasons , java.util.Collections.singletonList ( createStorageDomain ( ) ) ) ) ; }
Source:
private void MigrationMode_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) == ( getMigrationMode ( ) . getSelectedItem ( ) ) ) { getHostCpu ( ) . setIsChangable ( true ) ; } else { getHostCpu ( ) . setEntity ( false ) ; getHostCpu ( ) . setIsChangable ( false ) ; } behavior.updateCpuPinningVisibility ( ) ; }

Target:
private void provisioning_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.provisioning_SelectedItemChanged ( ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { unlimitedMemRadioButtonEditor.setLabel ( constants.ultQuotaPopup ( ) ) ; specificMemRadioButtonEditor.setLabel ( constants.useQuotaPopup ( ) ) ; unlimitedCpuRadioButtonEditor.setLabel ( constants.ultQuotaPopup ( ) ) ; specificCpuRadioButtonEditor.setLabel ( constants.useQuotaPopup ( ) ) ; memLabel.setText ( constants.memQuotaPopup ( ) ) ; cpuLabel.setText ( constants.cpuQuotaPopup ( ) ) ; }

Target:
void localize ( ) { unlimitedMemRadioButtonEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.EditQuotaClusterPopupView.constants.ultQuotaPopup ( ) ) ; specificMemRadioButtonEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.EditQuotaClusterPopupView.constants.useQuotaPopup ( ) ) ; unlimitedCpuRadioButtonEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.EditQuotaClusterPopupView.constants.ultQuotaPopup ( ) ) ; specificCpuRadioButtonEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.EditQuotaClusterPopupView.constants.useQuotaPopup ( ) ) ; memLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.EditQuotaClusterPopupView.constants.memQuotaPopup ( ) ) ; cpuLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.EditQuotaClusterPopupView.constants.cpuQuotaPopup ( ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetGroupExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.EditAffinityGroup , org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetGroupExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.EditAffinityGroup , org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private void mockOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.mockito.Mockito.when ( osRepository.get64bitOss ( ) ) . thenReturn ( new java.util.ArrayList < java.lang.Integer > ( ) { { add ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS ) ; } } ) ; org.mockito.Mockito.when ( runVmValidator.getOsRepository ( ) ) . thenReturn ( osRepository ) ; }

Target:
private void mockOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.mockito.Mockito.when ( osRepository.get64bitOss ( ) ) . thenReturn ( new java.util.ArrayList < java.lang.Integer > ( ) { { add ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS ) ; } } ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }
Source:
public void init ( ) throws java.lang.Exception { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "Entry" ) ; globals.put ( org.ovirt.engineextensions.aaa.ldap.Framework.VARS_STOP , "false" ) ; for ( org.ovirt.engineextensions.aaa.ldap.MapProperties init : props.get ( "sequence-init" ) . getOrEmpty ( ) . getOrEmpty ( "init" ) . getMap ( ) . values ( ) ) { runSequence ( init.getValue ( ) , globals ) ; } globals.put ( org.ovirt.engineextensions.aaa.ldap.Framework.VARS_STOP , "false" ) ; org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "Return globals={}" , globals ) ; }

Target:
public void init ( ) throws java.lang.Exception { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "init Entry" ) ; globals.put ( org.ovirt.engineextensions.aaa.ldap.Framework.VARS_STOP , "false" ) ; for ( org.ovirt.engineextensions.aaa.ldap.MapProperties init : props.get ( "sequence-init" ) . getOrEmpty ( ) . getOrEmpty ( "init" ) . getMap ( ) . values ( ) ) { runSequence ( init.getValue ( ) , globals ) ; } globals.put ( org.ovirt.engineextensions.aaa.ldap.Framework.VARS_STOP , "false" ) ; org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "init Return globals={}" , globals ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extend_image_ticket ( java.lang.String ticketId , long timeout ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.extend_image_ticket" ) . withParameter ( "uuid" , ticketId ) . withParameter ( "timeout" , timeout ) . 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.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn extend_image_ticket ( java.lang.String ticketId , long timeout ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.extend_image_ticket" ) . withParameter ( "uuid" , ticketId ) . withParameter ( "timeout" , timeout ) . 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:
public void testSave ( ) { dao.save ( vnicProfile ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( vnicProfile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( vnicProfile.getId ( ) , result.getId ( ) ) ; org.junit.Assert.assertEquals ( false , result.isPortMirroring ( ) ) ; }

Target:
public void testSave ( ) { dao.save ( vnicProfile ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( vnicProfile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( vnicProfile.getId ( ) , result.getId ( ) ) ; org.junit.Assert.assertEquals ( false , result.isPortMirroring ( ) ) ; org.junit.Assert.assertFalse ( result.isPassthrough ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > > toWeirdPair ( final org.ovirt.engine.core.common.businessentities.VdsNumaNode vdsNumaNode ) { return new org.ovirt.engine.core.common.utils.Pair ( vdsNumaNode.getId ( ) , new org.ovirt.engine.core.common.utils.Pair ( true , vdsNumaNode.getIndex ( ) ) ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmNumaNode createVmNumaNode ( int index , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > vdsNumaNodes ) { org.ovirt.engine.core.common.businessentities.VmNumaNode numaNode = org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( index ) ; final java.util.List < java.lang.Integer > numaPinning = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode vdsNumaNode : vdsNumaNodes ) { numaPinning.add ( vdsNumaNode.getIndex ( ) ) ; } numaNode.setVdsNumaNodeList ( numaPinning ) ; return numaNode ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( T object ) { if ( ! ( canEdit ( object ) ) ) { java.lang.String disabledMessage = getDisabledMessage ( object ) ; if ( ( disabledMessage != null ) && ( ! ( disabledMessage.isEmpty ( ) ) ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( disabledMessage ) ; } } return null ; }

Target:
public java.lang.String getTooltip ( T object ) { if ( ! ( canEdit ( object ) ) ) { java.lang.String disabledMessage = getDisabledMessage ( object ) ; if ( ( disabledMessage != null ) && ( ! ( disabledMessage.isEmpty ( ) ) ) ) { return disabledMessage ; } } return "" ; }
Source:
public static void setupMemoryBalloon ( org.ovirt.engine.api.model.VmBase vmBase , org.ovirt.engine.api.restapi.resource.BackendResource parentResource ) { java.lang.Boolean balloonEnabled = parentResource.getEntity ( java.lang.Boolean.class , VdcQueryType.IsBalloonEnabled , new org.ovirt.engine.core.common.queries.IdQueryParameters ( new org.ovirt.engine.core.compat.Guid ( vmBase.getId ( ) ) ) , null , true ) ; if ( ! ( vmBase.isSetMemoryPolicy ( ) ) ) { vmBase.setMemoryPolicy ( new org.ovirt.engine.api.model.MemoryPolicy ( ) ) ; } vmBase.getMemoryPolicy ( ) . setBallooning ( balloonEnabled ) ; }

Target:
public static void setupMemoryBalloon ( org.ovirt.engine.api.model.VmBase vmBase , org.ovirt.engine.api.restapi.resource.BackendResource parentResource ) { java.lang.Boolean balloonEnabled = parentResource.getEntity ( java.lang.Boolean.class , QueryType.IsBalloonEnabled , new org.ovirt.engine.core.common.queries.IdQueryParameters ( new org.ovirt.engine.core.compat.Guid ( vmBase.getId ( ) ) ) , null , true ) ; if ( ! ( vmBase.isSetMemoryPolicy ( ) ) ) { vmBase.setMemoryPolicy ( new org.ovirt.engine.api.model.MemoryPolicy ( ) ) ; } vmBase.getMemoryPolicy ( ) . setBallooning ( balloonEnabled ) ; }
Source:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.VDS host , org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . vdsNonOperational ( host.getId ( ) , reason , true , Guid.Empty , customLogValues ) ; }

Target:
private void persistTopology ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( interfaceDao , host.getInterfaces ( ) , dbNics , userConfiguredData ) ; networkInterfacesPersister.persistTopology ( ) ; final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister networkAttachmentPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister ( networkAttachmentDao , host.getId ( ) , host.getInterfaces ( ) , userConfiguredData.getNetworkAttachments ( ) , clusterNetworks ) ; networkAttachmentPersister.persistNetworkAttachments ( ) ; }
Source:
private void doTestGetNotFound ( java.lang.String id ) { org.ovirt.engine.api.restapi.resource.BackendPermitResource resource = new org.ovirt.engine.api.restapi.resource.BackendPermitResource ( id , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID ) ) ; resource.getParent ( ) . setMappingLocator ( mapperLocator ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
private void doTestGetNotFound ( java.lang.String id ) { org.ovirt.engine.api.restapi.resource.BackendPermitResource resource = new org.ovirt.engine.api.restapi.resource.BackendPermitResource ( id , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID ) ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: get ) ) ; }
Source:
protected void buildChildCommandInfos ( ) { org.ovirt.engine.core.compat.Guid vmSnapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : mImages ) { addChildCommandInfo ( diskImage.getImageId ( ) , VdcActionType.CreateImageTemplate , buildChildCommandParameters ( diskImage , vmSnapshotId ) ) ; } }

Target:
private org.ovirt.engine.core.common.action.CloneCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks , org.ovirt.engine.core.compat.Guid vmSnapshotId ) { org.ovirt.engine.core.common.action.CloneCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.CloneCinderDisksParameters ( cinderDisks , vmSnapshotId , diskInfoDestinationMap ) ; createParams.setParentHasTasks ( ( ! ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) ) ) ; return withRootCommandInfo ( createParams , org.ovirt.engine.core.bll.AddVmTemplateCommand.getActionType ( ) ) ; }
Source:
public boolean exists ( org.ovirt.engine.core.compat.Guid id ) { return getCallsHandler ( ) . executeRead ( "IsVmIconExist" , new org.springframework.jdbc.core.RowMapper < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { return rs.getBoolean ( 1 ) ; } } , getCustomMapSqlParameterSource ( ) . addValue ( org.ovirt.engine.core.dao.VmIconDaoImpl.ID_COLUMN , id ) ) ; }

Target:
public boolean exists ( org.ovirt.engine.core.compat.Guid id ) { return getCallsHandler ( ) . executeRead ( "IsVmIconExist" , org.springframework.jdbc.core.SingleColumnRowMapper.newInstance ( java.lang.Boolean.class ) , getCustomMapSqlParameterSource ( ) . addValue ( org.ovirt.engine.core.dao.VmIconDaoImpl.ID_COLUMN , id ) ) ; }
Source:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServer newEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ( ) ; newEntity.setId ( org.ovirt.engine.core.dao.gluster.GlusterServerDaoTest.SERVER_ID2 ) ; newEntity.setGlusterServerUuid ( FixturesTool.GLUSTER_SERVER_UUID2 ) ; newEntity.setPeerStatus ( PeerStatus.CONNECTED ) ; dao.save ( newEntity ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = dao.getByServerId ( newEntity.getId ( ) ) ; org.junit.Assert.assertEquals ( newEntity , entity ) ; }

Target:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServer newEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ( ) ; newEntity.setId ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newEntity.setGlusterServerUuid ( FixturesTool.GLUSTER_SERVER_UUID2 ) ; newEntity.setPeerStatus ( PeerStatus.CONNECTED ) ; dao.save ( newEntity ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = dao.getByServerId ( newEntity.getId ( ) ) ; org.junit.Assert.assertEquals ( newEntity , entity ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( storagePoolId ) ; return org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( domainsInPool , disksList ) ; }

Target:
public static boolean isVmWithSameNameExistStatic ( java.lang.String vmName , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( vmName ) ; params.setDatacenterId ( storagePoolId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( VdcQueryType.IsVmWithSameNameExist , params ) ; return ( ( java.lang.Boolean ) ( result.getReturnValue ( ) ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( getGlusterTaskUtils ( ) . isTaskOfType ( glusterVolume , GlusterTaskType.REBALANCE ) ) ) || ( ! ( getGlusterTaskUtils ( ) . isTaskStatus ( glusterVolume , JobExecutionStatus.STARTED ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( getGlusterTaskUtils ( ) . isTaskOfType ( glusterVolume , GlusterTaskType.REBALANCE ) ) ) || ( ! ( getGlusterTaskUtils ( ) . isTaskStatus ( glusterVolume , JobExecutionStatus.STARTED ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED ) ; } return true ; }
Source:
public void initCdImage ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithClusterEntityModel dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithClusterEntityModel ) ( getModel ( ) . getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; updateUserCdImage ( dataCenterWithCluster.getDataCenter ( ) . getId ( ) ) ; }

Target:
public void initCdImage ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( getModel ( ) . getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; if ( ( dataCenterWithCluster == null ) || ( ( dataCenterWithCluster.getDataCenter ( ) ) == null ) ) { return ; } updateUserCdImage ( dataCenterWithCluster.getDataCenter ( ) . getId ( ) ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . setDiskProfileId ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getDiskProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . setDiskProfileId ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getDiskProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getCurrentUser ( ) ) ) ; }
Source:
private static java.lang.Double AssignDoubleValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { java.lang.Object value = input.get ( name ) ; if ( value instanceof java.lang.Double ) { return ( ( java.lang.Double ) ( value ) ) ; } else if ( value instanceof java.lang.String ) { return java.lang.Double.parseDouble ( ( ( java.lang.String ) ( value ) ) ) ; } return null ; }

Target:
private static java.lang.Double assignDoubleValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { java.lang.Object value = input.get ( name ) ; if ( value instanceof java.lang.Double ) { return ( ( java.lang.Double ) ( value ) ) ; } else if ( value instanceof java.lang.String ) { return java.lang.Double.parseDouble ( ( ( java.lang.String ) ( value ) ) ) ; } return null ; }
Source:
public void testVirtIsMonitoringNeeded ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setstatus ( VDSStatus.NonOperational ) ; vds.setvm_count ( 1 ) ; org.junit.Assert.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; vds.setvm_count ( 0 ) ; org.junit.Assert.assertFalse ( virtStrategy.isMonitoringNeeded ( vds ) ) ; vds.setstatus ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; }

Target:
public void testVirtIsMonitoringNeeded ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.NonOperational ) ; vds.setVmCount ( 1 ) ; org.junit.Assert.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; vds.setVmCount ( 0 ) ; org.junit.Assert.assertFalse ( virtStrategy.isMonitoringNeeded ( vds ) ) ; vds.setStatus ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ev.equals ( spiceVersionFileFetchedEvent_Definition ) ) { org.ovirt.engine.core.compat.Version spiceVersion = parseVersion ( ( ( org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs ) ( args ) ) . getFileContent ( ) ) ; setSpiceVersion ( spiceVersion ) ; } else if ( ev.equals ( documentationFileFetchedEvent_Definition ) ) { java.lang.String documentationPathFileContent = ( ( org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs ) ( args ) ) . getFileContent ( ) ; org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.init ( documentationPathFileContent ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ev.matchesDefinition ( spiceVersionFileFetchedEvent_Definition ) ) { org.ovirt.engine.core.compat.Version spiceVersion = parseVersion ( ( ( org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs ) ( args ) ) . getFileContent ( ) ) ; setSpiceVersion ( spiceVersion ) ; } else if ( ev.matchesDefinition ( documentationFileFetchedEvent_Definition ) ) { java.lang.String documentationPathFileContent = ( ( org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs ) ( args ) ) . getFileContent ( ) ; org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.init ( documentationPathFileContent ) ; } }
Source:
public void testImportWithStorageDomainName ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 2 ] } , getStorageDomainStatic ( 2 ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setName ( NAMES [ 2 ] ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; doTestImport ( storageDomain , cluster , false ) ; }

Target:
public void testImportWithStorageDomainName ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 2 ] } , getStorageDomainStatic ( 2 ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setName ( NAMES [ 2 ] ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; doTestImport ( storageDomain , cluster , false ) ; }
Source:
public void postOnSetupNetworks ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters hostSetupNetworksParameters = createHostSetupNetworksParameters ( ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction setupNetworksAction = new org.ovirt.engine.ui.uicommonweb.action.UiVdcAction ( org.ovirt.engine.core.common.action.VdcActionType.HostSetupNetworks , hostSetupNetworksParameters , this , true ) ; setupNetworksAction.then ( getVfsConfigAction ( ) ) . then ( getCommitNetworkChangesAction ( ) ) . onAllExecutionsFinish ( getCloseAction ( ) ) ; setupNetworksAction.runAction ( ) ; }

Target:
public void postOnSetupNetworks ( ) { org.ovirt.engine.ui.uicommonweb.action.UiAction setupNetworksAction = createSetupNetworksAction ( ) ; setupNetworksAction.then ( getVfsConfigAction ( ) ) . then ( getCommitNetworkChangesAction ( ) ) . onAllExecutionsFinish ( getCloseAction ( ) ) ; setupNetworksAction.runAction ( ) ; }