auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void OnFinish ( org.ovirt.engine.ui.uicompat.TaskContext context , boolean isSucceeded , org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model , java.lang.String message ) { context.InvokeUIThread ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "Finish" , isSucceeded , model , message } ) ) ) ; }

Target:
public void onFinish ( org.ovirt.engine.ui.uicompat.TaskContext context , boolean isSucceeded , org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model , java.lang.String message ) { context.InvokeUIThread ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "Finish" , isSucceeded , model , message } ) ) ) ; }
Source:
protected boolean canDoAction ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) ; if ( vm == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST ) ; } if ( ! ( org.ovirt.engine.core.bll.RebootVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( vm.getStatus ( ) ) ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) ; if ( vm == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.RebootVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( vm.getStatus ( ) ) ) ; } return true ; }
Source:
protected void removeVnicProfiles ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > profiles = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVnicProfileDao ( ) . getAllForNetwork ( getNetwork ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile : profiles ) { org.ovirt.engine.core.bll.network.dc.NetworkCommon.getCompensationContext ( ) . snapshotEntity ( vnicProfile ) ; org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVnicProfileDao ( ) . remove ( vnicProfile.getId ( ) ) ; } }

Target:
protected void removeVnicProfiles ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > profiles = vnicProfileDao.getAllForNetwork ( getNetwork ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile : profiles ) { org.ovirt.engine.core.bll.network.dc.NetworkCommon.getCompensationContext ( ) . snapshotEntity ( vnicProfile ) ; vnicProfileDao.remove ( vnicProfile.getId ( ) ) ; } }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 1 , false ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 1 , false ) ; model.setId ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_ID.toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void setEntity ( java.lang.Object value ) { if ( ( entity ) != value ) { EntityChanging ( value , entity ) ; entity = value ; OnEntityChanged ( ) ; getEntityChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Entity" ) ) ; } }

Target:
public void setEntity ( java.lang.Object value ) { if ( ( entity ) != value ) { entityChanging ( value , entity ) ; entity = value ; onEntityChanged ( ) ; getEntityChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Entity" ) ) ; } }
Source:
private static void addCdDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.add ( VdsProperties.Index , "2" ) ; struct.add ( VdsProperties.NETWORK_INTERFACE , VdsProperties.Ide ) ; struct.add ( VdsProperties.ReadOnly , java.lang.Boolean.TRUE.toString ( ) ) ; struct.add ( VdsProperties.Shareable , java.lang.Boolean.FALSE.toString ( ) ) ; }

Target:
private static void addCdDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { struct.put ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.put ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.put ( VdsProperties.Index , "2" ) ; struct.put ( VdsProperties.INTERFACE , VdsProperties.Ide ) ; struct.put ( VdsProperties.ReadOnly , java.lang.Boolean.TRUE.toString ( ) ) ; struct.put ( VdsProperties.Shareable , java.lang.Boolean.FALSE.toString ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.RepoImage getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.RepoImage image = control.createMock ( org.ovirt.engine.core.common.businessentities.RepoImage.class ) ; org.easymock.EasyMock.expect ( image.getRepoImageId ( ) ) . andReturn ( GUIDS [ index ] . toString ( ) ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( image.getRepoImageName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return image ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.RepoImage getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.storage.RepoImage image = control.createMock ( org.ovirt.engine.core.common.businessentities.storage.RepoImage.class ) ; org.easymock.EasyMock.expect ( image.getRepoImageId ( ) ) . andReturn ( GUIDS [ index ] . toString ( ) ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( image.getRepoImageName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return image ; }
Source:
public void validateFailsOnServerNotUp ( ) { setUpMocksForRemove ( true , getHookEntity ( ) , VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP.toString ( ) ) ) ; }

Target:
public void validateFailsOnServerNotUp ( ) { setUpMocksForRemove ( true , getHookEntity ( ) , VDSStatus.Down ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP.toString ( ) ) ) ; }
Source:
public static boolean VerifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getavailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.IsVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }

Target:
public static boolean VerifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getAvailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.IsVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }
Source:
public static void IsLiveStorageMigrationEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LiveStorageMigrationEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , aQuery ) ; }

Target:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void execute ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > argMap ) { for ( org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension : org.ovirt.engine.exttool.core.InfoServiceImpl.getExtensionsManager ( context ) . getExtensions ( ) ) { org.ovirt.engine.api.extensions.ExtMap extContext = extension.getContext ( ) ; org.ovirt.engine.exttool.core.InfoServiceImpl.log.info ( "Extension name={} type={} version={} notes={}" , extContext.get ( Base.ContextKeys.INSTANCE_NAME ) , extContext.get ( Base.ContextKeys.EXTENSION_NAME ) , extContext.get ( Base.ContextKeys.VERSION ) , extContext.get ( Base.ContextKeys.EXTENSION_NOTES ) ) ; } }

Target:
public void execute ( org.ovirt.engine.exttool.core.InfoServiceImpl module ) { for ( org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension : module.getExtensionsManager ( ) . getExtensions ( ) ) { org.ovirt.engine.api.extensions.ExtMap extContext = extension.getContext ( ) ; org.ovirt.engine.exttool.core.InfoServiceImpl.log.info ( "Extension name={} type={} version={} notes={}" , extContext.get ( Base.ContextKeys.INSTANCE_NAME ) , extContext.get ( Base.ContextKeys.EXTENSION_NAME ) , extContext.get ( Base.ContextKeys.VERSION ) , extContext.get ( Base.ContextKeys.EXTENSION_NOTES ) ) ; } }
Source:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; java.lang.String ifaceName = ( bond.getName ( ) ) + "1" ; parameters.getInterfaces ( ) . add ( createVlan ( ifaceName , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_DONT_EXIST , ifaceName ) ; }

Target:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; java.lang.String ifaceName = ( bond.getName ( ) ) + "1" ; parameters.getInterfaces ( ) . add ( createVlan ( ifaceName , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_DONT_EXIST , ifaceName ) ; }
Source:
public void reportCompleted ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean success = ( 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:
public void reportCompleted ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean success = ( 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 ) ; }
Source:
public void testGetGlusterVolumeSnapshotConfigByClusterId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > configs = dao.getConfigByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertTrue ( ( configs != null ) ) ; org.junit.Assert.assertTrue ( ( ( configs.size ( ) ) == 3 ) ) ; org.junit.Assert.assertTrue ( configs.contains ( existingConfig1 ) ) ; }

Target:
public void testGetGlusterVolumeSnapshotConfigByClusterId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > configs = dao.getConfigByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( configs ) ; org.junit.Assert.assertEquals ( 3 , configs.size ( ) ) ; org.junit.Assert.assertTrue ( configs.contains ( existingConfig1 ) ) ; }
Source:
public void testImportCollapseSnapshots ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , true , false ) ; }

Target:
public void testImportCollapseSnapshots ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , true , false ) ; }
Source:
protected boolean checkNumberOfMonitors ( ) { return org.ovirt.engine.core.bll.VmHandler.isNumOfMonitorsLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfMonitors ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { if ( ( ( diskInfoDestinationMap ) != null ) && ( ! ( diskInfoDestinationMap.isEmpty ( ) ) ) ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.AddVmCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; } return true ; }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.getDbFacade ( ) . getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry = storageDomains.get ( 0 ) ; org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; }

Target:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.StorageDomainDao.class ) . getAllByConnectionId ( provider.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry = storageDomains.get ( 0 ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDao.class ) . remove ( storageDomainEntry.getId ( ) ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.StorageDomainStaticDao.class ) . remove ( storageDomainEntry.getId ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getActionGroupDao ( ) ; existingActionMap = dao.getActionVersionMapByActionType ( VdcActionType.AddVm ) ; newActionMap = new org.ovirt.engine.core.common.businessentities.ActionVersionMap ( org.ovirt.engine.core.common.action.VdcActionType.ActivateStorageDomain , "3.0" , "3.0" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getActionGroupDao ( ) ; existingActionMap = dao.getActionVersionMapByActionType ( VdcActionType.AddVm ) ; newActionMap = new org.ovirt.engine.core.common.businessentities.ActionVersionMap ( ) ; newActionMap.setaction_type ( VdcActionType.ActivateStorageDomain ) ; newActionMap.setcluster_minimal_version ( "3.0" ) ; newActionMap.setstorage_pool_minimal_version ( "3.0" ) ; }
Source:
public void initCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.StorageHandlingCommandBaseTest.TestStorageHandlingCommandBase ( new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( storagePool ) ) ) ; cmd.init ( ) ; }

Target:
public void setUp ( ) { storagePool = cmd.getParameters ( ) . getStoragePool ( ) ; cmd.init ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.doReturn ( storagePoolIsoMapDao ) . when ( cmd ) . getStoragePoolIsoMapDao ( ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.GraphicsDevice dev = getParameters ( ) . getDev ( ) ; if ( ( ( dev.getDeviceId ( ) ) == null ) || ( ( dev.getVmId ( ) ) == null ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_REMOVE_GRAPHICS_DEV_INVALID_PARAMS ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.GraphicsDevice dev = getParameters ( ) . getDev ( ) ; if ( ( ( dev.getDeviceId ( ) ) == null ) || ( ( dev.getVmId ( ) ) == null ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_REMOVE_GRAPHICS_DEV_INVALID_PARAMS ) ; } return true ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmStaticDao = dbFacade.getVmStaticDAO ( ) ; dao = dbFacade.getVmStatisticsDAO ( ) ; newVmStatic = vmStaticDao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f5001" ) ) ; newVmStatistics = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmStaticDao = dbFacade.getVmStaticDao ( ) ; dao = dbFacade.getVmStatisticsDao ( ) ; newVmStatic = vmStaticDao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f5001" ) ) ; newVmStatistics = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; }
Source:
public static void initCache ( org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( loginModel , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( target ) ; } } ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initUniqueOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initLinuxOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initWindowsOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initHasSpiceSupport ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initNicHotplugSupportMap ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initDiskHotpluggableInterfacesMap ( ) ; }

Target:
public static void initCache ( org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( loginModel , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( target ) ; } } ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initUniqueOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initLinuxOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initWindowsOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initDisplayTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initNicHotplugSupportMap ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initDiskHotpluggableInterfacesMap ( ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "STATUS" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.class ) ; } else if ( "LOCAL" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StoragePoolFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StoragePoolFieldAutoCompleter.LOCAL.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return retval ; }
Source:
public static void GetClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters ( id ) , aQuery ) ; }

Target:
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.GetVmPoolByIdParameters ( poolId ) , aQuery ) ; }
Source:
public void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void isTemplateNameUnique ( 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 ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaVdsConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaVdsGroupConsumptionParameter ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getvds_group_id ( ) , ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getcpu_per_socket ( ) ) * ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getnum_of_sockets ( ) ) ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getmem_size_mb ( ) ) ) ; return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaVdsConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaVdsGroupConsumptionParameter ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupId ( ) , ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getCpuPerSocket ( ) ) * ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getNumOfSockets ( ) ) ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getMemSizeMb ( ) ) ) ; return list ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Label model = resource.get ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.LABEL , model.getId ( ) ) ; verifyLinks ( model ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( getEntityList ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Label model = resource.get ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.LABELS [ 0 ] , model.getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public void shouldElectActiveSharedBeforeLocalDataDomain2 ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Arrays.asList ( sharedDomain , localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }

Target:
public void shouldElectActiveSharedBeforeLocalDataDomain2 ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Arrays.asList ( sharedDomain , localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.Disk getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage entity = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setvolumeFormat ( VolumeFormat.RAW ) ; entity.setImageStatus ( ImageStatus.OK ) ; entity.setVolumeType ( VolumeType.Sparse ) ; entity.setShareable ( false ) ; entity.setPropagateErrors ( PropagateErrors.On ) ; return org.ovirt.engine.api.restapi.resource.BackendDisksResourceTest.setUpStatisticalEntityExpectations ( entity ) ; }

Target:
protected org.ovirt.engine.api.model.Disk getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage entity = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setVolumeFormat ( VolumeFormat.RAW ) ; entity.setImageStatus ( ImageStatus.OK ) ; entity.setVolumeType ( VolumeType.Sparse ) ; entity.setShareable ( false ) ; entity.setPropagateErrors ( PropagateErrors.On ) ; return org.ovirt.engine.api.restapi.resource.BackendDisksResourceTest.setUpStatisticalEntityExpectations ( entity ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008R2x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7x64 , org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }

Target:
public static void GetAllowClusterWithVirtGlusterEnabled ( 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 ? source : java.lang.Boolean.TRUE ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
private void logHostFailToResponde ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ex , long timeoutToFence ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( ( "Server failed to respond, vds_id='{}', vds_name='{}', vm_count={}, " + "spm_status='{}', non-responsive_timeout (seconds)={}, error: {}" ) , cachedVds.getId ( ) , cachedVds.getName ( ) , cachedVds.getVmCount ( ) , cachedVds.getSpmStatus ( ) , java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( timeoutToFence ) , ex.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ; logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( cachedVds.getId ( ) ) ; logable.updateCallStackFromThrowable ( ex ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VDS_FAILURE ) ; }

Target:
private void logHostFailToRespond ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ex , long timeoutToFence ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( ( "Server failed to respond, vds_id='{}', vds_name='{}', vm_count={}, " + "spm_status='{}', non-responsive_timeout (seconds)={}, error: {}" ) , cachedVds.getId ( ) , cachedVds.getName ( ) , cachedVds.getVmCount ( ) , cachedVds.getSpmStatus ( ) , java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( timeoutToFence ) , ex.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ; logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( cachedVds.getId ( ) ) ; logable.updateCallStackFromThrowable ( ex ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VDS_FAILURE ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { boolean isDiskPlugged = getDetailModel ( ) . isDiskPluggedToVm ( object ) ; setTitle ( ( isDiskPlugged ? constants.active ( ) : constants.inactive ( ) ) ) ; return isDiskPlugged ? getCommonResources ( ) . upImage ( ) : getCommonResources ( ) . downImage ( ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { boolean isDiskPlugged = getDetailModel ( ) . isDiskPluggedToVm ( object ) ; setTitle ( ( isDiskPlugged ? org.ovirt.engine.ui.webadmin.section.main.view.tab.disk.SubTabDiskVmView.constants.active ( ) : org.ovirt.engine.ui.webadmin.section.main.view.tab.disk.SubTabDiskVmView.constants.inactive ( ) ) ) ; return isDiskPlugged ? org.ovirt.engine.ui.webadmin.section.main.view.tab.disk.SubTabDiskVmView.resources.upImage ( ) : org.ovirt.engine.ui.webadmin.section.main.view.tab.disk.SubTabDiskVmView.resources.downImage ( ) ; }
Source:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }

Target:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
public java.util.List < java.lang.String > missingServerCpuFlags ( java.lang.String clusterCpuName , java.lang.String serverFlags , org.ovirt.engine.core.compat.Version ver ) { final org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager cpuFlagsManager = org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.get ( ver ) ; if ( cpuFlagsManager != null ) { return cpuFlagsManager.missingServerCpuFlags ( clusterCpuName , serverFlags ) ; } return null ; }

Target:
public java.util.List < java.lang.String > missingServerCpuFlags ( java.lang.String clusterCpuName , java.lang.String serverFlags , org.ovirt.engine.core.compat.Version ver ) { final org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager cpuFlagsManager = org.ovirt.engine.core.bll.CpuFlagsManagerHandler.managersDictionary.get ( ver ) ; return cpuFlagsManager != null ? cpuFlagsManager.missingServerCpuFlags ( clusterCpuName , serverFlags ) : null ; }
Source:
private void lockVmSnapshotsWithWait ( org.ovirt.engine.core.common.businessentities.VM vm ) { snapshotsEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; java.util.Map < java.lang.String , java.lang.String > snapshotsExlusiveLockMap = java.util.Collections.singletonMap ( vm.getId ( ) . toString ( ) , LockingGroup.VM_SNAPSHOTS.name ( ) ) ; snapshotsEngineLock.setExclusiveLocks ( snapshotsExlusiveLockMap ) ; org.ovirt.engine.core.bll.RemoveImageCommand.getLockManager ( ) . acquireLockWait ( snapshotsEngineLock ) ; }

Target:
private void lockVmSnapshotsWithWait ( org.ovirt.engine.core.common.businessentities.VM vm ) { snapshotsEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > snapshotsExlusiveLockMap = java.util.Collections.singletonMap ( vm.getId ( ) . toString ( ) , LockMessagesMatchUtil.VM_SNAPSHOTS ) ; snapshotsEngineLock.setExclusiveLocks ( snapshotsExlusiveLockMap ) ; org.ovirt.engine.core.bll.RemoveImageCommand.getLockManager ( ) . acquireLockWait ( snapshotsEngineLock ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }

Target:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > org.ovirt.engine.core.bll.ValidationResult validateCoherentIdentification ( java.lang.String violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName , org.ovirt.engine.core.common.errors.EngineMessage message , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { boolean bothIdentificationSet = ( referringId != null ) && ( referringName != null ) ; java.lang.String [ ] replacements = createIncoherentIdentificationErrorReplacements ( violatingEntityId , referringId , referringName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( isNameAndIdIncoherent ( referringId , referringName , map ) ) ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getMigratableVmsRunningOnVds ( final org.ovirt.engine.core.dao.VmDAO vmDAO , final org.ovirt.engine.core.compat.Guid hostId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsFromDB = vmDAO.getAllRunningForVds ( hostId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( vmsFromDB , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.VM > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.VM v ) { return ( ( v.getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) && ( ( v.getDedicatedVmForVdsList ( ) . contains ( hostId ) ) == false ) ; } } ) ; return vms ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getMigratableVmsRunningOnVds ( final org.ovirt.engine.core.dao.VmDao vmDao , final org.ovirt.engine.core.compat.Guid hostId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsFromDB = vmDao.getAllRunningForVds ( hostId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( vmsFromDB , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.VM > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.VM v ) { return ( ( v.getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) && ( ( v.getDedicatedVmForVdsList ( ) . contains ( hostId ) ) == false ) ; } } ) ; return vms ; }
Source:
public static void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getClusterGlusterServices ( 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 ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }