auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetFileDataStoreDns ( ) throws java.io.IOException { vmInit.setNetworks ( java.util.Collections.singletonList ( createVmInitNetwork ( ) ) ) ; vmInit.setDnsServers ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.DNS_SERVERS ) ; vmInit.setDnsSearch ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.DNS_SEARCH ) ; final java.util.Map < java.lang.String , byte [ ] > actual = underTest.getFileData ( ) ; final java.util.Map < java.lang.String , java.lang.Object > actualMetaData = parseResult ( actual ) ; assertDnsProperties ( actualMetaData ) ; }

Target:
public void testGetFileDataStoreDns ( ) throws java.io.IOException { vmInit.setNetworks ( java.util.Collections.singletonList ( createVmInitNetwork ( ) ) ) ; vmInit.setDnsServers ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.DNS_SERVERS ) ; vmInit.setDnsSearch ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.DNS_SEARCH ) ; final java.util.Map < java.lang.String , byte [ ] > actual = underTest.getFileData ( ) ; final java.util.Map < java.lang.String , java.lang.Object > actualMetaData = parseResult ( actual ) ; assertDnsProperties ( actualMetaData ) ; assertOpenstackNetworkDataFileNotCreated ( actual ) ; }
Source:
public void testChangeDiskProfileForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertThat ( "Same source and dest disk profile id, cannot perform test" , imageStorageDomainMap.getDiskProfileId ( ) , org.hamcrest.CoreMatchers.not ( org.hamcrest.CoreMatchers.equalTo ( FixturesTool.DISK_PROFILE_2 ) ) ) ; dao.updateDiskProfileByImageGroupIdAndStorageDomainId ( FixturesTool.IMAGE_GROUP_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DISK_PROFILE_2 ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertEquals ( "disk profile wasn't changed" , FixturesTool.DISK_PROFILE_2 , imageStorageDomainMap.getDiskProfileId ( ) ) ; }

Target:
public void testChangeDiskProfileForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.hamcrest.MatcherAssert.assertThat ( "Same source and dest disk profile id, cannot perform test" , imageStorageDomainMap.getDiskProfileId ( ) , org.hamcrest.CoreMatchers.not ( org.hamcrest.CoreMatchers.equalTo ( FixturesTool.DISK_PROFILE_2 ) ) ) ; dao.updateDiskProfileByImageGroupIdAndStorageDomainId ( FixturesTool.IMAGE_GROUP_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DISK_PROFILE_2 ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.DISK_PROFILE_2 , imageStorageDomainMap.getDiskProfileId ( ) , "disk profile wasn't changed" ) ; }
Source:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDAO ( ) . remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . remove ( iface.getId ( ) ) ; } }

Target:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . remove ( iface.getId ( ) ) ; } }
Source:
boolean checkRngDeviceClusterCompatibility ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > rngDevs = org.ovirt.engine.core.bll.RunVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) , VmDeviceGeneralType.RNG , VmDeviceType.VIRTIO.getName ( ) ) ; if ( ! ( rngDevs.isEmpty ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmRngDevice rngDev = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( rngDevs.get ( 0 ) ) ; if ( ! ( org.ovirt.engine.core.bll.RunVmCommand.getCluster ( ) . getRequiredRngSources ( ) . contains ( rngDev.getSource ( ) ) ) ) { return false ; } } return true ; }

Target:
boolean checkRngDeviceClusterCompatibility ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > rngDevs = vmDeviceDao.getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) , VmDeviceGeneralType.RNG , VmDeviceType.VIRTIO.getName ( ) ) ; if ( ! ( rngDevs.isEmpty ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmRngDevice rngDev = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( rngDevs.get ( 0 ) ) ; if ( ! ( org.ovirt.engine.core.bll.RunVmCommand.getCluster ( ) . getRequiredRngSources ( ) . contains ( rngDev.getSource ( ) ) ) ) { return false ; } } return true ; }
Source:
public void removeAllForVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > interfaces = dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertFalse ( interfaces.isEmpty ( ) ) ; dao.removeAllForVms ( java.util.Collections.singletonList ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ) ; interfaces = dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertTrue ( interfaces.isEmpty ( ) ) ; }

Target:
public void removeAllForVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > interfaces = dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 ) ; org.junit.Assert.assertFalse ( interfaces.isEmpty ( ) ) ; dao.removeAllForVms ( java.util.Collections.singletonList ( FixturesTool.VM_RHEL5_POOL_50 ) ) ; interfaces = dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 ) ; org.junit.Assert.assertTrue ( interfaces.isEmpty ( ) ) ; }
Source:
protected void executeCommand ( ) { initConnectionList ( true ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.storage.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > connectionToType : getConnectionsTypeMap ( ) . entrySet ( ) ) { disconnectStorageByType ( connectionToType.getKey ( ) , connectionToType.getValue ( ) ) ; } }

Target:
protected void executeCommand ( ) { initConnectionList ( true ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.storage.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > connectionToType : getConnectionsTypeMap ( ) . entrySet ( ) ) { disconnectStorageByType ( connectionToType.getKey ( ) , connectionToType.getValue ( ) ) ; } unregisterLibvirtSecrets ( ) ; }
Source:
public void testHasPeersTrue ( ) { org.junit.Assert.assertNotNull ( glusterUtil.getPeers ( client ) ) ; org.junit.Assert.assertEquals ( 2 , glusterUtil.getPeers ( client ) . size ( ) ) ; }

Target:
public void testHasPeersTrue ( ) { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.any ( java.util.Set.class ) ) ; org.junit.Assert.assertNotNull ( glusterUtil.getPeers ( client ) ) ; org.junit.Assert.assertEquals ( 2 , glusterUtil.getPeers ( client ) . size ( ) ) ; }
Source:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
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 > ( ) ; }
Source:
protected void executeIrsBrokerCommand ( ) { final P params = org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.getParameters ( ) ; final java.lang.String storagePoolId = params.getStoragePoolId ( ) . toString ( ) ; final java.lang.String targetVersion = params.getCompatibilityVersion ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.log.infoFormat ( "Upgrading storage pool {0} to version {1}" , storagePoolId , targetVersion ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.getIrsProxy ( ) . upgradeStoragePool ( storagePoolId , targetVersion ) ; org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { final P params = org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.getParameters ( ) ; final java.lang.String storagePoolId = params.getStoragePoolId ( ) . toString ( ) ; final java.lang.String targetVersion = params.getCompatibilityVersion ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.log.info ( "Upgrading storage pool '{}' to version '{}'." , storagePoolId , targetVersion ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.getIrsProxy ( ) . upgradeStoragePool ( storagePoolId , targetVersion ) ; org.ovirt.engine.core.vdsbroker.irsbroker.UpgradeStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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 ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public 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 ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > fetchUsersByIdsRecursively ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids ) { return org.ovirt.engine.core.aaa.DirectoryUtils.mapPrincipalRecords ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , org.ovirt.engine.core.aaa.AuthzUtils.fetchPrincipalsByIdsRecursively ( extension , namespace , ids ) ) ; }

Target:
public static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap principal ) { java.util.List < org.ovirt.engine.api.extensions.ExtMap > accumulator = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.aaa.DirectoryUtils.flatGroups ( accumulator , principal.get ( GroupRecord.GROUPS , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) ; principal.put ( GroupRecord.GROUPS , accumulator ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getSnapshot ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus.STARTED ) ) { failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_ACTIVATED , getSnapshot ( ) . getSnapshotName ( ) ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getSnapshot ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus.ACTIVATED ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_ACTIVATED , getSnapshot ( ) . getSnapshotName ( ) ) ; } return true ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.STATUS.equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ImageStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.DISK_TYPE.equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.class ) ; } else if ( ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.BOOTABLE.equals ( fieldName ) ) || ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.SHAREABLE.equals ( fieldName ) ) ) { return new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return null ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.STATUS.equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ImageStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.DISK_TYPE.equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.class ) ; } else if ( ( ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.BOOTABLE.equals ( fieldName ) ) || ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.SHAREABLE.equals ( fieldName ) ) ) || ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.WIPE_AFTER_DELETE.equals ( fieldName ) ) ) { return new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return null ; }
Source:
public void testIncompleteExport ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { control.replay ( ) ; resource.doExport ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "doExport" , "storageDomain.id|name" ) ; } }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void doPolling ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.common.businessentities.V2VJobInfo job = getV2VJobInfo ( ) ; if ( job == null ) { getCommand ( cmdId ) . setCommandStatus ( CommandStatus.FAILED ) ; return ; } switch ( job.getStatus ( ) ) { case STARTING : case COPYING_DISK : break ; case DONE : getCommand ( cmdId ) . setCommandStatus ( CommandStatus.SUCCEEDED ) ; break ; case ERROR : case ABORTED : getCommand ( cmdId ) . setCommandStatus ( CommandStatus.FAILED ) ; break ; case UNKNOWN : case INITIALIZE : } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.ConvertVmCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.ConvertVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_STARTING_CONVERT_VM : org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; case END_SUCCESS : return org.ovirt.engine.core.bll.ConvertVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM : org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; } return super . getAuditLogTypeValue ( ) ; }
Source:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( dbFacadeMock ) . getStoragePoolDao ( ) ; setupCpu ( ) ; validateFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }

Target:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; initAndAssertValidation ( true ) ; }
Source:
protected void addValuesToLog ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { }

Target:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > getNetworkToAttachment ( org.ovirt.engine.core.compat.Guid hostId ) { if ( ! ( networkToAttachmentByHostId.containsKey ( hostId ) ) ) { networkToAttachmentByHostId.put ( hostId , new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( networkAttachmentDao.getAllForHost ( hostId ) ) . byNetworkId ( ) ) ; } return networkToAttachmentByHostId.get ( hostId ) ; }
Source:
private void handleCopyResult ( org.ovirt.engine.core.common.businessentities.storage.DiskImage srcDiskImage , org.ovirt.engine.core.common.businessentities.storage.DiskImage copiedDiskImage , org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.VolumeCreationError ) ; } else { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( copiedDiskImage ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getTaskIdList ( ) . addAll ( result.getInternalVdsmTaskIdList ( ) ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getSrcDiskIdToTargetDiskIdMapping ( ) . put ( srcDiskImage.getId ( ) , copiedDiskImage.getId ( ) ) ; } }

Target:
private void handleCopyResult ( org.ovirt.engine.core.common.businessentities.storage.DiskImage srcDiskImage , org.ovirt.engine.core.common.businessentities.storage.DiskImage copiedDiskImage , org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.VolumeCreationError ) ; } else { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( copiedDiskImage ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getTaskIdList ( ) . addAll ( result.getInternalVdsmTaskIdList ( ) ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getSrcDiskIdToTargetDiskIdMapping ( ) . put ( srcDiskImage.getId ( ) , copiedDiskImage.getId ( ) ) ; } }
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.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
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.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getMaster ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setBonded ( true ) ; entity.setBootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getMaster ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity.setBonded ( true ) ; entity.setBootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec ) { return setVmTicket ( vmId , otp64 , sec , "" , new java.util.HashMap < java.lang.String , java.lang.String > ( ) ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc allocateVolume ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String volUUID , java.lang.String size ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.allocate" ) . withParameter ( "volumeID" , volUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "size" , size ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) . size ( ) ) == 0 ) { promptNoQuotaInDCMessage ( ) ; } else { OnSaveInternal ( ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) . size ( ) ) == 0 ) { promptNoQuotaInDCMessage ( ) ; } else { onSaveInternal ( ) ; } }
Source:
public void testGetAllForStoragePoolAndStatus ( ) { org.junit.Assert.assertNotNull ( existingVds.getStatus ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllForStoragePoolAndStatus ( existingVds.getStoragePoolId ( ) , existingVds.getStatus ( ) ) ; assertCorrectGetAllResult ( result ) ; }

Target:
public void testGetAllForStoragePoolAndStatusesForAllStatuses ( ) { prepareHostWithDifferentStatus ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllForStoragePoolAndStatuses ( existingVds.getStoragePoolId ( ) , null ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.VDSStatus > statuses = java.util.EnumSet.noneOf ( org.ovirt.engine.core.common.businessentities.VDSStatus.class ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { statuses.add ( vds.getStatus ( ) ) ; } assertCorrectGetAllResult ( result ) ; org.junit.Assert.assertTrue ( "more than one different status expected" , ( ( statuses.size ( ) ) > 1 ) ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > queryDirectoryGroups ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > directoryGroups = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipalRecords ( extension , namespace , filter , groupsResolving , groupsResolvingRecursive ) ) { directoryGroups.add ( org.ovirt.engine.core.aaa.DirectoryUtils.mapGroupRecordToDirectoryGroup ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , group ) ) ; } return directoryGroups ; }

Target:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > queryDirectoryGroups ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > directoryGroups = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : org.ovirt.engine.core.aaa.AuthzUtils.queryGroupRecords ( extension , namespace , filter , groupsResolving , groupsResolvingRecursive ) ) { directoryGroups.add ( org.ovirt.engine.core.aaa.DirectoryUtils.mapGroupRecordToDirectoryGroup ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , group ) ) ; } return directoryGroups ; }
Source:
private void initStoragePool ( ) { storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; command.setStorageDomain ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }
Source:
private void SleepOnReboot ( final org.ovirt.engine.core.common.businessentities.VDSStatus status ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ServerRebootTimeout ) ; log.infoFormat ( "Waiting {0} seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , status ) ) ; }

Target:
private void SleepOnReboot ( final org.ovirt.engine.core.common.businessentities.VDSStatus status ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ServerRebootTimeout ) ; log.info ( "Waiting seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , status ) ) ; }
Source:
public static void IsCustomPropertiesAvailable ( 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 tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportCustomProperties ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void GetHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void connect ( ) { boolean sslTarget = ( ( consoleOptions.getSecurePort ( ) ) == ( - 1 ) ) ? false : true ; org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.SpiceHtml5Impl.CLIENT_PAGE , config , getHost ( ) , java.lang.String.valueOf ( ( sslTarget ? consoleOptions.getSecurePort ( ) : consoleOptions.getPort ( ) ) ) , getPassword ( ) , sslTarget ) ; invoker.invokeClient ( ) ; }

Target:
public void invokeClient ( ) { boolean sslTarget = ( ( consoleOptions.getSecurePort ( ) ) == ( - 1 ) ) ? false : true ; int port = ( sslTarget ) ? consoleOptions.getSecurePort ( ) : consoleOptions.getPort ( ) ; org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.SpiceHtml5Impl.CLIENT_PAGE , config , getOptions ( ) . getHost ( ) , port , getOptions ( ) . getTicket ( ) , sslTarget ) ; invoker.invokeClient ( ) ; }
Source:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.ExportVmCommand.endActionOnAllImageGroups ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.UnLockVm ( vm ) ; endDiskRelatedActions ( vm ) ; if ( org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getCopyCollapse ( ) ) { endCopyCollapseOperations ( vm ) ; } else { updateSnapshotOvf ( vm ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.ExportVmCommand.endActionOnAllImageGroups ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.unLockVm ( vm ) ; endDiskRelatedActions ( vm ) ; if ( org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getCopyCollapse ( ) ) { endCopyCollapseOperations ( vm ) ; } else { updateSnapshotOvf ( vm ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator createHostSetupNetworksValidator ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingInterfaces ) { return new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) , existingInterfaces , null , new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networks ) , managementNetworkUtil ) ; }

Target:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator createHostSetupNetworksValidator ( org.ovirt.engine.core.common.action.HostSetupNetworksParameters params , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingIfaces , java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > existingAttachments , java.util.Collection < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { return new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setHost ( host ) . setParams ( params ) . setExistingInterfaces ( existingIfaces ) . setExistingAttachments ( existingAttachments ) . addNetworks ( networks ) . build ( ) ; }
Source:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNotNullAndBootProtocolIsNotStatic ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) . ipConfiguredForStaticBootProtocol ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) . ipConfiguredForStaticBootProtocol ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNotNullAndBootProtocolIsNone ( ) throws java.lang.Exception { doTestIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNotNullForBootProtocol ( NetworkBootProtocol.NONE ) ; }
Source:
private void addIpv4BootProtocol ( java.util.Map < java.lang.String , java.lang.Object > opts , org.ovirt.engine.core.common.vdscommands.HostNetwork attachment ) { switch ( attachment.getIpv4BootProtocol ( ) ) { case DHCP : opts.put ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.BOOT_PROTOCOL , org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.DHCP_BOOT_PROTOCOL ) ; break ; case STATIC_IP : org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "ipaddr" , attachment.getIpv4Address ( ) ) ; putPrefixOrNetmaskIfNotEmpty ( opts , attachment.getIpv4Netmask ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "gateway" , attachment.getIpv4Gateway ( ) ) ; break ; default : break ; } }

Target:
private void addIpv4BootProtocol ( java.util.Map < java.lang.String , java.lang.Object > opts , org.ovirt.engine.core.common.vdscommands.HostNetwork attachment ) { switch ( attachment.getIpv4BootProtocol ( ) ) { case DHCP : opts.put ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.BOOT_PROTOCOL , org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.DHCP_BOOT_PROTOCOL ) ; break ; case STATIC_IP : org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "ipaddr" , attachment.getIpv4Address ( ) ) ; putIpv4PrefixOrNetmaskIfNotEmpty ( opts , attachment.getIpv4Netmask ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "gateway" , attachment.getIpv4Gateway ( ) ) ; break ; default : break ; } }
Source:
public static void getAttachedTagsToUserGroup ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTagsByUserGroupId , new org.ovirt.engine.core.common.queries.GetTagsByUserGroupIdParameters ( id.toString ( ) ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isBoot ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.bootableDisk ( ) ) ; } return null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; return disk.isShareable ( ) ? org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmDiskAttachPopupWidget.resources.shareableDiskIcon ( ) : null ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
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 ) ; }

Target:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected void unregisterLibvirtSecret ( ) { if ( ( getStorageDomain ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsInStatusUp = getAllRunningVdssInPool ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hostsInStatusUp ) { org.ovirt.engine.core.bll.storage.connection.CINDERStorageHelper.unregisterLibvirtSecrets ( getStorageDomain ( ) , vds , java.util.Collections.singletonList ( getParameters ( ) . getLibvirtSecret ( ) ) ) ; } } else { log.info ( "Libvirt secret '{}' hasn't been unregistered since storage domain '{}' is not Active" , getParameters ( ) . getLibvirtSecret ( ) . getId ( ) , getStorageDomain ( ) . getName ( ) ) ; } }

Target:
protected void unregisterLibvirtSecret ( ) { if ( ( getStorageDomain ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsInStatusUp = getAllRunningVdssInPool ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hostsInStatusUp ) { cinderStorageHelper.unregisterLibvirtSecrets ( getStorageDomain ( ) , vds , java.util.Collections.singletonList ( getParameters ( ) . getLibvirtSecret ( ) ) ) ; } } else { log.info ( "Libvirt secret '{}' hasn't been unregistered since storage domain '{}' is not Active" , getParameters ( ) . getLibvirtSecret ( ) . getId ( ) , getStorageDomain ( ) . getName ( ) ) ; } }
Source:
private void vmNotHavingPassthroughVnicsCommon ( org.ovirt.engine.core.compat.Guid vmId , int numOfPassthroughVnic , int numOfRegularVnics ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vnics = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < numOfPassthroughVnic ; ++ i ) { vnics.add ( mockVnic ( true ) ) ; } for ( int i = 0 ; i < numOfRegularVnics ; ++ i ) { vnics.add ( mockVnic ( false ) ) ; } org.mockito.Mockito.when ( vmNetworkInterfaceDao.getAllForVm ( vmId ) ) . thenReturn ( vnics ) ; }

Target:
public void allPassthroughVnicsMigratableForRegularVnics ( ) { mockVnics ( createRegularNics ( 2 ) ) ; assertThatAllPassthroughVnicsMigratable ( true ) ; }
Source:
public void toggleChangeability ( boolean value ) { getName ( ) . setIsChangable ( value ) ; getCidr ( ) . setIsChangable ( value ) ; getIpVersion ( ) . setIsChangable ( value ) ; getGateway ( ) . setIsChangable ( value ) ; getDnsServers ( ) . setIsChangable ( value ) ; }

Target:
public void toggleChangeability ( boolean value ) { getName ( ) . setIsChangeable ( value ) ; getCidr ( ) . setIsChangeable ( value ) ; getIpVersion ( ) . setIsChangeable ( value ) ; getGateway ( ) . setIsChangeable ( value ) ; getDnsServers ( ) . setIsChangeable ( value ) ; }