auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue handleVdsResult ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue result ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( result.getExceptionString ( ) ) ) ) { org.ovirt.engine.core.common.errors.VdcBLLException exp ; if ( ( result.getVdsError ( ) ) != null ) { exp = new org.ovirt.engine.core.common.errors.VdcBLLException ( result.getVdsError ( ) . getCode ( ) , result.getExceptionString ( ) ) ; } else { exp = new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.ENGINE , result.getExceptionString ( ) ) ; } throw exp ; } return result ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue handleVdsResult ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue result ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( result.getExceptionString ( ) ) ) { org.ovirt.engine.core.common.errors.VdcBLLException exp ; if ( ( result.getVdsError ( ) ) != null ) { exp = new org.ovirt.engine.core.common.errors.VdcBLLException ( result.getVdsError ( ) . getCode ( ) , result.getExceptionString ( ) ) ; } else { exp = new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.ENGINE , result.getExceptionString ( ) ) ; } throw exp ; } return result ; }
Source:
public void twoArgsWithSameShortName ( ) { org.ovirt.engine.core.uutils.cli.ExtendedCliParser parser = new org.ovirt.engine.core.uutils.cli.ExtendedCliParser ( ) ; parser.addArg ( new org.ovirt.engine.core.uutils.cli.ArgumentBuilder ( ) . shortName ( "-a" ) . longName ( "--aa" ) . valueRequied ( true ) . build ( ) ) ; parser.addArg ( new org.ovirt.engine.core.uutils.cli.ArgumentBuilder ( ) . shortName ( "-a" ) . longName ( "--bb" ) . valueRequied ( true ) . build ( ) ) ; }

Target:
public void twoArgsWithSameShortName ( ) { org.ovirt.engine.core.uutils.cli.ExtendedCliParser parser = new org.ovirt.engine.core.uutils.cli.ExtendedCliParser ( ) ; parser.addArg ( new org.ovirt.engine.core.uutils.cli.ArgumentBuilder ( ) . shortName ( "-a" ) . longName ( "--aa" ) . valueRequired ( true ) . build ( ) ) ; parser.addArg ( new org.ovirt.engine.core.uutils.cli.ArgumentBuilder ( ) . shortName ( "-a" ) . longName ( "--bb" ) . valueRequired ( true ) . build ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , vm.getVdsGroupId ( ) . getValue ( ) ) ; initTemplate ( ) ; initCdImage ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , vm.getVdsGroupId ( ) . getValue ( ) ) ; initTemplate ( ) ; initCdImage ( ) ; initSoundCard ( vm.getId ( ) ) ; }
Source:
protected boolean containsDefaultCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = getVdsGroupDao ( ) . getAllForStoragePool ( storagePool.getId ( ) ) ; boolean hasDefaultCluster = false ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.getId ( ) . equals ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.AutoRegistrationDefaultVdsGroupID ) ) ) { hasDefaultCluster = true ; break ; } } return hasDefaultCluster ; }

Target:
protected boolean containsDefaultCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = getClusterDao ( ) . getAllForStoragePool ( storagePool.getId ( ) ) ; boolean hasDefaultCluster = false ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : clusters ) { if ( cluster.getId ( ) . equals ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.AutoRegistrationDefaultClusterID ) ) ) { hasDefaultCluster = true ; break ; } } return hasDefaultCluster ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.gluster.StorageDevice object ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > convertedSize = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( object.getSize ( ) , SizeUnit.MB ) ; return ( ( formatSize ( convertedSize.getSecond ( ) ) ) + " " ) + ( convertedSize.getFirst ( ) . toString ( ) ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.gluster.StorageDevice object ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > convertedSize = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( object.getSize ( ) , SizeUnit.MiB ) ; return ( ( formatSize ( convertedSize.getSecond ( ) ) ) + " " ) + ( convertedSize.getFirst ( ) . toString ( ) ) ; }
Source:
private void initVmDiskImage ( boolean isShareable ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.VM ) ; diskImage.setShareable ( isShareable ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }

Target:
private void initVmDiskImage ( boolean isShareable ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.VM ) ; diskImage.setShareable ( isShareable ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Network > getAllForDataCenter ( org.ovirt.engine.core.compat.Guid id ) { return getCallsHandler ( ) . executeReadList ( "GetAllNetworkByStoragePoolId" , org.ovirt.engine.core.dao.NetworkDAODbFacadeImpl.NetworkRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Network > getAllForDataCenter ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return getCallsHandler ( ) . executeReadList ( "GetAllNetworkByStoragePoolId" , org.ovirt.engine.core.dao.NetworkDAODbFacadeImpl.NetworkRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ) ; }
Source:
public void testPositiveCanDoActionWithDisks ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testPositiveCanDoActionWithDisks ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }
Source:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Event model , int index ) { org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( model.getId ( ) , java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; org.junit.Assert.assertEquals ( LogSeverity.ALERT , model.getSeverity ( ) ) ; org.junit.Assert.assertEquals ( model.getDescription ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; org.junit.Assert.assertEquals ( model.getOrigin ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; org.junit.Assert.assertEquals ( model.getCustomId ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Event model , int index ) { org.junit.jupiter.api.Assertions.assertNotNull ( model ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getId ( ) , java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( LogSeverity.ALERT , model.getSeverity ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getDescription ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getOrigin ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getCustomId ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; }
Source:
public static boolean isPrestartedVmForAssignment ( org.ovirt.engine.core.compat.Guid vm_guid ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . get ( vm_guid ) ; if ( ( ( vmDynamic != null ) && ( ( vmDynamic.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.CanAttachPrestartedVmToUser ( vm_guid ) ) ) { return true ; } else { return false ; } }

Target:
public static boolean isPrestartedVmForAssignment ( org.ovirt.engine.core.compat.Guid vm_guid ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . get ( vm_guid ) ; if ( ( ( vmDynamic != null ) && ( ( vmDynamic.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( vm_guid ) ) ) { return true ; } else { return false ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolIsoMapDao ( ) ; storagePoolIsoMapDao = dbFacade.getStoragePoolDao ( ) ; existingPool = storagePoolIsoMapDao.get ( FixturesTool.DATA_CENTER ) ; existingStoragePoolIsoMap = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , existingPool.getId ( ) ) ) ; newStoragePoolIsoMap = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( org.ovirt.engine.core.dao.StoragePoolIsoMapDaoTest.FREE_ISO_ID , existingPool.getId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unattached ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolIsoMapDao ( ) ; storagePoolIsoMapDao = dbFacade.getStoragePoolDao ( ) ; existingPool = storagePoolIsoMapDao.get ( FixturesTool.DATA_CENTER ) ; existingStoragePoolIsoMap = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , existingPool.getId ( ) ) ) ; newStoragePoolIsoMap = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( FixturesTool.STORAGE_DOMAIN_SCALE_SD6 , existingPool.getId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unattached ) ; }
Source:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools ) { postShowWarningOnExistingVms ( model , storagePools , getVmOrTemplateQuery ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel exportVmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( array [ 1 ] ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; vmListModel.postShowWarningOnExistingVms ( exportVmModel , storagePools , getVmOrTemplateQuery ) ; }
Source:
public void parseInvalidString ( ) { java.lang.String [ ] invalidValues = new java.lang.String [ ] { "clust" , "clust,dc" , "cluster,d" , "cluster, dc" } ; for ( java.lang.String invalidValue : invalidValues ) { try { org.ovirt.engine.core.common.utils.pm.FenceProxySourceTypeHelper.parseFromString ( invalidValue ) ; org.junit.Assert.fail ( java.lang.String.format ( "Value '%s' is not valid argument of FenceProxySourceTypeHelper.parseFromString." , invalidValue ) ) ; } catch ( java.lang.IllegalArgumentException ignore ) { } } }

Target:
public void parseInvalidString ( ) { java.lang.String [ ] invalidValues = new java.lang.String [ ] { "clust" , "clust,dc" , "cluster,d" , "cluster, dc" } ; for ( java.lang.String invalidValue : invalidValues ) { try { org.ovirt.engine.core.common.utils.pm.FenceProxySourceTypeHelper.parseFromString ( invalidValue ) ; org.junit.jupiter.api.Assertions.fail ( java.lang.String.format ( "Value '%s' is not valid argument of FenceProxySourceTypeHelper.parseFromString." , invalidValue ) ) ; } catch ( java.lang.IllegalArgumentException ignore ) { } } }
Source:
private void refreshClusterData ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { log.debugFormat ( "Refreshing Gluster lightweight Data for cluster {0}" , cluster.getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers = getVdsDao ( ) . getAllForVdsGroup ( cluster.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS upServer = getClusterUtils ( ) . getUpServer ( cluster.getId ( ) ) ; if ( upServer == null ) { log.debugFormat ( "No server UP in cluster {0}. Can't refresh it's data at this point." , cluster.getName ( ) ) ; return ; } refreshServerData ( cluster , upServer , existingServers ) ; refreshVolumeData ( cluster , upServer , existingServers ) ; }

Target:
private void refreshClusterData ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { log.debug ( "Refreshing Gluster lightweight Data for cluster '{}'" , cluster.getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers = getVdsDao ( ) . getAllForVdsGroup ( cluster.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS upServer = getClusterUtils ( ) . getUpServer ( cluster.getId ( ) ) ; if ( upServer == null ) { log.debug ( "No server UP in cluster '{}'. Can't refresh it's data at this point." , cluster.getName ( ) ) ; return ; } refreshServerData ( cluster , upServer , existingServers ) ; refreshVolumeData ( cluster , upServer , existingServers ) ; }
Source:
private void initCommandExecutor ( ) { if ( ! ( cmdExecutorInitialized ) ) { for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity : coco.getCommandsWithCallBackEnabled ( ) ) { switch ( cmdEntity.getCommandStatus ( ) ) { case ACTIVE_SYNC : case ACTIVE_ASYNC : case NOT_STARTED : coco.retrieveCommand ( cmdEntity.getId ( ) ) . setCommandStatus ( CommandStatus.FAILED_RESTARTED ) ; break ; default : if ( ! ( cmdEntity.isCallBackNotified ( ) ) ) { addToCallBackMap ( cmdEntity ) ; } break ; } } cmdExecutorInitialized = true ; } }

Target:
private void initCommandExecutor ( ) { if ( ! ( cmdExecutorInitialized ) ) { for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity : coco.getCommandsWithCallBackEnabled ( ) ) { if ( ! ( cmdEntity.isExecuted ( ) ) ) { coco.retrieveCommand ( cmdEntity.getId ( ) ) . setCommandStatus ( CommandStatus.FAILED_RESTARTED ) ; } else if ( ! ( cmdEntity.isCallBackNotified ( ) ) ) { addToCallBackMap ( cmdEntity ) ; } } cmdExecutorInitialized = true ; } }
Source:
public void validCustomDevPropSpec ( ) { java.lang.String customDevPropSpec = "{type=disk;prop={bootable=^(true|false)$}};" + ( ( ( ( ( ( ( ( "{type=interface;prop={speed=[0-9]{1,5};duplex=^(full|half)$;debug=([a-z0-9A-Z]*)$}};" + "{type=video;prop={turned_on=^(true|false)$}};" ) + "{type=sound;prop={volume=[0-9]{1,2}}};" ) + "{type=controller;prop={hotplug=^(true|false)$}};" ) + "{type=balloon;prop={max_size=[0-9]{1,15}}};" ) + "{type=channel;prop={auth_type=^(plain|md5|kerberos)$}};" ) + "{type=redir;prop={max_len=[0-9]{1,15}}};" ) + "{type=console;prop={type=^(text|vnc)$}};" ) + "{type=smartcard;prop={version=([1-9]{1}).([0-9]{1})}}" ) ; org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils utils = org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils.getInstance ( ) ; org.junit.Assert.assertTrue ( utils.isDevicePropertiesDefinitionValid ( customDevPropSpec ) ) ; }

Target:
public void validCustomDevPropSpec ( ) { java.lang.String customDevPropSpec = "{type=disk;prop={bootable=^(true|false)$}};" + ( ( ( ( ( ( ( ( "{type=interface;prop={speed=[0-9]{1,5};duplex=^(full|half)$;debug=([a-z0-9A-Z]*)$}};" + "{type=video;prop={turned_on=^(true|false)$}};" ) + "{type=sound;prop={volume=[0-9]{1,2}}};" ) + "{type=controller;prop={hotplug=^(true|false)$}};" ) + "{type=balloon;prop={max_size=[0-9]{1,15}}};" ) + "{type=channel;prop={auth_type=^(plain|md5|kerberos)$}};" ) + "{type=redir;prop={max_len=[0-9]{1,15}}};" ) + "{type=console;prop={type=^(text|vnc)$}};" ) + "{type=smartcard;prop={version=([1-9]{1}).([0-9]{1})}}" ) ; org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils utils = org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils.getInstance ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( utils.isDevicePropertiesDefinitionValid ( customDevPropSpec ) ) ; }
Source:
private void runHttpMethod ( org.apache.commons.httpclient.HttpClient httpClient , org.apache.commons.httpclient.HttpMethod httpMethod ) { try { int result = httpClient.executeMethod ( httpMethod ) ; if ( result != ( java.net.HttpURLConnection.HTTP_OK ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.PROVIDER_FAILURE ) ; } } catch ( org.apache.commons.httpclient.HttpException e ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.PROVIDER_FAILURE , e.getMessage ( ) ) ; } catch ( java.io.IOException e ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.PROVIDER_FAILURE , e.getMessage ( ) ) ; } }

Target:
private void runHttpMethod ( org.apache.commons.httpclient.HttpClient httpClient , org.apache.commons.httpclient.HttpMethod httpMethod ) { try { int result = httpClient.executeMethod ( httpMethod ) ; if ( result != ( java.net.HttpURLConnection.HTTP_OK ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.PROVIDER_FAILURE ) ; } } catch ( org.apache.commons.httpclient.HttpException e ) { handleException ( e ) ; } catch ( javax.net.ssl.SSLException e ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.PROVIDER_SSL_FAILURE , e.getMessage ( ) ) ; } catch ( java.io.IOException e ) { handleException ( e ) ; } }
Source:
public org.ovirt.engine.core.common.users.VdcUser addUserToThreadContext ( java.lang.String sessionId , boolean refresh ) { org.ovirt.engine.core.common.users.VdcUser vdcUser = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getVdcUser ( ) ; if ( vdcUser == null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( sessionId ) ) ) { vdcUser = getUser ( sessionId , refresh ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( sessionId ) ; } else { vdcUser = getUser ( refresh ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setVdcUser ( vdcUser ) ; } return vdcUser ; }

Target:
public org.ovirt.engine.core.common.businessentities.DbUser addUserToThreadContext ( java.lang.String sessionId , boolean refresh ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getUser ( ) ; if ( dbUser == null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( sessionId ) ) ) { dbUser = getUser ( sessionId , refresh ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( sessionId ) ; } else { dbUser = getUser ( refresh ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setUser ( dbUser ) ; } return dbUser ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( masterDomain.getStoragePoolIsoMapData ( ) ) ; masterDomain.setstatus ( StorageDomainStatus.Locked ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . update ( masterDomain.getStoragePoolIsoMapData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( masterDomain.getStoragePoolIsoMapData ( ) ) ; masterDomain.setStatus ( StorageDomainStatus.Locked ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . update ( masterDomain.getStoragePoolIsoMapData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private org.ovirt.engine.ui.uicommonweb.action.UiAction labelNics ( java.util.List < org.ovirt.engine.core.common.action.LabelNicParameters > addedLabelsParameters ) { org.ovirt.engine.ui.uicommonweb.action.UiVdcAction uiVdcAction = new org.ovirt.engine.ui.uicommonweb.action.UiVdcAction ( org.ovirt.engine.core.common.action.VdcActionType.LabelNic , addedLabelsParameters.get ( 0 ) , this , true ) ; int size = addedLabelsParameters.size ( ) ; if ( size == 1 ) { return uiVdcAction ; } else { return uiVdcAction.then ( labelNics ( addedLabelsParameters.subList ( 1 , size ) ) ) ; } }

Target:
private void onBondEditUpdateParams ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { for ( java.util.Iterator < org.ovirt.engine.core.common.businessentities.network.Bond > iter = hostSetupNetworksParametersData.newOrModifiedBonds.iterator ( ) ; iter.hasNext ( ) ; ) { org.ovirt.engine.core.common.businessentities.network.Bond oldModifiedBond = iter.next ( ) ; if ( oldModifiedBond.getName ( ) . equals ( bond.getName ( ) ) ) { iter.remove ( ) ; break ; } } hostSetupNetworksParametersData.newOrModifiedBonds.add ( bond ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile = model.getSelectedItem ( ) ; vnic.setVnicProfileId ( ( profile != null ? profile.getId ( ) : null ) ) ; vnic.setNetworkName ( ( profile != null ? profile.getNetworkName ( ) : null ) ) ; com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( this , model ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { syncSelectedItemWithNetworkInterface ( model ) ; com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( this , model ) ; }
Source:
public void testNetworkExistsWhenValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; java.lang.String variableReplacements = "a" ; org.ovirt.engine.core.bll.ValidationResult propagatedResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_NOT_EXISTS , variableReplacements ) ; org.mockito.Mockito.when ( networkValidatorMock.networkIsSet ( ) ) . thenReturn ( propagatedResult ) ; org.junit.Assert.assertThat ( "ValidationResult is not correctly propagated" , networkAttachmentValidatorSpy.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_NOT_EXISTS , variableReplacements ) ) ; }

Target:
public void testNetworkExistsWhenValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; java.lang.String variableReplacements = "a" ; org.ovirt.engine.core.bll.ValidationResult propagatedResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_NOT_EXISTS , variableReplacements ) ; org.mockito.Mockito.when ( networkValidatorMock.networkIsSet ( ) ) . thenReturn ( propagatedResult ) ; org.junit.Assert.assertThat ( "ValidationResult is not correctly propagated" , networkAttachmentValidatorSpy.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_NOT_EXISTS , variableReplacements ) ) ; }
Source:
private void updateMigrationOptions ( ) { org.ovirt.engine.core.compat.Version version = getVersion ( ) . getSelectedItem ( ) ; if ( version == null ) { return ; } autoConverge.updateChangeability ( ConfigurationValues.AutoConvergenceSupported , version ) ; migrateCompressed.updateChangeability ( ConfigurationValues.MigrationCompressionSupported , version ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( ListModel.itemsChangedEventDefinition ) ) { handleItemsChangedEventDefinition ( sender ) ; } else if ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) { handleSelectedItemChangedEventDefinition ( sender , args ) ; } else if ( ev.matchesDefinition ( HasEntity.entityChangedEventDefinition ) ) { handleEntityChangedEventDefinition ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extendStorageDomain ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String [ ] devlist , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.extend" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "devlist" , new java.util.ArrayList < > ( java.util.Arrays.asList ( devlist ) ) ) . withParameter ( "force" , force ) . 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 extendStorageDomain ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String [ ] devlist , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.extend" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "devlist" , new java.util.ArrayList < > ( java.util.Arrays.asList ( devlist ) ) ) . withParameter ( "force" , force ) . 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 java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAll ( ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromRole" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAll ( ) { java.lang.Integer appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "app_mode" , appMode.intValue ( ) ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromRole" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }
Source:
public void testGetDefaultQuotaForDCWithDefaultQuota ( ) throws java.lang.Exception { org.mockito.Mockito.when ( quotaDAO.getDefaultQuotaByStoragePoolId ( storagePoolUUID ) ) . thenReturn ( mockGeneralStorageQuota ( ) ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }

Target:
public void testGetDefaultQuotaToDCWithoutDefaultQuota ( ) throws java.lang.Exception { java.lang.String defaultQuotaName = quotaHelper.getDefaultQuotaName ( storagePool.getname ( ) ) ; org.mockito.Mockito.when ( quotaHelper.generateDefaultQuotaName ( storagePool ) ) . thenReturn ( defaultQuotaName ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( ( succeeded ? ( ( org.ovirt.engine.core.compat.Guid ) ( retVal.getActionReturnValue ( ) ) ) : null ) , succeeded ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( ( succeeded ? ( ( org.ovirt.engine.core.compat.Guid ) ( retVal.getActionReturnValue ( ) ) ) : null ) , succeeded ) ; }
Source:
private static int setCDBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( ( device.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK ) ) && ( device.getDevice ( ) . equals ( VmDeviceType.CDROM.getName ( ) ) ) ) { if ( device.getIsPlugged ( ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } break ; } } return bootOrder ; }

Target:
private static int setCDBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isCD ( device ) ) { if ( device.getIsPlugged ( ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } break ; } } return bootOrder ; }
Source:
protected void initSelectedType ( ) { getNicType ( ) . setSelectedItem ( getDeafultNicTypeByProfile ( ) ) ; }

Target:
protected void initSelectedType ( ) { final org.ovirt.engine.core.common.businessentities.network.VmInterfaceType defaultNicType = getDeafultNicTypeByProfile ( ) ; final java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > vnicTypes = ( ( supportedVnicTypes ) == null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ( ) : supportedVnicTypes ; if ( ( getNicType ( ) . getItems ( ) ) == null ) { getNicType ( ) . setItems ( vnicTypes , defaultNicType ) ; } else { getNicType ( ) . setSelectedItem ( defaultNicType ) ; } }
Source:
public void setup ( ) { qos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; oldQos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( qos ) ) ; org.mockito.Mockito.doReturn ( oldQos ) . when ( validator ) . getOldQos ( ) ; nullValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( null ) ) ; org.mockito.Mockito.doReturn ( oldQos ) . when ( nullValidator ) . getOldQos ( ) ; }

Target:
public void setup ( ) { qos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; oldQos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; allQos = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( qos ) ) ; org.mockito.Mockito.doReturn ( oldQos ) . when ( validator ) . getOldQos ( ) ; org.mockito.Mockito.doReturn ( allQos ) . when ( validator ) . getAllQosInDc ( ) ; nullValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( null ) ) ; org.mockito.Mockito.doReturn ( oldQos ) . when ( nullValidator ) . getOldQos ( ) ; }
Source:
public void testBalance ( ) throws org.apache.xmlrpc.XmlRpcException { proxy.balance ( ) ; }

Target:
public void testFilter ( ) throws org.apache.xmlrpc.XmlRpcException { java.util.List < java.lang.String > result = proxy.filter ( new java.lang.String [ ] { org.ovirt.schedulerproxy.SchedulerProxyTest.FILE_NAME } , org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY , org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID , "" ) ; org.junit.Assert.assertTrue ( ( ( result.size ( ) ) == 2 ) ) ; org.junit.Assert.assertTrue ( result.contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID1 ) ) ; org.junit.Assert.assertTrue ( result.contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID2 ) ) ; }
Source:
public void validateVmMemoryCanStartOnVdsHostTooSmallButLowOverhead ( ) { vds.setMemFree ( 8835L ) ; vds.setGuestOverhead ( 0 ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCanStartOnVdsVmTooBigButLowOverhead ( ) { vm.setMinAllocatedMem ( 8865 ) ; vm.setVmMemSizeMb ( 8865 ) ; org.mockito.Mockito.doReturn ( 0 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
private final < T extends org.ovirt.engine.core.common.businessentities.IVdcQueryable > java.util.List < T > genericSearch ( final org.ovirt.engine.core.dao.SearchDAO < T > dao , final boolean useCache , final org.ovirt.engine.core.common.utils.ListUtils.Filter < T > filter ) { final org.ovirt.engine.core.bll.QueryData2 data = initQueryData ( useCache ) ; if ( data == null ) { return new java.util.ArrayList < T > ( ) ; } return org.ovirt.engine.core.common.utils.ListUtils.filter ( dao.getAllWithQuery ( data.getQuery ( ) ) , filter ) ; }

Target:
private final < T extends org.ovirt.engine.core.common.businessentities.IVdcQueryable > java.util.List < T > genericSearch ( final org.ovirt.engine.core.dao.SearchDAO < T > dao , final boolean useCache , final org.ovirt.engine.core.common.utils.ListUtils.Filter < T > filter ) { final org.ovirt.engine.core.bll.QueryData data = initQueryData ( useCache ) ; if ( data == null ) { return new java.util.ArrayList < T > ( ) ; } return org.ovirt.engine.core.common.utils.ListUtils.filter ( dao.getAllWithQuery ( data.getQuery ( ) ) , filter ) ; }
Source:
private org.ovirt.engine.core.common.action.LiveMigrateDiskParameters createLiveMigrateDiskParameters ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters , org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.action.LiveMigrateDiskParameters ( moveDiskParameters.getImageId ( ) , moveDiskParameters.getSourceDomainId ( ) , moveDiskParameters.getStorageDomainId ( ) , vmId , moveDiskParameters.getQuotaId ( ) , diskMap.get ( moveDiskParameters.getImageId ( ) ) . getId ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.LiveMigrateDiskParameters createLiveMigrateDiskParameters ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters , org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.action.LiveMigrateDiskParameters ( moveDiskParameters.getImageId ( ) , moveDiskParameters.getSourceDomainId ( ) , moveDiskParameters.getStorageDomainId ( ) , vmId , moveDiskParameters.getQuotaId ( ) , moveDiskParameters.getDiskProfileId ( ) , diskMap.get ( moveDiskParameters.getImageId ( ) ) . getId ( ) ) ; }
Source:
public void getStorageDomainMaxNameLength ( 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.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.CreateSnapshotCommand.canCreateSnapshot ( ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = performImageVdsmOperation ( ) ; if ( ( vdsReturnValue != null ) && ( vdsReturnValue.getSucceeded ( ) ) ) { processOldImageFromDb ( ) ; addDiskImageToDb ( mNewCreatedDiskImage , null ) ; setActionReturnValue ( mNewCreatedDiskImage ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.setSucceeded ( true ) ; } } }

Target:
public java.lang.Void runInTransaction ( ) { processOldImageFromDb ( ) ; addDiskImageToDb ( mNewCreatedDiskImage , getCompensationContext ( ) ) ; setActionReturnValue ( mNewCreatedDiskImage ) ; setSucceeded ( true ) ; return null ; }
Source:
protected boolean migrateVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.bll.job.ExecutionContext parentContext ) { return runInternalAction ( VdcActionType.InternalMigrateVm , new org.ovirt.engine.core.common.action.InternalMigrateVmParameters ( vm.getId ( ) , org.ovirt.engine.core.bll.MaintenanceVdsCommand.getActionType ( ) ) , createMigrateVmContext ( parentContext , vm ) ) . getSucceeded ( ) ; }

Target:
protected boolean migrateVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.bll.job.ExecutionContext parentContext ) { org.ovirt.engine.core.common.action.InternalMigrateVmParameters parameters = new org.ovirt.engine.core.common.action.InternalMigrateVmParameters ( vm.getId ( ) , org.ovirt.engine.core.bll.MaintenanceVdsCommand.getActionType ( ) ) ; parameters.setReason ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessage ( AuditLogType.MIGRATION_REASON_HOST_IN_MAINTENANCE ) ) ; return runInternalAction ( VdcActionType.InternalMigrateVm , parameters , createMigrateVmContext ( parentContext , vm ) ) . getSucceeded ( ) ; }
Source:
protected boolean isDiskPassPciAndIdeLimit ( org.ovirt.engine.core.common.businessentities.Disk diskInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmInterfaces = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmNetworkInterfaceDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allVmDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) ; allVmDisks.add ( diskInfo ) ; return checkPciAndIdeLimit ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getNumOfMonitors ( ) , vmInterfaces , allVmDisks , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean isDiskPassPciAndIdeLimit ( org.ovirt.engine.core.common.businessentities.Disk diskInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > vmInterfaces = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmNicDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allVmDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) ; allVmDisks.add ( diskInfo ) ; return checkPciAndIdeLimit ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getNumOfMonitors ( ) , vmInterfaces , allVmDisks , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }