auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeCommand ( ) { final org.ovirt.engine.core.compat.Guid providerId = org.ovirt.engine.core.bll.provider.RemoveProviderCommand.getParameters ( ) . getProvider ( ) . getId ( ) ; org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( org.ovirt.engine.core.bll.provider.RemoveProviderCommand.getParameters ( ) . getProvider ( ) ) ; if ( providerProxy != null ) { providerProxy.onRemoval ( ) ; } getProviderDao ( ) . remove ( providerId ) ; org.ovirt.engine.core.bll.provider.RemoveProviderCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.compat.Guid providerId = org.ovirt.engine.core.bll.provider.RemoveProviderCommand.getParameters ( ) . getProvider ( ) . getId ( ) ; org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( org.ovirt.engine.core.bll.provider.RemoveProviderCommand.getParameters ( ) . getProvider ( ) ) ; if ( providerProxy != null ) { providerProxy.onRemoval ( ) ; } org.ovirt.engine.core.bll.provider.RemoveProviderCommand.getProviderDao ( ) . remove ( providerId ) ; org.ovirt.engine.core.bll.provider.RemoveProviderCommand.setSucceeded ( true ) ; }
Source:
private void newPoolNameIsAlreadyTaken ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePoolList = new java.util.ArrayList < > ( ) ; storagePoolList.add ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createStoragePool ( ) ) ; org.mockito.Mockito.when ( spDao.getByName ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( new java.util.ArrayList ( storagePoolList ) ) ; }

Target:
private void newPoolNameIsAlreadyTaken ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePoolList = new java.util.ArrayList < > ( ) ; storagePoolList.add ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createStoragePool ( ) ) ; org.mockito.Mockito.when ( spDao.getByName ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( new java.util.ArrayList ( storagePoolList ) ) ; }
Source:
public void endWithFailure ( ) { org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; if ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getStage ( ) ) == ( org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters.LiveMigrateStage.CREATE_SNAPSHOT ) ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.OK , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; } }

Target:
public void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getStage ( ) ) == ( org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters.LiveMigrateStage.CREATE_SNAPSHOT ) ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.OK , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }
Source:
public static void getHostById ( 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.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getHostById ( 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.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private static void clearNetworks ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > attachedNetworks = nic.getItems ( ) ; if ( ( attachedNetworks.size ( ) ) > 0 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( attachedNetworks ) ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.getCommand ( networkModel , null , allNics ) . execute ( ) ; } } }

Target:
public static void clearNetworks ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > attachedNetworks = nic.getItems ( ) ; if ( ( attachedNetworks.size ( ) ) > 0 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( attachedNetworks ) ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.getCommand ( networkModel , null , allNics ) . execute ( ) ; } } }
Source:
protected void postConstruct ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setStoragePoolId ( parameters.getStoragePoolId ( ) ) ; imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap ( ) ; }

Target:
protected void postConstruct ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; setStoragePoolId ( parameters.getStoragePoolId ( ) ) ; imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap ( ) ; }
Source:
public void testGetStoragePoolIsoMap ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingStoragePoolIsoMap , result ) ; }

Target:
public void testGetStoragePoolIsoMap ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , existingStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingStoragePoolIsoMap , result ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; }
Source:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > items = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > ( ) ; for ( java.lang.String groupFullName : getEntity ( ) . getGroupNames ( ) . split ( "[,]" , ( - 1 ) ) ) { items.add ( org.ovirt.engine.ui.uicommonweb.models.users.UserGroupListModel.createUserGroup ( groupFullName ) ) ; } setItems ( items ) ; } else { setItems ( null ) ; } }

Target:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > items = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > ( ) ; for ( java.lang.String groupFullName : getEntity ( ) . getGroupNames ( ) ) { items.add ( org.ovirt.engine.ui.uicommonweb.models.users.UserGroupListModel.createUserGroup ( groupFullName ) ) ; } setItems ( items ) ; } else { setItems ( null ) ; } }
Source:
public static org.ovirt.engine.ui.common.widget.tab.TabDefinition createTab ( com.gwtplatform.mvp.client.TabData tabData , org.ovirt.engine.ui.common.widget.tab.AbstractTabPanel tabPanel , com.google.gwt.event.shared.EventBus eventBus ) { if ( tabData instanceof org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ) { return new org.ovirt.engine.ui.common.widget.tab.GroupedTab ( ( ( org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ) ( tabData ) ) , tabPanel ) ; } else if ( tabData instanceof org.ovirt.engine.ui.common.widget.tab.DynamicTabData ) { return new org.ovirt.engine.ui.common.widget.tab.DynamicTab ( ( ( org.ovirt.engine.ui.common.widget.tab.DynamicTabData ) ( tabData ) ) , tabPanel , eventBus ) ; } else { return new org.ovirt.engine.ui.common.widget.tab.SimpleTab ( tabData , tabPanel ) ; } }

Target:
public static org.ovirt.engine.ui.common.widget.tab.TabDefinition createTab ( com.gwtplatform.mvp.client.TabData tabData , org.ovirt.engine.ui.common.widget.tab.AbstractTabPanel tabPanel , com.google.gwt.event.shared.EventBus eventBus ) { if ( tabData instanceof org.ovirt.engine.ui.common.widget.tab.DynamicTabData ) { return new org.ovirt.engine.ui.common.widget.tab.DynamicTab ( ( ( org.ovirt.engine.ui.common.widget.tab.DynamicTabData ) ( tabData ) ) , tabPanel , eventBus ) ; } else if ( tabData instanceof org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ) { return new org.ovirt.engine.ui.common.widget.tab.GroupedTab ( ( ( org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ) ( tabData ) ) , tabPanel ) ; } else { return new org.ovirt.engine.ui.common.widget.tab.SimpleTab ( tabData , tabPanel ) ; } }
Source:
private void removeListeners ( org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { if ( ( viewUpdatingListener ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = model.getVmConsoles ( ) . getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel.class ) . getspice ( ) ; if ( spice == null ) { return ; } spice.getUsbAutoShareChangedEvent ( ) . removeListener ( viewUpdatingListener ) ; spice.getWANColorDepthChangedEvent ( ) . removeListener ( viewUpdatingListener ) ; spice.getWANDisableEffectsChangeEvent ( ) . removeListener ( viewUpdatingListener ) ; }

Target:
private void removeListeners ( org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { if ( ( viewUpdatingListener ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = model.getVmConsoles ( ) . getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel.class ) . getspice ( ) ; if ( spice == null ) { return ; } }
Source:
private void initVersion ( ) { if ( ! ( isVersionInit ) ) { isVersionInit = true ; for ( java.lang.Object a : getVersion ( ) . getItems ( ) ) { org.ovirt.engine.core.compat.Version item = ( ( org.ovirt.engine.core.compat.Version ) ( a ) ) ; if ( org.ovirt.engine.core.compat.Version.OpEquality ( item , getEntity ( ) . getcompatibility_version ( ) ) ) { getVersion ( ) . setSelectedItem ( item ) ; break ; } } } }

Target:
private void initVersion ( ) { if ( ! ( isVersionInit ) ) { isVersionInit = true ; for ( org.ovirt.engine.core.compat.Version item : getVersion ( ) . getItems ( ) ) { if ( org.ovirt.engine.core.compat.Version.OpEquality ( item , getEntity ( ) . getcompatibility_version ( ) ) ) { getVersion ( ) . setSelectedItem ( item ) ; break ; } } } }
Source:
public void refreshHeavyWeightData ( ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.errorFormat ( "Error while refreshing Gluster heavyweight data of cluster {0}!" , cluster.getname ( ) , e ) ; continue ; } } }

Target:
public void refreshHeavyWeightData ( ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.errorFormat ( "Error while refreshing Gluster heavyweight data of cluster {0}!" , cluster.getname ( ) , e ) ; } } }
Source:
protected void executeCommand ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > vmDisksMap = vmSlaPolicyUtils.getRunningVmDiskImageMapWithQos ( getQosId ( ) ) ; super . executeCommand ( ) ; org.ovirt.engine.core.common.businessentities.qos.StorageQos unlimitedQos = new org.ovirt.engine.core.common.businessentities.qos.StorageQos ( ) ; vmSlaPolicyUtils.refreshVmsStorageQos ( vmDisksMap , unlimitedQos ) ; }

Target:
protected void executeCommand ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > vmDisksMap = vmSlaPolicyUtils.getRunningVmDiskImageMapWithQos ( getQosId ( ) ) ; super . executeCommand ( ) ; if ( getSucceeded ( ) ) { vmSlaPolicyUtils.refreshVmsStorageQos ( vmDisksMap , new org.ovirt.engine.core.common.businessentities.qos.StorageQos ( ) ) ; } }
Source:
private void attachIso_EntityChanged ( ) { getIsoImage ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getAttachIso ( ) . getEntity ( ) ) ) ) ; getBootSequence ( ) . getCdromOption ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getAttachIso ( ) . getEntity ( ) ) ) ) ; updateInitialRunFields ( ) ; }

Target:
private void attachIso_EntityChanged ( ) { getIsoImage ( ) . setIsChangable ( getAttachIso ( ) . getEntity ( ) ) ; getBootSequence ( ) . getCdromOption ( ) . setIsChangable ( getAttachIso ( ) . getEntity ( ) ) ; updateInitialRunFields ( ) ; }
Source:
public void testValidateCompletion ( ) { org.ovirt.engine.core.searchbackend.IAutoCompleter comp = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; org.junit.Assert.assertTrue ( "TRUE" , comp.validateCompletion ( "TRUE" ) ) ; org.junit.Assert.assertTrue ( "TR" , comp.validateCompletion ( "TR" ) ) ; org.junit.Assert.assertFalse ( "JarJar" , comp.validateCompletion ( "JarJar" ) ) ; }

Target:
public void testValidateCompletion ( ) { org.junit.Assert.assertTrue ( "TRUE" , comp.validateCompletion ( "TRUE" ) ) ; org.junit.Assert.assertTrue ( "TR" , comp.validateCompletion ( "TR" ) ) ; org.junit.Assert.assertFalse ( "JarJar" , comp.validateCompletion ( "JarJar" ) ) ; }
Source:
private static void initMigrationSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.migrationSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetMigrationSupport ) , callback ) ; }

Target:
private static void initMigrationSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.migrationSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetMigrationSupport ) , callback ) ; }
Source:
public void isCpuPinningValidWithoutPinnedHost ( ) { org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > test = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > ( org.ovirt.engine.core.compat.Guid.Empty ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setNumOfSockets ( 6 ) ; vmStatic.setCpuPerSocket ( 2 ) ; vmStatic.setDedicatedVmForVdsList ( new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ) ; org.junit.Assert.assertFalse ( test.isCpuPinningValid ( "0#0" , vmStatic ) ) ; org.junit.Assert.assertFalse ( test.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_WITH_UNDEFINED_HOST ) ) ; }

Target:
public void isCpuPinningValidWithoutPinnedHost ( ) { org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > test = new org.ovirt.engine.core.bll.VmManagementCommandBase ( org.ovirt.engine.core.compat.Guid.Empty ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setNumOfSockets ( 6 ) ; vmStatic.setCpuPerSocket ( 2 ) ; vmStatic.setDedicatedVmForVdsList ( new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ) ; org.junit.Assert.assertFalse ( test.isCpuPinningValid ( "0#0" , vmStatic ) ) ; org.junit.Assert.assertFalse ( test.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_WITH_UNDEFINED_HOST ) ) ; }
Source:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vm.getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; setAsyncResult ( null ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }
Source:
protected void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; if ( org.ovirt.engine.core.bll.RunVmCommandBase.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "Decreasing vds {0} pending vcpu count by {1} and vmem size by {2} (Vm: {3})" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; } }

Target:
private void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "Decreasing vds {0} pending vcpu count by {1} and vmem size by {2} (Vm: {3})" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; }
Source:
public org.ovirt.engine.api.model.NIC update ( org.ovirt.engine.api.model.NIC resource ) { validateParameters ( resource , requiredUpdateFields ) ; org.ovirt.engine.core.common.businessentities.network.Network network = findNetwork ( resource ) ; if ( network != null ) { resource.getNetwork ( ) . setName ( network.getName ( ) ) ; resource.getNetwork ( ) . setId ( null ) ; } return performUpdate ( resource , entityResolver , updateType , updateParametersProvider ) ; }

Target:
public org.ovirt.engine.api.model.NIC update ( org.ovirt.engine.api.model.NIC resource ) { validateParameters ( resource , requiredUpdateFields ) ; return performUpdate ( resource , entityResolver , updateType , updateParametersProvider ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > searchVMTemplates ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmTemplateDao ( ) , true , new org.ovirt.engine.core.common.utils.ListUtils.Filter < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > filter ( final java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > data ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable vmt_helper : data ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmt = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( vmt_helper ) ) ; org.ovirt.engine.core.bll.VmTemplateHandler.updateDisksFromDb ( vmt ) ; } return data ; } } ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > searchVMTemplates ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmTemplateDao ( ) , true , null ) ; }
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.ui.uicommonweb.models.users.EventNotificationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.users.EventNotificationModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "EventGroupModels" . equals ( propertyName ) ) { updateTree ( model ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.users.EventNotificationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.users.EventNotificationModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "EventGroupModels" . equals ( propertyName ) ) { updateTree ( model ) ; } }
Source:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = getDbFacade ( ) . getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry : storageDomains ) { getDbFacade ( ) . getStorageDomainDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; } }

Target:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = getDbFacade ( ) . getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry = storageDomains.get ( 0 ) ; getDbFacade ( ) . getStorageDomainDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; }
Source:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskSnapshotByImageId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskSnapshotResourceTest.IMAGE_ID } , getEntity ( 1 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.DiskSnapshot diskSnapshot = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskSnapshotResourceTest.verifyModelSpecific ( diskSnapshot , 1 ) ; }

Target:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskSnapshotByImageId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskSnapshotResourceTest.IMAGE_ID } , getEntity ( 1 ) ) ; org.ovirt.engine.api.model.DiskSnapshot diskSnapshot = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskSnapshotResourceTest.verifyModelSpecific ( diskSnapshot , 1 ) ; }
Source:
public void init ( org.ovirt.engine.core.common.businessentities.StorageDomain sourceStorageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > repoImages ) { this . sourceStorageDomain = sourceStorageDomain ; setRepoImages ( repoImages ) ; updateDataCenters ( ) ; org.ovirt.engine.ui.uicompat.IEventListener importAsTemplateListener = new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateClusterEnabled ( ) ; } } ; getImportAsTemplate ( ) . getEntityChangedEvent ( ) . addListener ( importAsTemplateListener ) ; }

Target:
public void init ( org.ovirt.engine.core.common.businessentities.StorageDomain sourceStorageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > repoImages ) { this . sourceStorageDomain = sourceStorageDomain ; setRepoImages ( repoImages ) ; updateDataCenters ( ) ; org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > importAsTemplateListener = new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { updateClusterEnabled ( ) ; } } ; getImportAsTemplate ( ) . getEntityChangedEvent ( ) . addListener ( importAsTemplateListener ) ; }
Source:
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 ( ) ) ; }

Target:
public void setUp ( ) { storagePool = cmd.getParameters ( ) . getStoragePool ( ) ; cmd.init ( ) ; 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:
public void Rollback ( ) { super . Rollback ( ) ; if ( macAddressChanged ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . AddMac ( oldIface.getMacAddress ( ) ) ; if ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.AllowDuplicateMacAddresses ) ) ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMac ( org.ovirt.engine.core.bll.UpdateVmInterfaceCommand.getParameters ( ) . getInterface ( ) . getMacAddress ( ) ) ; } } }

Target:
public void Rollback ( ) { super . Rollback ( ) ; if ( macAddressChanged ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . AddMac ( oldIface.getMacAddress ( ) ) ; if ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.AllowDuplicateMacAddresses ) ) ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMac ( getMacAddress ( ) ) ; } } }
Source:
private void remoteFileName ( java.lang.String file ) { if ( ( ( ( ( file.indexOf ( '\'' ) ) != ( - 1 ) ) || ( ( file.indexOf ( '\n' ) ) != ( - 1 ) ) ) || ( ( file.indexOf ( '\r' ) ) != ( - 1 ) ) ) || false ) { throw new java.lang.IllegalArgumentException ( "File name should not contain \"\'\"" ) ; } }

Target:
private void remoteFileName ( java.lang.String file ) { if ( ( ( ( file.indexOf ( '\'' ) ) != ( - 1 ) ) || ( ( file.indexOf ( '\n' ) ) != ( - 1 ) ) ) || ( ( file.indexOf ( '\r' ) ) != ( - 1 ) ) ) { throw new java.lang.IllegalArgumentException ( "File name should not contain \"\'\"" ) ; } }
Source:
public static org.ovirt.engine.core.bll.ValidationResult checkVmNumaNodeCount ( int numaNodeCount , int cpuCores ) { if ( cpuCores < numaNodeCount ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.VM_NUMA_NODE_MORE_NODES_THAN_CPUS , java.lang.String.format ( "$numaNodes %d" , numaNodeCount ) , java.lang.String.format ( "$cpus %d" , cpuCores ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private static org.ovirt.engine.core.bll.ValidationResult checkVmNumaNodeCount ( int numaNodeCount , int cpuCores ) { if ( cpuCores < numaNodeCount ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.VM_NUMA_NODE_MORE_NODES_THAN_CPUS , java.lang.String.format ( "$numaNodes %d" , numaNodeCount ) , java.lang.String.format ( "$cpus %d" , cpuCores ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private boolean isStorageDomainValid ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType , boolean forceRefresh ) { if ( storageDomainId == null ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.error ( "Storage domain ID received from command query is null." ) ; return false ; } if ( ! ( refreshRepos ( storageDomainId , imageType , forceRefresh ) ) ) { return false ; } return true ; }

Target:
private boolean isStorageDomainValid ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType , boolean forceRefresh ) { if ( storageDomainId == null ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.error ( "Storage domain ID received from command query is null." ) ; return false ; } if ( forceRefresh ) { return refreshRepos ( storageDomainId , imageType ) ; } return true ; }
Source:
public void endStepJob ( org.ovirt.engine.core.common.job.Step step ) { getJobRepository ( ) . updateStep ( step ) ; org.ovirt.engine.core.bll.job.ExecutionContext finalContext = org.ovirt.engine.core.bll.job.ExecutionHandler.createFinalizingContext ( step.getId ( ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endTaskStepAndJob ( finalContext , isTaskSuccess ( step.getStatus ( ) ) ) ; }

Target:
public void endStepJob ( org.ovirt.engine.core.common.job.Step step ) { getJobRepository ( ) . updateStep ( step ) ; org.ovirt.engine.core.bll.job.ExecutionContext finalContext = org.ovirt.engine.core.bll.job.ExecutionHandler.getInstance ( ) . createFinalizingContext ( step.getId ( ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.getInstance ( ) . endTaskStepAndJob ( finalContext , isTaskSuccess ( step.getStatus ( ) ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VmDevice getVmDevice ( org.ovirt.engine.core.compat.Guid deviceId , org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , java.lang.String device , boolean isManaged ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , type , device , "" , 0 , java.util.Collections.emptyMap ( ) , isManaged , true , false , "" , java.util.Collections.emptyMap ( ) , null , null ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VmDevice getVmDevice ( org.ovirt.engine.core.compat.Guid deviceId , org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , java.lang.String device , boolean isManaged ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , type , device , "" , java.util.Collections.emptyMap ( ) , isManaged , true , false , "" , java.util.Collections.emptyMap ( ) , null , null ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { cModel.stopProgress ( ) ; if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cModel.setActionConfirmationMessage ( result.getReturnValue ( ) . getFault ( ) . getMessage ( ) ) ; } else { setWindow ( null ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( cModel == null ) { return ; } else { cModel.stopProgress ( ) ; if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cModel.setActionConfirmationMessage ( result.getReturnValue ( ) . getFault ( ) . getMessage ( ) ) ; } else { setWindow ( null ) ; } } }
Source:
public void testLogEntryLogsWhenLogLevelActive ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logEntry ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) ) ; org.mockito.Mockito.verify ( log ) . debug ( org.mockito.ArgumentMatchers.eq ( LoggedUtils.ENTRY_LOG ) , new java.lang.Object [ ] { org.mockito.ArgumentMatchers.anyObject ( ) , org.mockito.ArgumentMatchers.eq ( id ) } ) ; }

Target:
public void testLogEntryLogsWhenLogLevelActive ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logEntry ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) ) ; org.mockito.Mockito.verify ( log ) . debug ( org.mockito.ArgumentMatchers.eq ( LoggedUtils.ENTRY_LOG ) , new java.lang.Object [ ] { org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( id ) } ) ; }
Source:
private void initCommand ( ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( ) ; params.setVdsId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_ID ) ; command = new org.ovirt.engine.core.bll.pm.StartVdsCommand ( params , null ) ; command.setAuditLogDirector ( auditLogDirector ) ; command = org.mockito.Mockito.spy ( command ) ; org.mockito.Mockito.doReturn ( executor ) . when ( command ) . createHostFenceActionExecutor ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.FencingPolicy.class ) ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontend ) . when ( command ) . getVdsBroker ( ) ; command.setClusterId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_CLUSTER_ID ) ; }

Target:
private void initCommand ( ) { org.mockito.Mockito.doReturn ( executor ) . when ( command ) . createHostFenceActionExecutor ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.FencingPolicy.class ) ) ; command.setClusterId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_CLUSTER_ID ) ; }
Source:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDiskHotpluggableInterfaces ( getEntity ( ) . getOs ( ) , clusterCompatibilityVersion ) . isEmpty ( ) ) ) ) ) ; } }

Target:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskHotpluggableInterfaces ( getEntity ( ) . getOs ( ) , clusterCompatibilityVersion ) . isEmpty ( ) ) ) ) ) ; } }
Source:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }
Source:
public static void copySerialNumber ( org.ovirt.engine.api.model.SerialNumber serialNumber , org.ovirt.engine.core.common.businessentities.HasSerialNumberPolicy entity ) { if ( serialNumber.isSetPolicy ( ) ) { org.ovirt.engine.api.model.SerialNumberPolicy serialNumberPolicy = org.ovirt.engine.api.model.SerialNumberPolicy.fromValue ( serialNumber.getPolicy ( ) ) ; entity.setSerialNumberPolicy ( org.ovirt.engine.api.restapi.types.SerialNumberMapper.map ( serialNumberPolicy , null ) ) ; } if ( serialNumber.isSetValue ( ) ) { java.lang.String customSerialNumber = ( "" . equals ( serialNumber.getValue ( ) ) ) ? null : serialNumber.getValue ( ) ; entity.setCustomSerialNumber ( customSerialNumber ) ; } }

Target:
public static void copySerialNumber ( org.ovirt.engine.api.model.SerialNumber serialNumber , org.ovirt.engine.core.common.businessentities.HasSerialNumberPolicy entity ) { if ( serialNumber.isSetPolicy ( ) ) { entity.setSerialNumberPolicy ( org.ovirt.engine.api.restapi.types.SerialNumberMapper.map ( serialNumber.getPolicy ( ) , null ) ) ; } if ( serialNumber.isSetValue ( ) ) { java.lang.String customSerialNumber = ( "" . equals ( serialNumber.getValue ( ) ) ) ? null : serialNumber.getValue ( ) ; entity.setCustomSerialNumber ( customSerialNumber ) ; } }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > mapDisks ( org.ovirt.engine.api.model.Disks disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = null ; if ( ( disks != null ) && ( disks.isSetDisks ( ) ) ) { diskImages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.api.model.Disk disk : disks.getDisks ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( disk , null ) ) ) ; diskImages.add ( diskImage ) ; } } return diskImages ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > mapDisks ( org.ovirt.engine.api.model.Disks disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = null ; if ( ( disks != null ) && ( disks.isSetDisks ( ) ) ) { diskImages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.api.model.Disk disk : disks.getDisks ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( disk , null ) ) ) ; diskImages.add ( diskImage ) ; } } return diskImages ; }
Source:
protected void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }

Target:
public void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }
Source:
public void fakeVlanNicWithVmNetworkDenied ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; mockExistingNetworks ( net1 , net2 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface fakeVlanNic = createVlan ( nic.getName ( ) , 100 , net2.getName ( ) ) ; fakeVlanNic.setVlanId ( null ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , fakeVlanNic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }

Target:
public void fakeVlanNicWithVmNetworkDenied ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; net2.setVlanId ( 100 ) ; mockExistingNetworks ( net1 , net2 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface fakeVlanNic = createVlan ( nic.getName ( ) , 100 , net2.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , fakeVlanNic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }
Source:
public void refreshHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { org.ovirt.engine.core.common.businessentities.VDSStatus newStatus = refreshCapabilities ( new java.util.concurrent.atomic.AtomicBoolean ( ) , vds ) ; if ( org.ovirt.engine.core.vdsbroker.VdsManager.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Succeeded to refreshCapabilities for host {0} , new status will be {1} " , getVdsId ( ) , newStatus ) ; } } finally { if ( vds != null ) { updateDynamicData ( vds.getDynamicData ( ) ) ; monitoringStrategy.processHardwareCapabilities ( vds ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . handleVdsVersion ( vds.getId ( ) ) ; } } }

Target:
public void refreshHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { refreshCapabilities ( new java.util.concurrent.atomic.AtomicBoolean ( ) , vds ) ; } finally { if ( vds != null ) { updateDynamicData ( vds.getDynamicData ( ) ) ; monitoringStrategy.processHardwareCapabilities ( vds ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . handleVdsVersion ( vds.getId ( ) ) ; } } }