auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void setupForStorageTests ( ) { org.mockito.Mockito.doReturn ( multipleSdValidator ) . when ( command ) . getStorageDomainsValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anySetOf ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.DiskImage.class ) ) ; }

Target:
protected void setupForStorageTests ( ) { org.mockito.Mockito.doReturn ( multipleSdValidator ) . when ( command ) . getStorageDomainsValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anySetOf ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
public void canDoActionNoDisksSpecified ( ) { initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED.toString ( ) ) ) ; }

Target:
public void validateNoDisksSpecified ( ) { initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , null ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED.toString ( ) ) ) ; }
Source:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void updateHaAvailability ( ) { boolean automaticMigrationAllowed = ( getModel ( ) . getMigrationMode ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ; if ( ! automaticMigrationAllowed ) { getModel ( ) . getIsHighlyAvailable ( ) . setChangeProhibitionReason ( constants.hostNonMigratable ( ) ) ; getModel ( ) . getIsHighlyAvailable ( ) . setEntity ( false ) ; } getModel ( ) . getIsHighlyAvailable ( ) . setIsChangable ( automaticMigrationAllowed ) ; }

Target:
public void updateHaAvailability ( ) { boolean automaticMigrationAllowed = ( getModel ( ) . getMigrationMode ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ; if ( ! automaticMigrationAllowed ) { getModel ( ) . getIsHighlyAvailable ( ) . setChangeProhibitionReason ( constants.hostNonMigratable ( ) ) ; getModel ( ) . getIsHighlyAvailable ( ) . setEntity ( false ) ; } getModel ( ) . getIsHighlyAvailable ( ) . setIsChangeable ( automaticMigrationAllowed ) ; }
Source:
public java.lang.Integer runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . get ( taskId ) ; int retVal = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . remove ( taskId ) ; if ( ( asyncTask != null ) && ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( asyncTask.getCommandId ( ) ) ) ) ) { commandsCache.remove ( asyncTask.getCommandId ( ) ) ; } return retVal ; }

Target:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getAsyncTaskFromDb ( org.ovirt.engine.core.compat.Guid asyncTaskId ) { return coCoAsyncTaskHelper.getAsyncTaskFromDb ( asyncTaskId ) ; }
Source:
private void interfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; return ! ( siblingVlanInterfaces.isEmpty ( ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public void getExternalProviderHostGroupList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalHostGroup > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostGroupsFromExternalProvider , params , aQuery ) ; }
Source:
public void validateInsufficientSpaceOnDomains ( ) { setupForStorageTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void validateInsufficientSpaceOnDomains ( ) { setupForStorageTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( command.validate ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.core.compat.Guid id , int times ) { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetStoragePoolsByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { id } , org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplatesResourceTest.setUpStoragePool ( ) ) ; } }

Target:
private void setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.core.compat.Guid id , int times ) { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( QueryType.GetStoragePoolsByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { id } , org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplatesResourceTest.setUpStoragePool ( ) ) ; } }
Source:
public void testConfigDirWithFlagSet ( ) throws java.lang.Exception { final java.lang.String path = java.lang.ClassLoader.getSystemResource ( "engine-config.conf" ) . getPath ( ) ; junit.framework.Assert.assertNotNull ( path ) ; org.ovirt.engine.core.config.EngineConfig.main ( "-a" , ( "--config=" + path ) ) ; }

Target:
public void testConfigDirWithFlagSet ( ) throws java.lang.Exception { final java.lang.String path = java.net.URLDecoder.decode ( java.lang.ClassLoader.getSystemResource ( "engine-config.conf" ) . getPath ( ) , "UTF-8" ) ; junit.framework.Assert.assertNotNull ( path ) ; org.ovirt.engine.core.config.EngineConfig.main ( "-a" , ( "--config=" + path ) ) ; }
Source:
private void doTestRemoveNotFound ( java.lang.String id ) { initResource ( resource.parent ) ; resource.id = id ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } resource.id = "1" ; }

Target:
private void doTestRemoveNotFound ( java.lang.String id ) { initResource ( resource.parent ) ; resource.id = id ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: remove ) ) ; resource.id = "1" ; }
Source:
public java.lang.Object runInTransaction ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomainType sdType = getStorageDomain ( ) . getStorageDomainType ( ) ; map.setstatus ( StorageDomainStatus.Maintenance ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; if ( sdType == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } if ( ( sdType == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( sdType == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ) { updateStorageDomainFormat ( getStorageDomain ( ) ) ; } return null ; }

Target:
public java.lang.Object runInTransaction ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomainType sdType = getStorageDomain ( ) . getStorageDomainType ( ) ; map.setStatus ( StorageDomainStatus.Maintenance ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; if ( sdType == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } if ( ( sdType == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( sdType == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ) { updateStorageDomainFormat ( getStorageDomain ( ) ) ; } return null ; }
Source:
public void saveJob ( final org.ovirt.engine.core.common.job.Job job ) { jobDao.save ( job ) ; }

Target:
public void saveJob ( final org.ovirt.engine.core.common.job.Job job ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { jobDao.save ( job ) ; java.util.Set < java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > > entrySet = job.getJobSubjectEntities ( ) . entrySet ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entry : entrySet ) { jobSubjectEntityDao.save ( job.getId ( ) , entry.getKey ( ) , entry.getValue ( ) ) ; } return null ; } } ) ; }
Source:
protected boolean validateQuota ( ) { getParameters ( ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Disk dit : getVm ( ) . getDiskMap ( ) . values ( ) ) { ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( dit ) ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; } return true ; }

Target:
public org.ovirt.engine.core.compat.Guid getVmId ( ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { return getParameters ( ) . getVm ( ) . getId ( ) ; } else { return super . getVmId ( ) ; } }
Source:
public javax.ws.rs.core.Response remove ( java.lang.String id , org.ovirt.engine.api.model.Action action ) { getEntity ( id ) ; if ( ( action.isSetDetach ( ) ) && ( action.isDetach ( ) ) ) { return performAction ( VdcActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDettachVmDiskParameters ( parentId , org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( id ) ) ) ; } else { return remove ( id ) ; } }

Target:
public javax.ws.rs.core.Response remove ( java.lang.String id , org.ovirt.engine.api.model.Action action ) { getEntity ( id ) ; if ( ( action.isSetDetach ( ) ) && ( action.isDetach ( ) ) ) { return performAction ( VdcActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( parentId , org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( id ) ) ) ; } else { return remove ( id ) ; } }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.historyetl_3_2.HistoryETL.row1Struct.commonByteArrayLock ) { try { int length = 0 ; this . key = readString ( dis ) ; this . value = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.historyetl_3_2.HistoryETL.row1Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_HistoryETL ) { try { int length = 0 ; this . key = readString ( dis ) ; this . value = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }
Source:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( disk ) == null ) { retValue = false ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } if ( retValue ) { buildSharedLockMap ( ) ; retValue = org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ; } retValue = retValue && ( ( ( disk.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) || ( canRemoveDiskBasedOnImageStorageCheck ( ) ) ) ; return retValue ; }

Target:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( disk ) == null ) { retValue = false ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } if ( retValue ) { buildSharedLockMap ( ) ; retValue = org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ; } retValue = retValue && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? canRemoveDiskBasedOnImageStorageCheck ( ) : canRemoveLunDisk ( ) ) ; return retValue ; }
Source:
public void setItems ( java.lang.Iterable < T > value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.lang.Iterable < T > value , T selectedItem ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( selectedItem ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
public void Execute ( ) { java.lang.String logId = org.ovirt.engine.core.utils.log.LoggedUtils.getObjectId ( this ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logEntry ( log , logId , this ) ; try { ExecuteCommand ( ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , logId , this , getReturnValue ( ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.utils.log.LoggedUtils.logError ( log , logId , this , e ) ; java.lang.IllegalStateException ise = new java.lang.IllegalStateException ( ) ; ise.setStackTrace ( e.getStackTrace ( ) ) ; throw ise ; } }

Target:
public void execute ( ) { java.lang.String logId = org.ovirt.engine.core.utils.log.LoggedUtils.getObjectId ( this ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logEntry ( log , logId , this ) ; try { executeCommand ( ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , logId , this , getReturnValue ( ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.utils.log.LoggedUtils.logError ( log , logId , this , e ) ; java.lang.IllegalStateException ise = new java.lang.IllegalStateException ( ) ; ise.setStackTrace ( e.getStackTrace ( ) ) ; throw ise ; } }
Source:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isMigration , boolean isRequired , int index ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; networkCluster.setDisplay ( isDisplay ) ; networkCluster.setMigration ( isMigration ) ; networkCluster.setRequired ( isRequired ) ; org.mockito.Mockito.when ( entity.getCluster ( ) ) . thenReturn ( networkCluster ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }

Target:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isMigration , boolean isRequired , boolean isDefaultRoute , int index ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; networkCluster.setDisplay ( isDisplay ) ; networkCluster.setMigration ( isMigration ) ; networkCluster.setRequired ( isRequired ) ; networkCluster.setDefaultRoute ( isDefaultRoute ) ; org.mockito.Mockito.when ( entity.getCluster ( ) ) . thenReturn ( networkCluster ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }
Source:
private void mockVmValidator ( ) { org.ovirt.engine.core.bll.validator.VmValidator vmValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( command ) . createVmValidator ( vm ) ; org.mockito.Mockito.doReturn ( dbFacade ) . when ( vmValidator ) . getDbFacade ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( vmValidator ) . getDiskDao ( ) ; }

Target:
public void testMigrationPolicyChangeVmDown ( ) { prepareVmToPassCanDoAction ( ) ; vm.setStatus ( VMStatus.Down ) ; vm.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; vmStatic.setMigrationSupport ( MigrationSupport.MIGRATABLE ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
protected void setUpGetPayloadExpectations ( int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; }

Target:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }
Source:
public void buildVirtualSystem ( ) { _writer.WriteStartElement ( "Content" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "id" , "out" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.XSI_URI , "type" , ( ( OVF_PREFIX ) + ":VirtualSystem_Type" ) ) ; writeGeneralData ( ) ; writeAppList ( ) ; writeContentItems ( ) ; _writer.WriteEndElement ( ) ; }

Target:
public void buildVirtualSystem ( ) { _writer.writeStartElement ( "Content" ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "id" , "out" ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.XSI_URI , "type" , ( ( OVF_PREFIX ) + ":VirtualSystem_Type" ) ) ; writeGeneralData ( ) ; writeAppList ( ) ; writeContentItems ( ) ; _writer.writeEndElement ( ) ; }
Source:
private org.ovirt.engine.api.model.HostNIC clone ( org.ovirt.engine.api.model.HostNIC parent ) { org.ovirt.engine.api.model.HostNIC nic = new org.ovirt.engine.api.model.HostNIC ( ) ; nic.setId ( parent.getId ( ) ) ; nic.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; nic.getHost ( ) . setId ( parent.getHost ( ) . getId ( ) ) ; return nic ; }

Target:
private org.ovirt.engine.api.model.HostNic clone ( org.ovirt.engine.api.model.HostNic parent ) { org.ovirt.engine.api.model.HostNic nic = new org.ovirt.engine.api.model.HostNic ( ) ; nic.setId ( parent.getId ( ) ) ; nic.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; nic.getHost ( ) . setId ( parent.getHost ( ) . getId ( ) ) ; return nic ; }
Source:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.DetachNetworkFromClusterInternal , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToClusterCommand.getParameters ( ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval ( getPersistedNetwork ( ) ) ) { detachLabeledNetworksFromClusterHosts ( ) ; } } else { propagateFailure ( returnValue ) ; } }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.DetachNetworkFromClusterInternal , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToClusterCommand.getParameters ( ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval ( getPersistedNetwork ( ) ) ) { detachLabeledNetworksFromClusterHosts ( ) ; } } else { propagateFailure ( returnValue ) ; } }
Source:
private void initState ( ) { reportsEnabled = false ; xmlInitialized = false ; reportsWebappDeployed = false ; scheduledStatusCheckInProgress = false ; initEventRaised = false ; reportBaseUrl = "" ; reportRightClickUrl = "" ; isCommunityEdition = false ; resourceMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Resource > ( ) ; dashboardMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Dashboard > ( ) ; reportsInitEvent = new org.ovirt.engine.ui.uicompat.Event ( "ReportsInitialize" , org.ovirt.engine.ui.uicommonweb.ReportInit.class ) ; retryCount = 0 ; }

Target:
private void initState ( ) { reportsEnabled = false ; xmlInitialized = false ; reportsWebappDeployed = false ; scheduledStatusCheckInProgress = false ; initEventRaised = false ; reportBaseUrl = "" ; reportRightClickUrl = "" ; isCommunityEdition = false ; resourceMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Resource > ( ) ; dashboardMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Dashboard > ( ) ; reportsInitEvent = new org.ovirt.engine.ui.uicompat.Event < org.ovirt.engine.ui.uicompat.EventArgs > ( "ReportsInitialize" , org.ovirt.engine.ui.uicommonweb.ReportInit.class ) ; retryCount = 0 ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { 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.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Vm model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Vm model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; verifyLinks ( model ) ; }
Source:
private org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Boolean > updateVdsNetworksInTx ( ) { return new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( getVds ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; } } ; }

Target:
private org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Boolean > updateVdsNetworksInTx ( ) { return new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectHostNetworkDataVdsCommandParameters ( getVds ( ) , getInterfaces ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; } } ; }
Source:
public void creationTimestampIsInThePast ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permission > vmPermissions = dao.getAllForEntity ( org.ovirt.engine.core.dao.PermissionDaoTest.VM_ENTITY_ID ) ; for ( org.ovirt.engine.core.common.businessentities.Permission perms : vmPermissions ) { org.junit.Assert.assertTrue ( ( ( perms.getCreationDate ( ) ) < ( java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( java.lang.System.currentTimeMillis ( ) ) ) ) ) ; } }

Target:
public void creationTimestampIsInThePast ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permission > vmPermissions = dao.getAllForEntity ( org.ovirt.engine.core.dao.PermissionDaoTest.VM_ENTITY_ID ) ; for ( org.ovirt.engine.core.common.businessentities.Permission perms : vmPermissions ) { org.junit.jupiter.api.Assertions.assertTrue ( ( ( perms.getCreationDate ( ) ) < ( java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( java.lang.System.currentTimeMillis ( ) ) ) ) ) ; } }
Source:
public void clearDeviceAddress ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertTrue ( org.apache.commons.lang.StringUtils.isNotBlank ( vmDevice.getAddress ( ) ) ) ; dao.clearDeviceAddress ( getExistingEntityId ( ) . getDeviceId ( ) ) ; org.junit.Assert.assertTrue ( org.apache.commons.lang.StringUtils.isBlank ( dao.get ( getExistingEntityId ( ) ) . getAddress ( ) ) ) ; }

Target:
public void clearDeviceAddress ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = dao.get ( getExistingEntityId ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( org.apache.commons.lang.StringUtils.isNotBlank ( vmDevice.getAddress ( ) ) ) ; dao.clearDeviceAddress ( getExistingEntityId ( ) . getDeviceId ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( org.apache.commons.lang.StringUtils.isBlank ( dao.get ( getExistingEntityId ( ) ) . getAddress ( ) ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlanInterfacesForInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingInterface : existingInterfaces ) { if ( nic.getName ( ) . equals ( existingInterface.getBaseInterface ( ) ) ) { result.add ( existingInterface ) ; } } return result ; }

Target:
private boolean isNicActuallyExistsOrReferencesNewBond ( java.lang.String nicName , org.ovirt.engine.core.compat.Guid nicId ) { return hostSetupNetworksValidatorHelper.isNicActuallyExistsOrReferencesNewBond ( existingInterfacesMap , bondsMap , nicName , nicId ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getVmId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , null , true , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . isPlugUnPlug ( ) , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . isReadOnly ( ) , "" , null , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . getSnapshotId ( ) , null ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getVmId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , null , true , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . isPlugUnPlug ( ) , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getDiskVmElement ( ) . isReadOnly ( ) , "" , null , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . getSnapshotId ( ) , null ) ; }
Source:
private javax.ws.rs.core.Response performCreate ( org.ovirt.engine.api.model.ImageTransfer imageTransfer , org.ovirt.engine.core.common.action.TransferDiskImageParameters params ) { updateTransferType ( imageTransfer , params ) ; return performCreate ( ActionType.TransferDiskImage , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetImageTransferById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
private javax.ws.rs.core.Response performCreate ( org.ovirt.engine.api.model.ImageTransfer imageTransfer , org.ovirt.engine.core.common.action.TransferDiskImageParameters params ) { updateTransferType ( imageTransfer , params ) ; if ( ( imageTransfer.isSetHost ( ) ) && ( imageTransfer.getHost ( ) . isSetId ( ) ) ) { params.setVdsId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( imageTransfer.getHost ( ) . getId ( ) ) ) ; } return performCreate ( ActionType.TransferDiskImage , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetImageTransferById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void postOnNew ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValues != null ) && ( returnValues.stream ( ) . allMatch ( new org.ovirt.engine.ui.uicommonweb.Linq.ValidateSucceedPredicate ( ) ) ) ) { cancel ( ) ; } }

Target:
public void postOnNew ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValues != null ) && ( returnValues.stream ( ) . allMatch ( VdcReturnValueBase :: isValid ) ) ) { cancel ( ) ; } }
Source:
private void mockStoragePoolDAO ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { org.ovirt.engine.core.compat.Guid storagePoolId = getQueryParameters ( ) . getStoragePoolId ( ) ; if ( pool != null ) { pool.setId ( storagePoolId ) ; } org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAOMock.get ( storagePoolId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDAOMock ) ; }

Target:
private void mockStoragePoolDao ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { org.ovirt.engine.core.compat.Guid storagePoolId = getQueryParameters ( ) . getStoragePoolId ( ) ; if ( pool != null ) { pool.setId ( storagePoolId ) ; } org.ovirt.engine.core.dao.StoragePoolDao storagePoolDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDaoMock.get ( storagePoolId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDaoMock ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult canAddRngDevice ( org.ovirt.engine.core.common.businessentities.Cluster cluster , org.ovirt.engine.core.common.businessentities.VmRngDevice rngDevice ) { org.ovirt.engine.core.common.businessentities.VmRngDevice.Source source = rngDevice.getSource ( ) ; boolean supported = ( cluster != null ) && ( cluster.getRequiredRngSources ( ) . contains ( source ) ) ; if ( ! supported ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult canAddRngDevice ( org.ovirt.engine.core.common.businessentities.Cluster cluster , org.ovirt.engine.core.common.businessentities.VmRngDevice rngDevice ) { org.ovirt.engine.core.common.businessentities.VmRngDevice.Source source = rngDevice.getSource ( ) ; boolean supported = ( cluster != null ) && ( cluster.getRequiredRngSources ( ) . contains ( source ) ) ; if ( ! supported ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_GENERATOR_NOT_SUPPORTED_BY_CLUSTER ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void diskSnapshotsCannotBePreviewed ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( activeSnapshot ) ; org.mockito.Mockito.when ( diskImageDao.get ( disk1.getImageId ( ) ) ) . thenReturn ( disk1 ) ; org.mockito.Mockito.when ( diskImageDao.get ( disk2.getImageId ( ) ) ) . thenReturn ( disk2 ) ; org.junit.Assert.assertThat ( validator.canDiskSnapshotsBePreviewed ( activeSnapshot.getId ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_PREVIEW_ACTIVE_SNAPSHOT ) ) ; }

Target:
public void diskSnapshotsCannotBePreviewed ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( activeSnapshot ) ; org.mockito.Mockito.when ( diskImageDao.get ( disk1.getImageId ( ) ) ) . thenReturn ( disk1 ) ; org.mockito.Mockito.when ( diskImageDao.get ( disk2.getImageId ( ) ) ) . thenReturn ( disk2 ) ; org.hamcrest.MatcherAssert.assertThat ( validator.canDiskSnapshotsBePreviewed ( activeSnapshot.getId ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_PREVIEW_ACTIVE_SNAPSHOT ) ) ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel , org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel > getPoolVmListProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector ) { return new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel , org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel.class , org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getDetachCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
private void init ( ) { this . setIsAnimated ( TooltipConfig.IS_ANIMATED ) ; this . setPlacement ( TooltipConfig.PLACEMENT ) ; this . setIsHtml ( TooltipConfig.IS_HTML ) ; this . setTrigger ( TooltipConfig.TRIGGER ) ; this . setShowDelayMs ( TooltipConfig.SHOW_DELAY_MS ) ; this . setHideDelayMs ( TooltipConfig.HIDE_DELAY_MS ) ; this . setContainer ( TooltipConfig.CONTAINER ) ; }

Target:
public void setHtml ( com.google.gwt.safehtml.shared.SafeHtml html ) { assert html != null : "Tooltip HTML content cannot be null" ; if ( ( ( tooltip ) == null ) || ( ! ( tooltip.asString ( ) . equals ( html.asString ( ) ) ) ) ) { tooltip = html ; scheduleTooltipUpdate ( ) ; } }
Source:
public void testTypedArray ( ) throws java.lang.Exception { java.io.File file = writeConf ( "a=b,c" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedArray view = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedArray.class ) ; org.junit.Assert.assertNotNull ( view ) ; java.lang.String [ ] array = view.getA ( ) ; org.junit.Assert.assertNotNull ( array ) ; org.junit.Assert.assertEquals ( "b" , array [ 0 ] ) ; org.junit.Assert.assertEquals ( "c" , array [ 1 ] ) ; }

Target:
public void testTypedArray ( ) throws java.lang.Exception { java.io.File file = writeConf ( "a=b,c" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.jupiter.api.Assertions.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedArray view = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedArray.class ) ; org.junit.jupiter.api.Assertions.assertNotNull ( view ) ; java.lang.String [ ] array = view.getA ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( array ) ; org.junit.jupiter.api.Assertions.assertEquals ( "b" , array [ 0 ] ) ; org.junit.jupiter.api.Assertions.assertEquals ( "c" , array [ 1 ] ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > vmsIds ) { java.lang.Object [ ] uuids = vmsIds.stream ( ) . map ( Guid :: getUuid ) . toArray ( ) ; return getCallsHandler ( ) . executeReadList ( "GetVmsByIds" , org.ovirt.engine.core.dao.VmDaoImpl.VMRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vms_ids" , createArrayOf ( "uuid" , uuids ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > vmsIds ) { return getCallsHandler ( ) . executeReadList ( "GetVmsByIds" , org.ovirt.engine.core.dao.VmDaoImpl.VMRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vms_ids" , createArrayOfUUIDs ( vmsIds ) ) ) ; }
Source:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , java.lang.String path ) { 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_domains > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }

Target:
public static void GetClusterDesktopMemoryOverCommit ( 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public static void GetDocumentationBaseURL ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void IsDirectLunDiskEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DirectLUNDiskEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , aQuery ) ; }
Source:
public void testSetValidatorWithOutValue ( ) { org.ovirt.engine.core.config.EngineConfigMap engineConfigMap = org.mockito.Mockito.mock ( org.ovirt.engine.core.config.EngineConfigMap.class ) ; org.mockito.Mockito.when ( engineConfigMap.getKey ( ) ) . thenReturn ( "keyToSet" ) ; org.ovirt.engine.core.config.validation.ConfigActionType setAction = org.ovirt.engine.core.config.validation.ConfigActionType.ACTION_SET ; setAction.validate ( engineConfigMap ) ; }

Target:
public void testSetValidatorWithOutKey ( ) { org.ovirt.engine.core.config.EngineConfigMap engineConfigMap = org.mockito.Mockito.mock ( org.ovirt.engine.core.config.EngineConfigMap.class ) ; org.mockito.Mockito.when ( engineConfigMap.getValue ( ) ) . thenReturn ( "valueToSet" ) ; org.ovirt.engine.core.config.validation.ConfigActionType setAction = org.ovirt.engine.core.config.validation.ConfigActionType.ACTION_SET ; org.junit.jupiter.api.Assertions.assertThrows ( java.lang.IllegalArgumentException.class , ( ) -> setAction.validate ( engineConfigMap ) ) ; }