auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.common.businessentities.Permissions list ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.Permissions > permissions = new java.util.TreeSet < org.ovirt.engine.core.common.businessentities.Permissions > ( new org.ovirt.engine.api.restapi.resource.BackendAssignedPermissionsResource.PermissionsComparator ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > directPermissions = getBackendCollection ( queryType , queryParams ) ; permissions.addAll ( directPermissions ) ; if ( queryType.equals ( VdcQueryType.GetPermissionsForObject ) ) { permissions.addAll ( getInheritedPermissions ( ) ) ; } return mapCollection ( permissions ) ; }

Target:
public org.ovirt.engine.api.model.Permissions list ( ) { java.util.Set < org.ovirt.engine.api.model.Permissions > permissions = new java.util.TreeSet ( new org.ovirt.engine.api.restapi.resource.BackendAssignedPermissionsResource.PermissionsComparator ( ) ) ; java.util.List < org.ovirt.engine.api.model.Permissions > directPermissions = getBackendCollection ( queryType , queryParams ) ; permissions.addAll ( directPermissions ) ; if ( queryType.equals ( VdcQueryType.GetPermissionsForObject ) ) { permissions.addAll ( getInheritedPermissions ( ) ) ; } return mapCollection ( permissions ) ; }
Source:
public org.ovirt.engine.core.compat.Guid findActiveISODomain ( org.ovirt.engine.core.compat.Guid storagePoolId ) { return new org.ovirt.engine.core.compat.Guid ( ) ; }

Target:
public void testVmNotDuringInitialization ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , true , null ) ; }
Source:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallback ) { persistCommand ( parentCommand , getContext ( ) , enableCallback ) ; }
Source:
public void makeSortable ( ) { makeSortable ( new java.util.Comparator < org.ovirt.engine.ui.uicommonweb.models.storage.LunModel > ( ) { @ java.lang.Override public int compare ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel o1 , org.ovirt.engine.ui.uicommonweb.models.storage.LunModel o2 ) { int val1 = o1.getAdditionalAvailableSize ( ) ; int val2 = o2.getAdditionalAvailableSize ( ) ; return java.lang.Integer.compare ( val1 , val2 ) ; } } ) ; }

Target:
public void makeSortable ( ) { makeSortable ( java.util.Comparator.comparingInt ( LunModel :: getAdditionalAvailableSize ) ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.VdcOption option ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "option_name" , option.getoption_name ( ) ) . addValue ( "option_value" , option.getoption_value ( ) ) . addValue ( "version" , option.getversion ( ) ) . addValue ( "option_id" , option.getoption_id ( ) ) ; getCallsHandler ( ) . executeModification ( "InsertVdcOption" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.VdcOption option ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "option_name" , option.getOptionName ( ) ) . addValue ( "option_value" , option.getOptionValue ( ) ) . addValue ( "version" , option.getVersion ( ) ) . addValue ( "option_id" , option.getOptionId ( ) ) ; getCallsHandler ( ) . executeModification ( "InsertVdcOption" , parameterSource ) ; }
Source:
protected void migrateVM ( final org.ovirt.engine.core.common.businessentities.VM vmToMigrate ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate.getId ( ) ) ; backend.runInternalAction ( VdcActionType.MigrateVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
protected void migrateVM ( final org.ovirt.engine.core.common.businessentities.VM vmToMigrate ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate.getId ( ) ) ; parameters.setReason ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessage ( AuditLogType.MIGRATION_REASON_AFFINITY_ENFORCEMENT ) ) ; backend.runInternalAction ( VdcActionType.MigrateVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public void bondWithNoSlaves ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; mockExistingIfaces ( bond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( bond ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }

Target:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { stopProgress ( ) ; cancel ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( ( succeeded ? ( ( org.ovirt.engine.core.compat.Guid ) ( retVal.getActionReturnValue ( ) ) ) : null ) , succeeded ) ; }
Source:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetCinderVolumeTypesByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? java.util.Collections.emptyList ( ) : getCinderVolumeTypes ( ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetCinderVolumeTypesByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? java.util.Collections.emptyList ( ) : getCinderVolumeTypes ( ) ) ) ; }
Source:
public boolean awaitVdsmResponse ( ) { final int checks = ( org.ovirt.engine.core.bll.network.NetworkConfigurator.VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS ) / ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SetupNetworksPollingTimeout ) ) ; for ( int i = 0 ; i < checks ; i ++ ) { if ( pollVds ( ) ) { org.ovirt.engine.core.bll.network.NetworkConfigurator.log.infoFormat ( "Engine managed to communicate with VDSM agent on host {0}" , host.getName ( ) , host.getId ( ) ) ; return true ; } } return false ; }

Target:
public boolean awaitVdsmResponse ( ) { final int checks = ( org.ovirt.engine.core.bll.network.NetworkConfigurator.VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS ) / ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SetupNetworksPollingTimeout ) ) ; for ( int i = 0 ; i < checks ; i ++ ) { if ( pollVds ( ) ) { org.ovirt.engine.core.bll.network.NetworkConfigurator.log.infoFormat ( "Engine managed to communicate with VDSM agent on host {0}" , host.getName ( ) , host.getId ( ) ) ; return true ; } else { delayPolling ( ) ; } } return false ; }
Source:
public void onVirtualMachineSelectionChange ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.VirtualMachineSelectionChangeEvent event ) { updateMainTabSelection ( event.getSelectedItems ( ) ) ; currentSelectedVm = null ; if ( ( ( event.getSelectedItems ( ) ) != null ) && ( ! ( event.getSelectedItems ( ) . isEmpty ( ) ) ) ) { currentSelectedVm = event.getSelectedItems ( ) . get ( 0 ) ; } updateModel ( ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; updateModel ( ) ; }
Source:
protected boolean IsValidExportDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains domain = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDAO ( ) . getForStoragePool ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; if ( ( domain != null ) && ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return true ; } return false ; }

Target:
protected boolean isValidExportDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains domain = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getForStoragePool ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; if ( ( domain != null ) && ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return true ; } return false ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "EntityId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getMaxNumOfVmCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void validateNoFreeSpaceOnDomains ( ) { mcr.mockConfigValue ( ConfigValues.FreeSpaceCriticalLowInGB , 100 ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void validateInsufficientSpaceOnDomains ( ) { setupForStorageTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyList ( ) ) ; }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
public void testConflictedUpdate ( ) { setUpGetEntityExpectations ( 2 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) { setUpGetEntityExpectations ( 2 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void addQuotaPermissionSubject ( java.util.List < org.ovirt.engine.core.common.PermissionSubject > quotaPermissionList ) { if ( ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getStoragePool ( ) ) != null ) && ( ( getQuotaId ( ) ) != null ) ) && ( ! ( org.ovirt.engine.core.bll.AddDiskCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) . equals ( QuotaEnforcementTypeEnum.DISABLED ) ) ) ) { quotaPermissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , org.ovirt.engine.core.common.businessentities.ActionGroup.CONSUME_QUOTA ) ) ; } }

Target:
public void addQuotaPermissionSubject ( java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > quotaPermissionList ) { if ( ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getStoragePool ( ) ) != null ) && ( ( getQuotaId ( ) ) != null ) ) && ( ! ( org.ovirt.engine.core.bll.AddDiskCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) . equals ( QuotaEnforcementTypeEnum.DISABLED ) ) ) ) { quotaPermissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , org.ovirt.engine.core.common.businessentities.ActionGroup.CONSUME_QUOTA ) ) ; } }
Source:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMClearTask , new org.ovirt.engine.core.common.vdscommands.HSMTaskGuidBaseVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; if ( ( returnValue != null ) && ( ! ( returnValue.getSucceeded ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getVDSReturnValue ( ) . setVdsError ( returnValue.getVdsError ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; } }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = resourceManager.runVdsCommand ( VDSCommandType.HSMClearTask , new org.ovirt.engine.core.common.vdscommands.HSMTaskGuidBaseVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; if ( ( returnValue != null ) && ( ! ( returnValue.getSucceeded ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getVDSReturnValue ( ) . setVdsError ( returnValue.getVdsError ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; } }
Source:
protected void executeCommand ( ) { if ( removeImages ( ) ) { if ( ( org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) ) { org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getImage ( ) . setActive ( true ) ; org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getImage ( ) . getImage ( ) ) ; } org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( removeImages ( ) ) { if ( ( org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) ) { org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getImage ( ) . setActive ( true ) ; imageDao.update ( org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getImage ( ) . getImage ( ) ) ; } org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.setSucceeded ( true ) ; } }
Source:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult verifyDisks ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imageList , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.Guid > imageToDestinationDomainMap ) { if ( ( ! ( params.isImportAsNewEntity ( ) ) ) && ( ! ( params.isImagesExistOnTargetStorageDomain ( ) ) ) ) { return checkIfDisksExist ( imageList , imageToDestinationDomainMap ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePool getStoragePool ( ) { if ( ( cachedStoragePool ) == null ) { cachedStoragePool = getStoragePoolDao ( ) . get ( params.getStoragePoolId ( ) ) ; } return cachedStoragePool ; }
Source:
public boolean exists ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid snapshotId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) . addValue ( "snapshot_id" , snapshotId ) ; return getCallsHandler ( ) . executeRead ( "CheckIfSnapshotExistsByVmIdAndSnapshotId" , createBooleanMapper ( ) , parameterSource ) ; }

Target:
public boolean exists ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid snapshotId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) . addValue ( "snapshot_id" , snapshotId ) ; return getCallsHandler ( ) . executeRead ( "CheckIfSnapshotExistsByVmIdAndSnapshotId" , org.springframework.jdbc.core.SingleColumnRowMapper.newInstance ( java.lang.Boolean.class ) , parameterSource ) ; }
Source:
public void testCanDoActionEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmHostCanLiveMerge ( ) ; mockDisksList ( 4 ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; }

Target:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmHostCanLiveMerge ( ) ; mockDisksList ( 4 ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetGlusterBrickById , org.ovirt.engine.core.common.queries.gluster.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBrickResourceTest.brickId } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetGlusterBrickById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBrickResourceTest.brickId } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > Get64bitOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008R2x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; }

Target:
private static void initOsIds ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds = new java.util.ArrayList < java.lang.Integer > ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.keySet ( ) ) ; java.util.Collections.sort ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds , new java.util.Comparator < java.lang.Integer > ( ) { @ java.lang.Override public int compare ( java.lang.Integer o1 , java.lang.Integer o2 ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o1 ) . compareTo ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o2 ) ) ; } } ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getBroker ( ) . glusterVolumeGeoRepConfigReset ( org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getParameters ( ) . getSlaveHost ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getParameters ( ) . getSlaveVolume ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getParameters ( ) . getConfigKey ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getBroker ( ) . glusterVolumeGeoRepConfigReset ( org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getParameters ( ) . getSlaveHost ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getParameters ( ) . getSlaveVolume ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getParameters ( ) . getConfigKey ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.getParameters ( ) . getUserName ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeGeoRepConfigDefaultVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
protected void selectedItemsChanged ( ) { super . selectedItemsChanged ( ) ; UpdateActionAvailability ( ) ; }

Target:
public void postUpdateVmTemplate ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; } }
Source:
public void checkShowLocks ( ) { org.junit.Assert.assertTrue ( lockManager.acquireLock ( lockLock1 ) . getFirst ( ) ) ; org.junit.Assert.assertTrue ( lockManager.acquireLock ( lockLock2 ) . getFirst ( ) ) ; org.junit.Assert.assertEquals ( 2 , lockManager.showAllLocks ( ) . size ( ) ) ; lockManager.clear ( ) ; org.junit.Assert.assertTrue ( lockManager.showAllLocks ( ) . isEmpty ( ) ) ; }

Target:
public void checkShowLocks ( ) { org.junit.jupiter.api.Assertions.assertTrue ( lockManager.acquireLock ( lockLock1 ) . getFirst ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( lockManager.acquireLock ( lockLock2 ) . getFirst ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , lockManager.showAllLocks ( ) . size ( ) ) ; lockManager.clear ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( lockManager.showAllLocks ( ) . isEmpty ( ) ) ; }
Source:
protected void initStorageDomainId ( ) { }

Target:
public void setUp ( ) { org.mockito.Mockito.when ( iconDefaultsProvider.getVmIconDefaults ( ) ) . thenReturn ( new java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > ( ) { { put ( 0 , new org.ovirt.engine.core.common.queries.VmIconIdSizePair ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "00000000-0000-0000-0000-00000000000a" ) , org.ovirt.engine.core.compat.Guid.createGuidFromString ( "00000000-0000-0000-0000-00000000000b" ) ) ) ; } } ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.utils.ovf.OvfVmIconDefaultsProvider.class , iconDefaultsProvider ) ; }
Source:
private org.ovirt.engine.api.model.Hooks mapCollection ( java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > > hooksMap ) { org.ovirt.engine.api.model.Hooks hooks = mappingLocator.getMapper ( java.util.HashMap.class , org.ovirt.engine.api.model.Hooks.class ) . map ( hooksMap , null ) ; return hooks ; }

Target:
private org.ovirt.engine.api.model.Hooks mapCollection ( java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > > hooksMap ) { org.ovirt.engine.api.model.Hooks hooks = getMapper ( java.util.HashMap.class , org.ovirt.engine.api.model.Hooks.class ) . map ( hooksMap , null ) ; for ( org.ovirt.engine.api.model.Hook hook : hooks.getHooks ( ) ) { addLinks ( hook ) ; } return hooks ; }
Source:
private boolean interfaceOrItsVlanDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( java.util.Set < java.lang.String > removedNetworkAttachmentsNicNames , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface potentialSlave ) { boolean validSlave = interfaceDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( removedNetworkAttachmentsNicNames , potentialSlave ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlanInterfacesForInterface = vlanInterfacesForInterface ( potentialSlave ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface : vlanInterfacesForInterface ) { validSlave = validSlave && ( interfaceDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( removedNetworkAttachmentsNicNames , vdsNetworkInterface ) ) ; } return validSlave ; }

Target:
private boolean isNicActuallyExistsOrReferencesNewBond ( java.lang.String nicName , org.ovirt.engine.core.compat.Guid nicId ) { return hostSetupNetworksValidatorHelper.isNicActuallyExistsOrReferencesNewBond ( existingInterfacesMap , bondsMap , nicName , nicId ) ; }
Source:
public void hostNameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }

Target:
public void hostNameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }
Source:
private void setCookie ( final javax.servlet.http.HttpServletResponse response , final javax.servlet.ServletContext servletContext , final java.util.Locale userLocale ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , userLocale.toString ( ) ) ; cookie.setPath ( org.ovirt.engine.core.utils.servlet.LocaleFilter.ROOT_PATH ) ; cookie.setMaxAge ( java.lang.Integer.MAX_VALUE ) ; cookie.setHttpOnly ( true ) ; response.addCookie ( cookie ) ; }

Target:
private void setCookie ( final javax.servlet.http.HttpServletResponse response , final javax.servlet.ServletContext servletContext , final java.util.Locale userLocale ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , userLocale.toString ( ) ) ; cookie.setSecure ( true ) ; cookie.setPath ( org.ovirt.engine.core.utils.servlet.LocaleFilter.ROOT_PATH ) ; cookie.setMaxAge ( java.lang.Integer.MAX_VALUE ) ; cookie.setHttpOnly ( true ) ; response.addCookie ( cookie ) ; }
Source:
private static void deleteFile ( java.lang.String filePath ) { java.io.File file = new java.io.File ( filePath ) ; if ( file.exists ( ) ) { file.delete ( ) ; } }

Target:
private static void deleteFile ( java.lang.String filePath ) { java.io.File file = new java.io.File ( filePath ) ; if ( file.exists ( ) ) { if ( ! ( file.delete ( ) ) ) { org.ovirt.engine.core.domains.ManageDomains.log.info ( ( ( "Failed deleting file " + ( file.getAbsolutePath ( ) ) ) + ". Continuing anyway." ) ) ; } } }
Source:
private org.ovirt.engine.api.extensions.ExtMap mapLdapGroup ( org.ovirt.engine.core.common.businessentities.LdapGroup group ) { org.ovirt.engine.api.extensions.ExtMap result = new org.ovirt.engine.api.extensions.ExtMap ( ) ; result.mput ( Authz.GroupRecord.ID , group.getid ( ) ) . mput ( Authz.GroupRecord.NAMESPACE , org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapAuthz.NAMESPACE ) . mput ( Authz.GroupRecord.NAME , group.getname ( ) ) ; return result ; }

Target:
private org.ovirt.engine.api.extensions.ExtMap mapLdapGroup ( org.ovirt.engine.core.common.businessentities.aaa.LdapGroup group ) { org.ovirt.engine.api.extensions.ExtMap result = new org.ovirt.engine.api.extensions.ExtMap ( ) ; result.mput ( Authz.GroupRecord.ID , group.getid ( ) ) . mput ( Authz.GroupRecord.NAMESPACE , org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapAuthz.NAMESPACE ) . mput ( Authz.GroupRecord.NAME , group.getname ( ) ) ; return result ; }
Source:
public void testAddHostedEngineStorageFails ( ) { parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }

Target:
public void testAddHostedEngineStorageFails ( ) { parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }
Source:
public void testExistingDiscardAfterDeleteFunctionalityPreservedNoDiscardAfterDeleteFunctionality ( ) { storageDomain.setDiscardAfterDelete ( false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingDiscardAfterDeleteFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , false ) , createLunWithDiscardFunctionality ( 0L , true ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public static void GetVmNicList ( 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 != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmNicList ( 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 != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void unmanagedVlanNetworkWithVmNetworkDenied ( ) { 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 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanNic = createVlan ( nic.getName ( ) , net2.getVlanId ( ) , net2.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , vlanNic ) ) ; validateAndExpectViolation ( helper , EngineMessage.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 , 100 , net2.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , fakeVlanNic ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target2 , java.lang.Object returnValue2 ) { java.lang.Object [ ] array2 = ( ( java.lang.Object [ ] ) ( target2 ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel listModel2 = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel ) ( array2 [ 0 ] ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter2 = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( array2 [ 1 ] ) ) ; boolean addDatacenter2 = ( ( dataCenter2.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) && ( returnValue2 == null ) ; listModel2.AddToAttachCandidateDatacenters ( dataCenter2 , addDatacenter2 ) ; }

Target:
public void onSuccess ( java.lang.Object target2 , java.lang.Object returnValue2 ) { java.lang.Object [ ] array2 = ( ( java.lang.Object [ ] ) ( target2 ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel listModel2 = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel ) ( array2 [ 0 ] ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter2 = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( array2 [ 1 ] ) ) ; boolean addDatacenter2 = ( ( dataCenter2.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) && ( returnValue2 == null ) ; listModel2.addToAttachCandidateDatacenters ( dataCenter2 , addDatacenter2 ) ; }
Source:
public static void removeVmDevices ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int numberOfDevicesToRemove ) { int size = devices.size ( ) ; for ( int index = 1 ; index <= numberOfDevicesToRemove ; index ++ ) { if ( size >= index ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( devices.get ( ( size - index ) ) . getId ( ) ) ; } } }

Target:
public static void removeVmDevices ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int numberOfDevicesToRemove ) { int size = devices.size ( ) ; for ( int index = 1 ; index <= numberOfDevicesToRemove ; index ++ ) { if ( size >= index ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.vmDeviceDao.remove ( devices.get ( ( size - index ) ) . getId ( ) ) ; } } }