auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > createCommand ( ) { initVM ( ) ; org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters param = new org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters ( ) ; param.setVm ( vm ) ; param.setSourceSnapshotId ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommandTest.SOURCE_SNAPSHOT_ID ) ; param.setStorageDomainId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = new org.ovirt.engine.core.bll.AddVmFromSnapshotCommand ( param , null ) ; cmd.setVm ( vm ) ; cmd.setVmId ( vm.getId ( ) ) ; return cmd ; }

Target:
protected org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters param = new org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters ( ) ; param.setVm ( vm ) ; param.setSourceSnapshotId ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommandTest.SOURCE_SNAPSHOT_ID ) ; param.setStorageDomainId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = new org.ovirt.engine.core.bll.AddVmFromSnapshotCommand ( param , null ) ; cmd.setVm ( vm ) ; cmd.setVmId ( vm.getId ( ) ) ; return cmd ; }
Source:
private void updateNumOfMonitors ( ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.DisplayType > selectedDisplayType = getDisplayType ( ) . getSelectedItem ( ) ; if ( ( selectedDisplayType != null ) && ( ( selectedDisplayType.getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } else { getNumOfMonitors ( ) . setIsChangable ( true ) ; } }

Target:
private void updateNumOfMonitors ( ) { if ( ( getDisplayType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) { getNumOfMonitors ( ) . setIsChangable ( true ) ; } else { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } }
Source:
private boolean registerLibvirtSecrets ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.cinderProviderSupported ( getStoragePool ( ) . getCompatibilityVersion ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = libvirtSecretDao.getAllByStoragePoolIdFilteredByActiveStorageDomains ( getStoragePoolId ( ) ) ; if ( ! ( libvirtSecrets.isEmpty ( ) ) ) { return registerLibvirtSecrets ( libvirtSecrets , false ) ; } } return true ; }

Target:
private boolean registerLibvirtSecrets ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = libvirtSecretDao.getAllByStoragePoolIdFilteredByActiveStorageDomains ( getStoragePoolId ( ) ) ; if ( ! ( libvirtSecrets.isEmpty ( ) ) ) { return registerLibvirtSecrets ( libvirtSecrets , false ) ; } return true ; }
Source:
public void mapVmWatchdog ( ) { org.ovirt.engine.core.common.businessentities.VmWatchdog entity = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; entity.setAction ( VmWatchdogAction.RESET ) ; entity.setModel ( VmWatchdogType.i6300esb ) ; entity.setId ( Guid.Empty ) ; org.ovirt.engine.api.model.Watchdog model = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( entity , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( model.getAction ( ) , WatchdogAction.RESET ) ; org.junit.Assert.assertEquals ( model.getModel ( ) , WatchdogModel.I6300ESB ) ; }

Target:
public void mapVmWatchdog ( ) { org.ovirt.engine.core.common.businessentities.VmWatchdog entity = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; entity.setAction ( VmWatchdogAction.RESET ) ; entity.setModel ( VmWatchdogType.i6300esb ) ; entity.setId ( Guid.Empty ) ; org.ovirt.engine.api.model.Watchdog model = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( entity , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( WatchdogAction.RESET , model.getAction ( ) ) ; org.junit.Assert.assertEquals ( WatchdogModel.I6300ESB , model.getModel ( ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( org.ovirt.engine.core.bll.StopVdsCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { retValue = super . canDoAction ( ) ; if ( ( ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_STOP ) ; retValue = false ; } } return retValue ; }

Target:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( org.ovirt.engine.core.bll.StopVdsCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { retValue = super . canDoAction ( ) ; if ( ( ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_STOP ) ; retValue = false ; } } return retValue ; }
Source:
public final java.lang.String consoleClientResourcesUrl ( ) { java.lang.String url = getString ( org.ovirt.engine.ui.common.utils.BaseDynamicMessages.DynamicMessageKey.CONSOLE_CLIENT_RESOURCES_URL ) ; boolean isAbsolute = ( com.google.gwt.safehtml.shared.UriUtils.extractScheme ( url ) ) != null ; return isAbsolute ? url : ( "/" + ( org.ovirt.engine.ui.frontend.utils.BaseContextPathData.getInstance ( ) . getRelativePath ( ) ) ) + url ; }

Target:
public final java.lang.String consoleClientResourcesUrl ( ) { java.lang.String url = getString ( org.ovirt.engine.ui.common.utils.BaseDynamicMessages.DynamicMessageKey.CONSOLE_CLIENT_RESOURCES_URL ) ; boolean isAbsolute = ( com.google.gwt.safehtml.shared.UriUtils.extractScheme ( url ) ) != null ; return isAbsolute ? url : ( "/" + ( org.ovirt.engine.ui.frontend.utils.BaseContextPathData.getRelativePath ( ) ) ) + url ; }
Source:
public void tearDown ( ) throws java.lang.Exception { org.mockito.Mockito.verify ( queryStartEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.Empty ) ; org.mockito.Mockito.verify ( queryCompleteEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.Empty ) ; org.junit.Assert.assertEquals ( "Context should be 'test'" , org.ovirt.engine.ui.frontend.Frontend.getCurrentContext ( ) , "test" ) ; org.junit.Assert.assertEquals ( "There should be no pending requests" , 0 , Frontend.pendingRequests.size ( ) ) ; org.junit.Assert.assertEquals ( "There should be no current requests" , 0 , Frontend.currentRequests.size ( ) ) ; }

Target:
public void tearDown ( ) throws java.lang.Exception { org.mockito.Mockito.verify ( queryStartEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.Empty ) ; org.mockito.Mockito.verify ( queryCompleteEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.Empty ) ; org.junit.Assert.assertEquals ( "Context should be 'test'" , org.ovirt.engine.ui.frontend.Frontend.getCurrentContext ( ) , "test" ) ; }
Source:
public void testGetBaseNicVerifyDelegation ( ) throws java.lang.Exception { org.ovirt.engine.core.vdsbroker.CalculateBaseNic spy = org.mockito.Mockito.spy ( calculateBaseNic ) ; spy.getBaseNic ( baseNic ) ; org.mockito.Mockito.verify ( spy ) . getBaseNic ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.class ) , org.mockito.ArgumentMatchers.isNull ( ) ) ; }

Target:
public void testGetBaseNicVerifyDelegation ( ) throws java.lang.Exception { org.ovirt.engine.core.vdsbroker.CalculateBaseNic spy = org.mockito.Mockito.spy ( calculateBaseNic ) ; spy.getBaseNic ( baseNic ) ; org.mockito.Mockito.verify ( spy ) . getBaseNic ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.class ) , org.mockito.ArgumentMatchers.isNull ( ) ) ; }
Source:
protected void doChangeDefautlHost ( org.ovirt.engine.core.compat.Guid hostGuid ) { if ( hostGuid != null ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( hostGuid.getValue ( ) ) ; getModel ( ) . getDefaultHost ( ) . setItems ( java.util.Arrays.asList ( vds ) ) ; } super . doChangeDefautlHost ( hostGuid ) ; }

Target:
protected void doChangeDefautlHost ( org.ovirt.engine.core.compat.Guid hostGuid ) { if ( hostGuid != null ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( hostGuid ) ; getModel ( ) . getDefaultHost ( ) . setItems ( java.util.Arrays.asList ( vds ) ) ; } super . doChangeDefautlHost ( hostGuid ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmPoolDao ( ) ; vmDao = dbFacade.getVmDao ( ) ; existingVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDaoTest.EXISTING_VM_POOL_ID ) ; deletableVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDaoTest.DELETABLE_VM_POOL_ID ) ; newVmPool = new org.ovirt.engine.core.common.businessentities.VmPool ( ) ; newVmPool.setName ( "New VM Pool" ) ; newVmPool.setVmPoolDescription ( "This is a new VM pool." ) ; newVmPool.setClusterId ( FixturesTool.CLUSTER ) ; newVmPoolMap = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( org.ovirt.engine.core.dao.VmPoolDaoTest.FREE_VM_ID , org.ovirt.engine.core.dao.VmPoolDaoTest.EXISTING_VM_POOL_ID ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; existingVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDaoTest.EXISTING_VM_POOL_ID ) ; deletableVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDaoTest.DELETABLE_VM_POOL_ID ) ; newVmPool = new org.ovirt.engine.core.common.businessentities.VmPool ( ) ; newVmPool.setName ( "New VM Pool" ) ; newVmPool.setVmPoolDescription ( "This is a new VM pool." ) ; newVmPool.setClusterId ( FixturesTool.CLUSTER ) ; newVmPoolMap = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( org.ovirt.engine.core.dao.VmPoolDaoTest.FREE_VM_ID , org.ovirt.engine.core.dao.VmPoolDaoTest.EXISTING_VM_POOL_ID ) ; }
Source:
public void commandSucceeds ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; pubKeys.add ( "" ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
public void commandSucceeds ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; pubKeys.add ( "" ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) , null ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.Iterable listEnumerable = ( ( java.lang.Iterable ) ( source ) ) ; java.util.Iterator listIterator = listEnumerable.iterator ( ) ; while ( listIterator.hasNext ( ) ) { list.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.Disk ) ( listIterator.next ( ) ) ) ) ; } } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > convert ( java.lang.Object source ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.Iterable listEnumerable = ( ( java.lang.Iterable ) ( source ) ) ; java.util.Iterator listIterator = listEnumerable.iterator ( ) ; while ( listIterator.hasNext ( ) ) { list.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.Disk ) ( listIterator.next ( ) ) ) ) ; } } return list ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel spiceConsoleModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( model ) ) ; java.lang.String address = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; spiceConsoleModel.getspice ( ) . setHost ( address ) ; spiceConsoleModel.SpiceConnect ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel spiceConsoleModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( model ) ) ; java.lang.String address = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; spiceConsoleModel.getspice ( ) . setHost ( address ) ; spiceConsoleModel.SpiceConnect ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { java.util.Set < java.lang.String > emulatedSet = new java.util.TreeSet < java.lang.String > ( ( ( java.util.HashSet < java.lang.String > ) ( returnValue ) ) ) ; emulatedSet.add ( "" ) ; java.lang.String oldVal = getModel ( ) . getEmulatedMachine ( ) . getSelectedItem ( ) ; getModel ( ) . getEmulatedMachine ( ) . setItems ( emulatedSet ) ; getModel ( ) . getEmulatedMachine ( ) . setSelectedItem ( oldVal ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { java.util.Set < java.lang.String > emulatedSet = new java.util.TreeSet < > ( ( ( java.util.HashSet < java.lang.String > ) ( returnValue ) ) ) ; emulatedSet.add ( "" ) ; java.lang.String oldVal = getModel ( ) . getEmulatedMachine ( ) . getSelectedItem ( ) ; getModel ( ) . getEmulatedMachine ( ) . setItems ( emulatedSet ) ; getModel ( ) . getEmulatedMachine ( ) . setSelectedItem ( oldVal ) ; } }
Source:
public void testAllDomainsWithinThreshold ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.name ( ) ) ) ; }

Target:
public void testAllDomainsWithinThreshold ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.name ( ) ) ) ; }
Source:
public void executeCommandFailedWhenServerIdPresent ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID , org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommandTest.SERVER_ID ) , null ) ) ; setUpMocksForUpdate ( ) ; mockForReadContent ( false , EngineError.GlusterHookNotFound ) ; try { cmd.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.junit.Assert.assertEquals ( e.getErrorCode ( ) , EngineError.GlusterHookNotFound ) ; } org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; }

Target:
public void executeCommandFailedWhenServerIdPresent ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID , org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommandTest.SERVER_ID ) , null ) ) ; setUpMocksForUpdate ( ) ; mockForReadContent ( false , EngineError.GlusterHookNotFound ) ; try { cmd.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.junit.Assert.assertEquals ( EngineError.GlusterHookNotFound , e.getErrorCode ( ) ) ; } org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; }
Source:
protected void onEntityChanged ( ) { if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( getEntity ( ) ) ) . getVm ( ) ; setItems ( vm.getInterfaces ( ) ) ; } else { setItems ( null ) ; } }

Target:
protected void onEntityChanged ( ) { if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; setItems ( vm.getInterfaces ( ) ) ; } else { setItems ( null ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; networkModel.getDataCenters ( ) . setItems ( dataCenters ) ; if ( networkModel instanceof org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel ) { org.ovirt.engine.core.common.businessentities.StoragePool currentDc = findDc ( networkModel.getNetwork ( ) . getDataCenterId ( ) , dataCenters ) ; networkModel.getDataCenters ( ) . setSelectedItem ( currentDc ) ; } else { networkModel.getDataCenters ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters ) ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { networkModel.getDataCenters ( ) . setItems ( dataCenters ) ; if ( networkModel instanceof org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel ) { org.ovirt.engine.core.common.businessentities.StoragePool currentDc = findDc ( networkModel.getNetwork ( ) . getDataCenterId ( ) , dataCenters ) ; networkModel.getDataCenters ( ) . setSelectedItem ( currentDc ) ; } else { networkModel.getDataCenters ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters ) ) ; } }
Source:
protected void selectExternalProvider ( ) { final org.ovirt.engine.core.common.businessentities.network.Network network = getNetwork ( ) ; getExternalProviders ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > ) ( getExternalProviders ( ) . getItems ( ) ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkSameProviderPredicate ( network ) ) ) ; }

Target:
protected void selectExternalProvider ( ) { final org.ovirt.engine.core.common.businessentities.network.Network network = getNetwork ( ) ; getExternalProviders ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( getExternalProviders ( ) . getItems ( ) , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkSameProviderPredicate ( network ) ) ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }
Source:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_0 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.mcr.mockConfigValue ( ConfigValues.VM32BitMaxMemorySizeInMB , Version.v4_0 , 20480 ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }

Target:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_0 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }
Source:
public boolean canConnect ( ) { return ( ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isWindowsOsType ( getEntity ( ) . getVmOsId ( ) ) ) ; }

Target:
public boolean canConnect ( ) { return ( ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isWindowsOsType ( getEntity ( ) . getVmOsId ( ) ) ) ; }
Source:
private com.woorea.openstack.quantum.model.Port locatePort ( org.ovirt.engine.core.common.businessentities.network.VmNic nic ) { java.util.List < com.woorea.openstack.quantum.model.Port > ports = getClient ( ) . ports ( ) . list ( ) . execute ( ) . getList ( ) ; for ( com.woorea.openstack.quantum.model.Port port : ports ) { if ( ( org.ovirt.engine.core.bll.provider.network.openstack.BaseNetworkProviderProxy.DEVICE_OWNER.equals ( port.getDeviceOwner ( ) ) ) && ( nic.getId ( ) . toString ( ) . equals ( port.getDeviceId ( ) ) ) ) { return port ; } } return null ; }

Target:
private com.woorea.openstack.quantum.model.Port locatePort ( org.ovirt.engine.core.common.businessentities.network.VmNic nic ) { java.util.List < com.woorea.openstack.quantum.model.Port > ports = execute ( getClient ( ) . ports ( ) . list ( ) ) . getList ( ) ; for ( com.woorea.openstack.quantum.model.Port port : ports ) { if ( ( org.ovirt.engine.core.bll.provider.network.openstack.BaseNetworkProviderProxy.DEVICE_OWNER.equals ( port.getDeviceOwner ( ) ) ) && ( nic.getId ( ) . toString ( ) . equals ( port.getDeviceId ( ) ) ) ) { return port ; } } return null ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.Disk createDisk ( org.ovirt.engine.core.compat.Guid id , boolean boot ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImageBase ( ) ; disk.setId ( id ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( id , null ) ) ; dve.setBoot ( boot ) ; disk.setDiskVmElements ( java.util.Collections.singletonList ( dve ) ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.Disk createDisk ( org.ovirt.engine.core.compat.Guid id , boolean boot ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setId ( id ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( id , null ) ) ; dve.setBoot ( boot ) ; disk.setDiskVmElements ( java.util.Collections.singletonList ( dve ) ) ; return disk ; }
Source:
public final void modifyPool ( org.ovirt.engine.core.common.businessentities.MacPool macPool ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { checkInitialized ( ) ; if ( ! ( macPools.containsKey ( macPool.getId ( ) ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.INEXISTENT_POOL_EXCEPTION_MESSAGE ) ; } removeWithoutLocking ( macPool.getId ( ) ) ; initializeMacPool ( macPool ) ; } }

Target:
public void modifyPool ( org.ovirt.engine.core.common.businessentities.MacPool macPool ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { if ( ! ( macPools.containsKey ( macPool.getId ( ) ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.INEXISTENT_POOL_EXCEPTION_MESSAGE ) ; } removeWithoutLocking ( macPool.getId ( ) ) ; initializeMacPool ( macPool ) ; } }
Source:
protected void initWidget ( T widget ) { super . initWidget ( widget ) ; widget.setModal ( true ) ; widget.setGlassEnabled ( true ) ; widget.addStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.resources.dialogBoxStyle ( ) . getName ( ) ) ; widget.addStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.POPUP_CONTENT_STYLE_NAME ) ; }

Target:
protected void initWidget ( T widget ) { super . initWidget ( widget ) ; widget.setModal ( true ) ; widget.setGlassEnabled ( true ) ; widget.addStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.POPUP_CONTENT_STYLE_NAME ) ; }
Source:
public static void isStorageDomainNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; return storageDomains.isEmpty ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Storage: name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) , aQuery ) ; }

Target:
public void isStorageDomainNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; return storageDomains.isEmpty ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Storage: name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) , aQuery ) ; }
Source:
public void cleanOrphanTasksWhenNoVolume ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 2 ] ) ) . when ( provider ) . getMonitoredTaskIDsInDB ( ) ; org.mockito.Mockito.doReturn ( getSteps ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 2 ] ) ) . when ( stepDao ) . getStepsByExternalId ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 2 ] ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 1 ) ) . endStepJob ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }

Target:
public void cleanOrphanTasksWhenNoVolume ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 2 ] ) ) . when ( provider ) . getMonitoredTaskIDsInDB ( ) ; org.mockito.Mockito.doReturn ( getSteps ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 2 ] ) ) . when ( stepDao ) . getStepsByExternalId ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 2 ] ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 1 ) ) . endStepJob ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void queryNetworks ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.setModel ( this ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { allNetworks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( returnValue ) ) ; initNetworkModels ( ) ; initDcNetworkParams ( ) ; queryInterfaces ( ) ; } } ; org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterNetworkList ( asyncQuery , vds.getVdsGroupId ( ) ) ; }

Target:
private void queryNetworks ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.setModel ( this ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { allNetworks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( returnValue ) ) ; queryInterfaces ( ) ; } } ; org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterNetworkList ( asyncQuery , vds.getVdsGroupId ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage_domains mockStorageDomain ( int availableSize , int usedSize , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.storage_domains sd = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; sd.setavailable_disk_size ( availableSize ) ; sd.setused_disk_size ( usedSize ) ; sd.setstatus ( StorageDomainStatus.Active ) ; sd.setstorage_type ( storageType ) ; return sd ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StorageDomain mockStorageDomain ( int availableSize , int usedSize , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setavailable_disk_size ( availableSize ) ; sd.setused_disk_size ( usedSize ) ; sd.setstatus ( StorageDomainStatus.Active ) ; sd.setstorage_type ( storageType ) ; return sd ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase createDefaultConcreteException ( java.lang.String errorMessage ) { org.ovirt.engine.core.common.businessentities.storage_domains domainFromDb = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( domainFromDb == null ) || ( ( domainFromDb.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return new org.ovirt.engine.core.vdsbroker.irsbroker.IrsOperationFailedNoFailoverException ( errorMessage ) ; } return super . createDefaultConcreteException ( errorMessage ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase createDefaultConcreteException ( java.lang.String errorMessage ) { org.ovirt.engine.core.common.businessentities.StorageDomain domainFromDb = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( domainFromDb == null ) || ( ( domainFromDb.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return new org.ovirt.engine.core.vdsbroker.irsbroker.IrsOperationFailedNoFailoverException ( errorMessage ) ; } return super . createDefaultConcreteException ( errorMessage ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( parameters.getActionType ( ) , parameters ) ; command.insertAsyncTaskPlaceHolders ( ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }
Source:
protected boolean canAddVm ( java.util.List < java.lang.String > reasons , java.lang.String name , org.ovirt.engine.core.compat.Guid storagePoolId , int vmPriority ) { if ( org.ovirt.engine.core.bll.AddVmCommand.isVmWithSameNameExists ( name ) ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED.name ( ) ) ; return false ; } if ( ! ( verifyAddVM ( reasons , vmPriority ) ) ) { return false ; } if ( ! ( checkTemplateImages ( reasons ) ) ) { return false ; } return true ; }

Target:
protected boolean canAddVm ( java.util.List < java.lang.String > reasons , java.lang.String name , org.ovirt.engine.core.compat.Guid storagePoolId , int vmPriority ) { if ( isVmWithSameNameExists ( name , storagePoolId ) ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED.name ( ) ) ; return false ; } if ( ! ( verifyAddVM ( reasons , vmPriority ) ) ) { return false ; } if ( ! ( checkTemplateImages ( reasons ) ) ) { return false ; } return true ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImages ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.Disk > diskImageList ) { if ( diskImageList == null ) { return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( vm.getId ( ) ) , true , false ) ; } return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( diskImageList , true , false ) ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImages ( org.ovirt.engine.core.compat.Guid vmId , java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.Disk > diskImageList ) { if ( diskImageList == null ) { return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( vmId ) , true , false ) ; } return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( diskImageList , true , false ) ; }
Source:
private void fillConnectionDetailsIfNeeded ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { if ( ( connection.geIid ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections dbConnection = org.ovirt.engine.core.bll.storage.connection.ISCSIStorageHelper.findConnectionWithSameDetails ( connection ) ; if ( dbConnection != null ) { connection.setId ( dbConnection.geIid ( ) ) ; } } }

Target:
private void fillConnectionDetailsIfNeeded ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { if ( ( connection.getId ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections dbConnection = org.ovirt.engine.core.bll.storage.connection.ISCSIStorageHelper.findConnectionWithSameDetails ( connection ) ; if ( dbConnection != null ) { connection.setId ( dbConnection.getId ( ) ) ; } } }
Source:
protected org.ovirt.engine.core.common.businessentities.aaa.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser entity = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setFirstName ( NAMES [ index ] ) ; entity.setGroupNames ( new java.util.LinkedList < java.lang.String > ( java.util.Arrays.asList ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.GROUPS.split ( "," ) ) ) ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.aaa.DOMAIN ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.aaa.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser entity = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setFirstName ( NAMES [ index ] ) ; entity.setGroupNames ( new java.util.LinkedList ( java.util.Arrays.asList ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.GROUPS.split ( "," ) ) ) ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.aaa.DOMAIN ) ; return entity ; }
Source:
public static void initDiskHotpluggableInterfacesMap ( ) { 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.diskHotpluggableInterfacesMap = ( ( java.util.Map < org.ovirt.engine.core.common.utils.Pair < java.lang.Integer , org.ovirt.engine.core.compat.Version > , java.util.Set < java.lang.String > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDiskHotpluggableInterfacesMap ) , callback ) ; }

Target:
public static void initDiskHotpluggableInterfacesMap ( ) { 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.diskHotpluggableInterfacesMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDiskHotpluggableInterfacesMap ) , callback ) ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) , aQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkIsSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , true , iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , createQos ( ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkIsSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , true , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , createQos ( ) ) ; }
Source:
public void testVmPayloadMapToPaylod ( ) { org.ovirt.engine.core.common.businessentities.VmPayload vmPayload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; vmPayload.setDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType.CDROM ) ; vmPayload.setVolumeId ( "CD-VOL" ) ; org.ovirt.engine.api.model.Payload payload = org.ovirt.engine.api.restapi.types.VmMapper.map ( vmPayload , null ) ; assertEquals ( vmPayload.getDeviceType ( ) . name ( ) . toLowerCase ( ) , payload.getType ( ) ) ; assertEquals ( vmPayload.getVolumeId ( ) , payload.getVolumeId ( ) ) ; }

Target:
public void testVmPayloadMapToPaylod ( ) { org.ovirt.engine.core.common.businessentities.VmPayload vmPayload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; vmPayload.setDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType.CDROM ) ; vmPayload.setVolumeId ( "CD-VOL" ) ; org.ovirt.engine.api.model.Payload payload = org.ovirt.engine.api.restapi.types.VmMapper.map ( vmPayload , null ) ; assertEquals ( vmPayload.getDeviceType ( ) . name ( ) , payload.getType ( ) . name ( ) ) ; assertEquals ( vmPayload.getVolumeId ( ) , payload.getVolumeId ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel poolDiskListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel ) ( model ) ) ; poolDiskListModel.setVM ( vm ) ; poolDiskListModel.SyncSearch ( ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel poolDiskListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel ) ( model ) ) ; poolDiskListModel.setVM ( vm ) ; poolDiskListModel.SyncSearch ( ) ; } }
Source:
private void mockDependencies ( ) { org.mockito.Mockito.doReturn ( glusterUtils ) . when ( getQuery ( ) ) . getGlusterUtils ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( glusterUtils ) . getUpServer ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQueryTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( "test-vol" ) . when ( getQuery ( ) ) . getGlusterVolumeName ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQueryTest.VOLUME_ID ) ; org.mockito.Mockito.doReturn ( getBrick ( ) ) . when ( brickDao ) . getById ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
private void mockDependencies ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( glusterUtils ) . getUpServer ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQueryTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( "test-vol" ) . when ( getQuery ( ) ) . getGlusterVolumeName ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQueryTest.VOLUME_ID ) ; org.mockito.Mockito.doReturn ( getBrick ( ) ) . when ( brickDao ) . getById ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }