auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.common.businessentities.VDS setUpStatisticalExpectations ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VdsStatistics stats = control.createMock ( org.ovirt.engine.core.common.businessentities.VdsStatistics.class ) ; org.ovirt.engine.core.common.businessentities.VDS entity = control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpStatisticalEntityExpectations ( entity , stats ) ; setUpGetEntityExpectations ( 1 , false , entity ) ; control.replay ( ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS setUpStatisticalExpectations ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VdsStatistics stats = control.createMock ( org.ovirt.engine.core.common.businessentities.VdsStatistics.class ) ; org.ovirt.engine.core.common.businessentities.VDS entity = control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpStatisticalEntityExpectations ( entity , stats ) ; setUpGetEntityWithNoCertificateInfoExpectations ( 1 , false , entity ) ; control.replay ( ) ; return entity ; }
Source:
private void changeIsAttached ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkManageModel , java.lang.Boolean value ) { clusterNetworkManageModel.setAttached ( value ) ; if ( ( ! value ) && ( clusterNetworkManageModel.isDisplayNetwork ( ) ) ) { clusterNetworkManageModel.setDisplayNetwork ( false ) ; } if ( ( ! value ) && ( clusterNetworkManageModel.isRequired ( ) ) ) { clusterNetworkManageModel.setRequired ( false ) ; } }

Target:
protected void selectionChanged ( java.lang.Boolean value ) { for ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel : getNetworksTableItems ( ) ) { if ( canEditAssign ( clusterNetworkModel ) ) { changeIsAttached ( clusterNetworkModel , value ) ; } } refreshNetworksTable ( ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { domainsInPool = filterStorageDomains ( domainsInPool , disksList ) ; return domainsInPool.isEmpty ( ) ? null : domainsInPool.get ( 0 ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > vmDisks ) { domainsInPool = filterStorageDomains ( domainsInPool , memoryDisks ) ; sortStorageDomains ( domainsInPool , vmDisks ) ; return domainsInPool.isEmpty ( ) ? null : domainsInPool.get ( 0 ) ; }
Source:
public void testGetAllForNetworkHasNoPermission ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > result = dao.getAllForNetwork ( FixturesTool.NETWORK_ENGINE , org.ovirt.engine.core.dao.network.VnicProfileDaoTest.UNPRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }

Target:
public void testRemove ( ) { dao.save ( vnicProfile ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( vnicProfile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( vnicProfile.getId ( ) ) ; org.junit.Assert.assertNull ( dao.get ( vnicProfile.getId ( ) ) ) ; }
Source:
private boolean resizeDiskImageRequested ( ) { return ( ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) && ( ( vmDeviceForVm.getSnapshotId ( ) ) == null ) ) && ( ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ) ; }

Target:
public java.lang.String getDiskAlias ( ) { return getOldDisk ( ) . getDiskAlias ( ) ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.ProviderType providerType = org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getParameters ( ) . getProviderType ( ) ; if ( providerType == null ) { setReturnValue ( org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getDbFacade ( ) . getProviderDao ( ) . getAll ( ) ) ; } else { setReturnValue ( org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getDbFacade ( ) . getProviderDao ( ) . getAllByType ( providerType ) ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.ProviderType [ ] providerTypes = org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getParameters ( ) . getProviderTypes ( ) ; if ( providerTypes == null ) { setReturnValue ( org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getDbFacade ( ) . getProviderDao ( ) . getAll ( ) ) ; } else { setReturnValue ( org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getDbFacade ( ) . getProviderDao ( ) . getAllByTypes ( providerTypes ) ) ; } }
Source:
private void doTestBadAddNic ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { PARENT_ID } , canDo , success ) ) ; org.ovirt.engine.api.model.NIC model = getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddNic ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { PARENT_ID } , canDo , success ) ) ; org.ovirt.engine.api.model.Nic model = getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testRemoveNonExistant ( ) { setUpGetTagExpectations ( false ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetTagExpectations ( false ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createNotVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = getDiskImage ( ) ; disk.setActive ( true ) ; disk.setDiskInterface ( DiskInterface.IDE ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage createNotVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = getDiskImage ( ) ; disk.setActive ( true ) ; disk.setDiskInterface ( DiskInterface.IDE ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.mockito.Mockito.when ( osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.HashSet < java.lang.String > ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommandTest.DISK_HOTPLUGGABLE_INTERFACES ) ) ; return disk ; }
Source:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void getDataCenterList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
protected void SyncSearch ( ) { org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; tempVar.setRefresh ( getIsQueryFirstTime ( ) ) ; super . SyncSearch ( VdcQueryType.GetPermissionsForObject , tempVar ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; tempVar.setRefresh ( getIsQueryFirstTime ( ) ) ; super . syncSearch ( VdcQueryType.GetPermissionsForObject , tempVar ) ; }
Source:
protected void readBytes ( java.nio.ByteBuffer ibuff ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { int read = readBuffer ( ibuff ) ; if ( read <= 0 ) { return ; } ibuff.rewind ( ) ; byte [ ] message = new byte [ read ] ; ibuff.get ( message ) ; emitOnMessageReceived ( message ) ; this . ibuff = null ; }

Target:
private void processHeartbeat ( ) { if ( ( ( this . lastHeartbeat ) + ( this . policy.getHeartbeat ( ) ) ) < ( java.lang.System.currentTimeMillis ( ) ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.debug ( "Heartbeat exeeded. Closing channel" ) ; this . closeChannel ( ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.DiskImage img = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; img.setSizeInGigabytes ( size ) ; img.setActualSize ( size ) ; img.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; img.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return img ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setSizeInGigabytes ( size ) ; diskImage.setActualSize ( size ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return diskImage ; }
Source:
public void shouldDetectTooMuchHostNodes ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertValidationFailure ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_PREFERRED_NOT_PINNED_TO_SINGLE_NODE ) ; }

Target:
public void shouldDetectTooMuchHostNodes ( ) { vm.setvNumaNodeList ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertValidationFailure ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_PREFERRED_NOT_PINNED_TO_SINGLE_NODE ) ; }
Source:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommand.getVmStaticDAO ( ) . get ( getVm ( ) . getId ( ) ) ; if ( duplicateVm != null ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_EXISTS ) ; addCanDoActionMessage ( java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; return false ; } return true ; }

Target:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommand.getVmStaticDAO ( ) . get ( getVm ( ) . getId ( ) ) ; if ( duplicateVm != null ) { return failCanDoAction ( VdcBllMessages.VM_CANNOT_IMPORT_VM_EXISTS , java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; } return true ; }
Source:
protected void getDowntime ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.migrateDowntime ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = runVdsCommand ( VDSCommandType.MigrateStatus , new org.ovirt.engine.core.common.vdscommands.MigrateStatusVDSCommandParameters ( getDestinationVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ) ; if ( retVal != null ) { actualDowntime = ( ( java.lang.Integer ) ( retVal.getReturnValue ( ) ) ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { migrationErrorCode = e.getErrorCode ( ) ; } } }

Target:
protected void getDowntime ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.migrateDowntime ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getClusterCompatibilityVersion ( ) ) ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = runVdsCommand ( VDSCommandType.MigrateStatus , new org.ovirt.engine.core.common.vdscommands.MigrateStatusVDSCommandParameters ( getDestinationVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ) ; if ( retVal != null ) { actualDowntime = ( ( java.lang.Integer ) ( retVal.getReturnValue ( ) ) ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { migrationErrorCode = e.getErrorCode ( ) ; } } }
Source:
private void unlinkingTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , boolean networkLinkingSupported , boolean nicLinked ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.isLinked ( ) ) . thenReturn ( nicLinked ) ; org.junit.Assert.assertThat ( validator.linkedCorrectly ( ) , matcher ) ; }

Target:
private void unlinkingTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , boolean networkLinkingSupported , boolean nicLinked ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.isLinked ( ) ) . thenReturn ( nicLinked ) ; org.junit.Assert.assertThat ( validator.linkedOnlyIfSupported ( ) , matcher ) ; }
Source:
private void searchStringChanged ( ) { getBookmarkList ( ) . setSearchString ( getEffectiveSearchString ( ) ) ; }

Target:
private void searchStringChanged ( ) { org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel model = getSystemTree ( ) . getSelectedItem ( ) ; if ( ( model != null ) && ( model.getType ( ) . equals ( SystemTreeItemType.System ) ) ) { listModelSearchStringHistory.put ( getSelectedItem ( ) , getSearchString ( ) ) ; } getBookmarkList ( ) . setSearchString ( getEffectiveSearchString ( ) ) ; }
Source:
public void testOnlyDiskAliasChangedMetaDataShouldBeUpdated ( ) { final org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; parameters.getDiskInfo ( ) . setDiskAlias ( "New Disk Alias" ) ; initializeCommand ( parameters ) ; mockVdsCommandSetVolumeDescription ( ) ; command.executeVmCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.times ( 1 ) ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.SetVolumeDescription ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.SetVolumeDescriptionVDSCommandParameters.class ) ) ; }

Target:
public void testOnlyDiskAliasChangedMetaDataShouldBeUpdated ( ) { final org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; parameters.getDiskInfo ( ) . setDiskAlias ( "New Disk Alias" ) ; initializeCommand ( parameters ) ; mockVdsCommandSetVolumeDescription ( ) ; command.executeVmCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.times ( 1 ) ) . setVolumeDescription ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; }
Source:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getUsbPolicy ( ) , vm.getOs ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean validateGraphicsAndDisplay ( ) { return org.ovirt.engine.core.bll.VmHandler.isGraphicsAndDisplaySupported ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) . getOs ( ) , getGraphicsTypesForVm ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getReturnValue ( ) . getValidationMessages ( ) , getEffectiveCompatibilityVersion ( ) ) ; }
Source:
protected void isAllLunsSelectedChanged ( ) { }

Target:
protected void isAllLunsSelectedChanged ( ) { if ( ! ( getIsGrouppedByTarget ( ) ) ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.LunModel > items = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.LunModel > ) ( getItems ( ) ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel lun : items ) { if ( ( ! ( lun.getIsIncluded ( ) ) ) && ( lun.getIsAccessible ( ) ) ) { lun.setIsSelected ( getIsAllLunsSelected ( ) ) ; } } } }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel iface ) { driver.edit ( iface ) ; hideMacWhenNotEnabled ( iface ) ; iface.getMAC ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "IsAvailable" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ) ) { hideMacWhenNotEnabled ( iface ) ; } } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel iface ) { driver.edit ( iface ) ; hideMacWhenNotEnabled ( iface ) ; iface.getMAC ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "IsAvailable" . equals ( args.propertyName ) ) { hideMacWhenNotEnabled ( iface ) ; } } } ) ; }
Source:
private org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > spySearchQuery ( org.ovirt.engine.core.common.queries.SearchParameters searchParam ) { org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.SearchQuery ( searchParam ) ) ; mockInjections ( searchQuery ) ; return searchQuery ; }

Target:
public void testGetAllMultiDiskImageSearch ( ) throws java.lang.Exception { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Disks" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.Disk ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( diskImageResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public void testGetVmssIdsForOvfUpdateOneVm ( ) { dao.updateOvfGenerations ( java.util.Collections.singletonList ( FixturesTool.VM_RHEL5_POOL_50 ) , java.util.Collections.singletonList ( 0L ) , java.util.Collections.singletonList ( "a" ) ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guids = dao.getVmsIdsForOvfUpdate ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.Assert.assertEquals ( "one vm should need ovf update" , 1 , guids.size ( ) ) ; org.junit.Assert.assertEquals ( "wrong vm returned as in need for ovf update" , FixturesTool.VM_RHEL5_POOL_50 , guids.get ( 0 ) ) ; }

Target:
public void testGetVmssIdsForOvfUpdateOneVm ( ) { dao.updateOvfGenerations ( java.util.Collections.singletonList ( FixturesTool.VM_RHEL5_POOL_50 ) , java.util.Collections.singletonList ( 0L ) , java.util.Collections.singletonList ( "a" ) ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guids = dao.getVmsIdsForOvfUpdate ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , guids.size ( ) , "one vm should need ovf update" ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.VM_RHEL5_POOL_50 , guids.get ( 0 ) , "wrong vm returned as in need for ovf update" ) ; }
Source:
protected boolean performImagesChecks ( org.ovirt.engine.core.common.businessentities.VM vm ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( vm.getId ( ) , org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , vm.getStoragePoolId ( ) , getStorageDomainId ( ) . getValue ( ) , false , true , false , false , false , true , java.util.Collections.< org.ovirt.engine.core.common.businessentities.Disk > emptyList ( ) ) ; }

Target:
protected boolean performImagesChecks ( org.ovirt.engine.core.compat.Guid spId ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , spId , getStorageDomainId ( ) . getValue ( ) , false , true , false , false , false , true , java.util.Collections.< org.ovirt.engine.core.common.businessentities.Disk > emptyList ( ) ) ; }
Source:
public void executeCommandWhenFailed ( ) { setVolumeId ( volumeWithRemoveBricksTask ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStopFailed ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . endStepJobAborted ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_STOP_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setVolumeId ( volumeWithRemoveBricksTask ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStopFailed ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . endStepJobAborted ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . releaseVolumeLock ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_STOP_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void testListCrash ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; }
Source:
public void testGetLunsThatBreakPassDiscardFunctionalityPassDiscardBreaks ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardSupport = createLunWithDiscardFunctionality ( 0L , false ) ; assertGetLunsThatBreakPassDiscardFunctionalityContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , false ) , lunThatBreaksDiscardSupport ) , java.util.Collections.singletonList ( lunThatBreaksDiscardSupport ) ) ; }

Target:
public void testGetLunsThatBreakPassDiscardFunctionalityPassDiscardBreaks ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardSupport = createLunWithDiscardSupport ( 0L ) ; assertGetLunsThatBreakPassDiscardFunctionalityContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , lunThatBreaksDiscardSupport ) , java.util.Collections.singletonList ( lunThatBreaksDiscardSupport ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateNotHostedEngineDisk ( ) { boolean isHostedEngineDisk = ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) && ( StorageConstants.HOSTED_ENGINE_LUN_DISK_ALIAS.equals ( disk.getDiskAlias ( ) ) ) ; return isHostedEngineDisk ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_DISK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateNotHostedEngineDisk ( ) { boolean isHostedEngineDisk = ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.LUN ) ) && ( StorageConstants.HOSTED_ENGINE_LUN_DISK_ALIAS.equals ( disk.getDiskAlias ( ) ) ) ; return isHostedEngineDisk ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_DISK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createIdParameterMapper ( org.ovirt.engine.core.compat.Guid guid ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , guid ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQos ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource map = super . createFullParametersMapper ( networkQos ) ; map.addValue ( "inbound_average" , networkQos.getInboundAverage ( ) ) ; map.addValue ( "inbound_peak" , networkQos.getInboundPeak ( ) ) ; map.addValue ( "inbound_burst" , networkQos.getInboundBurst ( ) ) ; map.addValue ( "outbound_average" , networkQos.getOutboundAverage ( ) ) ; map.addValue ( "outbound_peak" , networkQos.getOutboundPeak ( ) ) ; map.addValue ( "outbound_burst" , networkQos.getOutboundBurst ( ) ) ; return map ; }
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.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getStorageDomainsWithAttachedStoragePoolGuid ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.StoragePool storagePool , java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { 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.StorageDomain > ( ) : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters parameters = new org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters ( storageDomains , storagePool.getId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsWithAttachedStoragePoolGuid , parameters , aQuery ) ; }
Source:
public static void isSoundcardEnabled ( 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 ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static 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 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected static void buildVmOnSave ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , vm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.FullUnitToVmBaseBuilder ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , vm , new org.ovirt.engine.ui.uicommonweb.builders.vm.VmSpecificUnitToVmBuilder ( ) ) ; }

Target:
private void onConfigureVmsToImport ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel importVmsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel ) ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) ) ; if ( importVmsModel == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel model = importVmsModel.getSpecificImportModel ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.setWindow ( null ) ; setWindow ( model ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > getTasksByEntity ( org.ovirt.engine.core.compat.Guid entityId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) ; parameterSource.addValue ( "entity_id" , entityId ) ; return getCallsHandler ( ) . executeReadList ( "GetAsyncTasksByEntityId" , org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.AsyncTaskRowMapper.instance , parameterSource ) ; }

Target:
public void insertAsyncTaskEntity ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.VdcObjectType entityType ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) ; parameterSource.addValue ( "task_id" , taskId ) . addValue ( "entity_id" , entityId ) . addValue ( "entity_type" , entityType ) ; getCallsHandler ( ) . executeModification ( "InsertAsyncTaskEntities" , parameterSource ) ; }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
private static void mapHostNetworkQosToModel ( org.ovirt.engine.core.common.businessentities.qos.QosBase entity , org.ovirt.engine.api.model.QoS model ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = org.ovirt.engine.api.restapi.types.QosMapper.verifyAndCast ( entity , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos.class ) ; if ( hostNetworkQos != null ) { model.setOutboundAverageLinkshare ( hostNetworkQos.getOutAverageLinkshare ( ) ) ; model.setOutboundAverageUpperlimit ( hostNetworkQos.getOutAverageUpperlimit ( ) ) ; model.setOutboundAverageRealtime ( hostNetworkQos.getOutAverageRealtime ( ) ) ; } }

Target:
private static void mapHostNetworkQosToModel ( org.ovirt.engine.core.common.businessentities.qos.QosBase entity , org.ovirt.engine.api.model.Qos model ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = org.ovirt.engine.api.restapi.types.QosMapper.verifyAndCast ( entity , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos.class ) ; if ( hostNetworkQos != null ) { model.setOutboundAverageLinkshare ( hostNetworkQos.getOutAverageLinkshare ( ) ) ; model.setOutboundAverageUpperlimit ( hostNetworkQos.getOutAverageUpperlimit ( ) ) ; model.setOutboundAverageRealtime ( hostNetworkQos.getOutAverageRealtime ( ) ) ; } }
Source:
public static void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , setUpFiles ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , setUpFiles ( ) , failure ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( checkRemoveEditValidations ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) . size ( ) ) > 0 ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( checkRemoveEditValidations ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) . size ( ) ) > 0 ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE , java.lang.String.format ( "$clusters %1$s" , clustersListIntoTokenizedString ( ) ) ) ; } return true ; }
Source:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getMacPool ( ) ) ; }

Target:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getValidationMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getMacPool ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { uniqueOsNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( uniqueOsNames ) ) ; }
Source:
public boolean isSearchValidForServerSideSorting ( ) { java.lang.String search = getSearchString ( ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer syntaxResult = getSyntaxChecker ( ) . analyzeSyntaxState ( search , true ) ; if ( ( syntaxResult.getError ( ) ) != ( org.ovirt.engine.core.searchbackend.SyntaxError.NO_ERROR ) ) { return false ; } for ( org.ovirt.engine.core.searchbackend.SyntaxObject syntaxObject : syntaxResult ) { if ( ( syntaxObject.getType ( ) ) == ( org.ovirt.engine.core.searchbackend.SyntaxObjectType.SORTBY ) ) { return false ; } } return true ; }

Target:
public boolean isSearchValidForServerSideSorting ( ) { org.ovirt.engine.core.searchbackend.ISyntaxChecker syntaxChecker = org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getConfigurator ( ) . getSyntaxChecker ( ) ; if ( syntaxChecker == null ) { return true ; } java.lang.String search = getSearchString ( ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer syntaxResult = syntaxChecker.analyzeSyntaxState ( search , true ) ; if ( ( syntaxResult.getError ( ) ) != ( org.ovirt.engine.core.searchbackend.SyntaxError.NO_ERROR ) ) { return false ; } for ( org.ovirt.engine.core.searchbackend.SyntaxObject syntaxObject : syntaxResult ) { if ( ( syntaxObject.getType ( ) ) == ( org.ovirt.engine.core.searchbackend.SyntaxObjectType.SORTBY ) ) { return false ; } } return true ; }