auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.StorageConnectionExtension storageConnectionExtension ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = org.ovirt.engine.api.restapi.types.StorageServerConnectionExtensionMapper.map ( storageConnectionExtension , null ) ; connExt.setHostId ( hostId ) ; org.ovirt.engine.core.common.action.StorageServerConnectionExtensionParameters params = new org.ovirt.engine.core.common.action.StorageServerConnectionExtensionParameters ( connExt ) ; return performCreate ( ActionType.AddStorageServerConnectionExtension , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStorageServerConnectionExtensionById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.StorageConnectionExtension storageConnectionExtension ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = org.ovirt.engine.api.restapi.types.StorageServerConnectionExtensionMapper.map ( storageConnectionExtension , null ) ; connExt.setHostId ( hostId ) ; org.ovirt.engine.core.common.action.StorageServerConnectionExtensionParameters params = new org.ovirt.engine.core.common.action.StorageServerConnectionExtensionParameters ( connExt ) ; return performCreate ( ActionType.AddStorageServerConnectionExtension , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetStorageServerConnectionExtensionById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType , boolean forceRefresh ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > repoList = null ; if ( ! ( isStorageDomainValid ( storageDomainId , imageType , forceRefresh ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.GetIsoListError ) ; } repoList = getCachedIsoListByDomainId ( storageDomainId , imageType ) ; return repoList ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType , boolean forceRefresh ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > repoList = null ; if ( ! ( isStorageDomainValid ( storageDomainId , imageType , forceRefresh ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.GetIsoListError ) ; } repoList = getCachedIsoListByDomainId ( storageDomainId , imageType ) ; return repoList ; }
Source:
public void ResetIrs ( ) { nullifyInternalProxies ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( _storagePoolId ) ; if ( storagePool != null ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }

Target:
public void resetIrs ( ) { nullifyInternalProxies ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( _storagePoolId ) ; if ( storagePool != null ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomain ( boolean removeStorageDomainFromList ) { filter = new org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainFilter ( ) { @ java.lang.Override protected org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.StorageDomain > getPredicate ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { return predicate ; } } ; org.mockito.Mockito.when ( predicate.eval ( storageDomain ) ) . thenReturn ( ( ! removeStorageDomainFromList ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = java.util.Arrays.asList ( storageDomain ) ; return filter.filterStorageDomains ( storageDomains , memoryDisks ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomain ( boolean removeStorageDomainFromList ) { filter = new org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainFilter ( ) { @ java.lang.Override protected java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.StorageDomain > getPredicate ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { return predicate ; } } ; org.mockito.Mockito.when ( predicate.test ( storageDomain ) ) . thenReturn ( ( ! removeStorageDomainFromList ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = java.util.Arrays.asList ( storageDomain ) ; return filter.filterStorageDomains ( storageDomains , memoryDisks ) ; }
Source:
public void testGetAbsoluteKey ( ) 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.Configuration view = config.getView ( "a" ) ; org.junit.Assert.assertNotNull ( view ) ; org.junit.Assert.assertEquals ( "a.b" , view.getAbsoluteKey ( "b" ) ) ; }

Target:
public void testGetAbsoluteKey ( ) 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.Configuration view = config.getView ( "a" ) ; org.junit.jupiter.api.Assertions.assertNotNull ( view ) ; org.junit.jupiter.api.Assertions.assertEquals ( "a.b" , view.getAbsoluteKey ( "b" ) ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { setWindow ( null ) ; setWindow ( importVmsModel ) ; }

Target:
private void onConfigureVmsToImport ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel importVmsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel ) ( getWindow ( ) ) ) ; if ( importVmsModel == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel model = importVmsModel.getSpecificImportModel ( ) ; setWindow ( null ) ; setWindow ( model ) ; }
Source:
private static void addBootProtocol ( java.util.Map < java.lang.String , java.lang.Object > entry , org.ovirt.engine.core.common.businessentities.VDS host , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { org.ovirt.engine.core.vdsbroker.vdsbroker.BootProtocolResolver resolver = ( org.ovirt.engine.core.common.FeatureSupported.cfgEntriesDeprecated ( host.getClusterCompatibilityVersion ( ) ) ) ? new org.ovirt.engine.core.vdsbroker.vdsbroker.NoCfgBootProtocolResolver ( entry , iface ) : new org.ovirt.engine.core.vdsbroker.vdsbroker.CfgBootProtocolResolver ( entry , iface ) ; resolver.resolve ( ) ; }

Target:
static java.lang.String extractIpv6Address ( java.lang.String address ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( address ) ) { return null ; } final java.util.regex.Matcher matcher = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.IPV6_ADDRESS_CAPTURE_PATTERN.matcher ( address ) ; return matcher.matches ( ) ? matcher.group ( 1 ) : address ; }
Source:
public boolean isSpiceProxyDefined ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.SpiceProxyDefault ) ) ) ) ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getVdsGroupSpiceProxy ( ) ) ) ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getVmPoolSpiceProxy ( ) ) ) ) ; }

Target:
public boolean isSpiceProxyDefined ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.SpiceProxyDefault ) ) ) ) ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getClusterSpiceProxy ( ) ) ) ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getVmPoolSpiceProxy ( ) ) ) ) ; }
Source:
protected boolean acquireLockInternal ( ) { final boolean acquireLock = super . acquireLockInternal ( ) ; if ( ( ( ! acquireLock ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isAutoStartup ( ) ) ) { org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmToRun ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmId ( ) ) ; } return acquireLock ; }

Target:
private java.lang.String getMemoryFromSnapshot ( ) { if ( memoryFromSnapshotUsed ) { return org.apache.commons.lang.StringUtils.EMPTY ; } if ( ( cachedMemoryVolumeFromSnapshot ) == null ) { cachedMemoryVolumeFromSnapshot = ( org.ovirt.engine.core.common.FeatureSupported.memorySnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ? getActiveSnapshot ( ) . getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; } return cachedMemoryVolumeFromSnapshot ; }
Source:
public void testUpdateFieldsNameInStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; src.setInterfaces ( new java.util.ArrayList < > ( 2 ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertFalse ( "Update should not be valid for different names" , vmHandler.isUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsNameInStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; src.setInterfaces ( new java.util.ArrayList < > ( 2 ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( vmHandler.isUpdateValid ( src , dest ) , "Update should not be valid for different names" ) ; }
Source:
public void setDisplayNetwork ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model , boolean value ) { if ( ! ( isMultiCluster ( ) ) ) { if ( value ) { if ( ( getDisplayNetwork ( ) ) != null ) { getDisplayNetwork ( ) . setDisplayNetwork ( false ) ; } } else { managementNetwork.setDisplayNetwork ( true ) ; } } model.setDisplayNetwork ( value ) ; }

Target:
public void setDisplayNetwork ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model , boolean value ) { if ( ! ( isMultiCluster ( ) ) ) { if ( value ) { if ( ( getDisplayNetwork ( ) ) != null ) { getDisplayNetwork ( ) . setDisplayNetwork ( false ) ; } } else { getManagementNetwork ( ) . setDisplayNetwork ( true ) ; } } model.setDisplayNetwork ( value ) ; }
Source:
protected void onAction ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel network = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ; if ( network.isManaged ( ) ) { item.edit ( ) ; } else { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperationFactory.OperationMap operationMap = item.getSetupModel ( ) . commandsFor ( item ) ; final org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand detach = operationMap.get ( NetworkOperation.DETACH_NETWORK ) . get ( 0 ) ; item.getSetupModel ( ) . onOperation ( NetworkOperation.DETACH_NETWORK , detach ) ; } }

Target:
protected void onAction ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel network = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ; if ( network.isManaged ( ) ) { item.edit ( ) ; } else { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperationFactory.OperationMap operationMap = item.getSetupModel ( ) . commandsFor ( item ) ; final org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand detach = operationMap.get ( NetworkOperation.REMOVE_UNMANAGED_NETWORK ) . get ( 0 ) ; item.getSetupModel ( ) . onOperation ( NetworkOperation.REMOVE_UNMANAGED_NETWORK , detach ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.isIscsiMultipathingSupported ( org.ovirt.engine.core.bll.storage.AddIscsiBondCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ISCSI_BOND_NOT_SUPPORTED ) ; } org.ovirt.engine.core.bll.validator.IscsiBondValidator validator = new org.ovirt.engine.core.bll.validator.IscsiBondValidator ( ) ; return ( ( validate ( validator.iscsiBondWithTheSameNameExistInDataCenter ( getIscsiBond ( ) ) ) ) && ( validate ( validator.validateAddedLogicalNetworks ( getIscsiBond ( ) ) ) ) ) && ( validate ( validator.validateAddedStorageConnections ( getIscsiBond ( ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.isIscsiMultipathingSupported ( org.ovirt.engine.core.bll.storage.AddIscsiBondCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ISCSI_BOND_NOT_SUPPORTED ) ; } org.ovirt.engine.core.bll.validator.IscsiBondValidator validator = new org.ovirt.engine.core.bll.validator.IscsiBondValidator ( ) ; return ( ( validate ( validator.iscsiBondWithTheSameNameExistInDataCenter ( getIscsiBond ( ) ) ) ) && ( validate ( validator.validateAddedLogicalNetworks ( getIscsiBond ( ) ) ) ) ) && ( validate ( validator.validateAddedStorageConnections ( getIscsiBond ( ) ) ) ) ; }
Source:
protected org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand createCommand ( boolean validationSucceeds , boolean executionSucceeds ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; returnValueBase.setValid ( validationSucceeds ) ; returnValueBase.setSucceeded ( executionSucceeds ) ; org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand command = new org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand ( returnValueBase ) ; return org.mockito.Mockito.spy ( command ) ; }

Target:
protected org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand createCommand ( boolean validationSucceeds , boolean executionSucceeds ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValueBase = new org.ovirt.engine.core.common.action.ActionReturnValue ( ) ; returnValueBase.setValid ( validationSucceeds ) ; returnValueBase.setSucceeded ( executionSucceeds ) ; org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand command = new org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand ( returnValueBase ) ; return org.mockito.Mockito.spy ( command ) ; }
Source:
protected void init ( ) { super . init ( ) ; resource.getParent ( ) . backend = backend ; resource.getParent ( ) . sessionHelper = sessionHelper ; resource.getParent ( ) . mappingLocator = resource.mappingLocator ; resource.getParent ( ) . httpHeaders = httpHeaders ; resource.getParent ( ) . messageBundle = messageBundle ; }

Target:
protected void init ( ) { super . init ( ) ; resource.getParent ( ) . backend = backend ; resource.getParent ( ) . sessionHelper = sessionHelper ; resource.getParent ( ) . mappingLocator = resource.mappingLocator ; resource.getParent ( ) . httpHeaders = httpHeaders ; resource.getParent ( ) . messageBundle = messageBundle ; mockOsRepository ( ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetTagsExpectations ( false ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetTagsExpectations ( false ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpGetEntityExpectations ( 2 ) ; setupGetHostExpectations ( 2 ) ; setupGetNetworkExpectations ( 2 ) ; setupUpdateExpectations ( ) ; verifyUpdate ( resource.update ( getHostNicModel ( 1 ) ) , 1 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpGetEntityExpectations ( 2 ) ; setupGetHostExpectations ( 2 ) ; setupGetNetworkExpectations ( 2 ) ; setGetVfToPfMapExpectations ( 1 ) ; setupUpdateExpectations ( ) ; verifyUpdate ( resource.update ( getHostNicModel ( 1 ) ) , 1 ) ; }
Source:
public void setUp ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateMetadataDevices ( ) ; }

Target:
public void setUp ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateMetadataDevices ( ) ; }
Source:
protected void runAddAndVerify ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , boolean addMacResult , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.when ( macPoolManager.addMac ( iface.getMacAddress ( ) ) ) . thenReturn ( addMacResult ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , false ) ; verifyAddDelegatedCorrectly ( iface , addMacVerification ) ; }

Target:
protected void runAddAndVerify ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface , boolean addMacResult , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.when ( macPoolManager.addMac ( iface.getMacAddress ( ) ) ) . thenReturn ( addMacResult ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , false ) ; verifyAddDelegatedCorrectly ( iface , addMacVerification ) ; }
Source:
private void validateRngRequiredSource ( ) { org.ovirt.engine.core.compat.Version clusterVersion = getVersion ( ) . getSelectedItem ( ) ; boolean rngSupportedForCluster = isRngSupportedForClusterVersion ( clusterVersion ) ; getRngRandomSourceRequired ( ) . setIsValid ( ( rngSupportedForCluster || ( ! ( getRngRandomSourceRequired ( ) . getEntity ( ) ) ) ) ) ; getRngHwrngSourceRequired ( ) . setIsValid ( ( rngSupportedForCluster || ( ! ( getRngHwrngSourceRequired ( ) . getEntity ( ) ) ) ) ) ; }

Target:
public void setCustomMigrationNetworkBandwidth ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Integer > customMigrationNetworkBandwidth ) { this . customMigrationNetworkBandwidth = customMigrationNetworkBandwidth ; }
Source:
protected void setDiskImportData ( org.ovirt.engine.core.compat.Guid diskId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains , org.ovirt.engine.core.common.businessentities.VolumeType volumeType ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportData data = new org.ovirt.engine.ui.uicommonweb.models.vms.ImportData ( ) ; diskImportDataMap.put ( diskId , data ) ; data.setAllStorageDomains ( filteredStorageDomains ) ; data.setCollapseSnapshot ( getCollapseSnapshots ( ) ) ; data.setStorageDomains ( storageDomains ) ; data.setVolumeType ( volumeType ) ; data.setStorageQuotaList ( storageQuotaMap ) ; }

Target:
protected void addDiskImportData ( org.ovirt.engine.core.compat.Guid diskId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains , org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.ui.uicommonweb.models.EntityModel collapseSnapshots ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData data = new org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData ( ) ; data.setCollapseSnapshot ( collapseSnapshots ) ; data.setAllStorageDomains ( filteredStorageDomains ) ; data.setStorageDomains ( storageDomains ) ; data.setVolumeType ( volumeType ) ; data.setStorageQuotaList ( storageQuotaMap ) ; diskImportDataMap.put ( diskId , data ) ; }
Source:
static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.mMessages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.mMessages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.infoFormat ( "AuditLogType: {0} not exist in string table" , value.toString ( ) ) ; } } } }

Target:
static void checkSeverities ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warnFormat ( "AuditLogType: {0} not have severity. Assumed Normal" , value.toString ( ) ) ; } } } }
Source:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.NGuid.NewGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }

Target:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.NGuid.NewGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }
Source:
protected void assertMessages ( org.ovirt.engine.core.dal.VdcBllMessages bllMsg ) { org.junit.Assert.assertTrue ( "Wrong number of canDoActionMessages is returned" , ( ( validator.getCanDoActionMessages ( ) . size ( ) ) == 1 ) ) ; org.junit.Assert.assertTrue ( "Wrong canDoAction message is returned" , validator.getCanDoActionMessages ( ) . contains ( bllMsg.toString ( ) ) ) ; }

Target:
private static void assertMessage ( org.ovirt.engine.core.bll.ValidationResult result , org.ovirt.engine.core.dal.VdcBllMessages bllMsg ) { org.junit.Assert.assertEquals ( "Wrong canDoAction message is returned" , bllMsg , result.getMessage ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StoragePool getDataCenter ( org.ovirt.engine.api.model.Cluster cluster ) { org.ovirt.engine.api.model.DataCenter dataCenter = new org.ovirt.engine.api.model.DataCenter ( ) ; dataCenter.setId ( dataCenterId.toString ( ) ) ; cluster.setDataCenter ( dataCenter ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.getStoragePool ( cluster.getDataCenter ( ) , this ) ; return pool ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StoragePool getDataCenter ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { org.ovirt.engine.api.model.DataCenter dataCenter = new org.ovirt.engine.api.model.DataCenter ( ) ; dataCenter.setId ( dataCenterId.toString ( ) ) ; cluster.setDataCenter ( dataCenter ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.getStoragePool ( cluster.getDataCenter ( ) , this ) ; return pool ; }
Source:
public static void GetAllProviders ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }

Target:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }
Source:
public static java.util.List < java.lang.String > initRange ( java.lang.String start , java.lang.String end , int size ) { return org.ovirt.engine.core.utils.MacAddressRangeUtils.innerInitRange ( start , end , size ) ; }

Target:
public static java.util.List < java.lang.String > initRange ( java.lang.String start , java.lang.String end , int size ) { long startNum = org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( start ) ; long endNum = org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( end ) ; return org.ovirt.engine.core.utils.MacAddressRangeUtils.innerInitRange ( size , startNum , endNum ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel entity = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; boolean inputFieldsEnabled = ( ( java.lang.Boolean ) ( entity.getEntity ( ) ) ) ; getView ( ) . setInputFieldsEnabled ( inputFieldsEnabled ) ; }

Target:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkModel model ) { super . init ( model ) ; model.getApplyCommand ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propertyName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsExecutionAllowed" . equals ( propertyName ) ) { getView ( ) . setApplyEnabled ( model.getApplyCommand ( ) . getIsExecutionAllowed ( ) ) ; } } } ) ; }
Source:
public static boolean supportedInConfig ( org.ovirt.engine.core.common.config.ConfigValues feature , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.ArchitectureType arch ) { return java.lang.Boolean.parseBoolean ( ( ( java.util.Map < java.lang.String , java.lang.String > ) ( org.ovirt.engine.core.common.config.Config.< java.util.Map > getValue ( feature , version.getValue ( ) ) ) ) . get ( arch.name ( ) ) ) ; }

Target:
public static boolean supportedInConfig ( org.ovirt.engine.core.common.config.ConfigValues feature , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.ArchitectureType arch ) { java.util.Map < java.lang.String , java.lang.String > archOptions = org.ovirt.engine.core.common.config.Config.< java.util.Map > getValue ( feature , version.getValue ( ) ) ; return java.lang.Boolean.parseBoolean ( archOptions.getOrDefault ( arch.name ( ) , archOptions.get ( arch.getFamily ( ) . name ( ) ) ) ) ; }
Source:
protected final void verifyModel ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getNetwork ( ) . getId ( ) ) ; verifyModel ( model ) ; verifyLinks ( model ) ; }

Target:
protected final void verifyModel ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getNetwork ( ) . getId ( ) ) ; verifyModel ( model ) ; verifyLinks ( model ) ; }
Source:
private void removeVmImages ( ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > imageParams = org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getParameters ( ) . getImagesParameters ( ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase param : imageParams ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageToRemoveByParam ( ( ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ) ( param ) ) ) ; if ( diskImage != null ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVmId ( ) ) ; } } }

Target:
private void removeVmImages ( ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > imageParams = org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getParameters ( ) . getImagesParameters ( ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase param : imageParams ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageToRemoveByParam ( ( ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ) ( param ) ) ) ; if ( diskImage != null ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.removeDiskImage ( diskImage , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVmId ( ) ) ; } } }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_id" ) ) ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.NGuid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "storage_id" ) ) ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }
Source:
public void setSelectedItems ( java.util.List < T > value ) { if ( ( selectedItems ) != value ) { selectedItemsChanging ( value , selectedItems ) ; selectedItems = value ; selectedItemsChanged ( ) ; getSelectedItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SelectedItems" ) ) ; } }

Target:
public void setSelectedItems ( java.util.List < T > value ) { if ( ( selectedItems ) != value ) { selectedItemsChanging ( value , selectedItems ) ; selectedItems = value ; selectedItemsChanged ( ) ; getSelectedItemsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SelectedItems" ) ) ; } }
Source:
public void ClearTasks ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.CommandAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.CommandAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getLastTaskStatus ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) { task.clearAsyncTask ( ) ; _listTasks.remove ( task.getVdsmTaskId ( ) ) ; } } } }

Target:
public void ClearTasks ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.tasks.CommandAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.tasks.CommandAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getLastTaskStatus ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) { task.clearAsyncTask ( ) ; _listTasks.remove ( task.getVdsmTaskId ( ) ) ; } } } }
Source:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
private void getVlanParentInterface ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void validateSucceedsWithStopActionType ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFails ( ) { cmd.getParameters ( ) . setActionType ( "InvalidActionType" ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getInterfaceColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.DiskInterface > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return object.getDiskInterface ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Disk > getInterfaceColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.DiskInterface > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return object.getDiskInterface ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
protected void auditInvalidInterfaces ( java.util.List < java.lang.String > invalidNetworkNames , java.util.List < java.lang.String > invalidIfaceNames ) { if ( ( invalidNetworkNames.size ( ) ) > 0 ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Networks" , org.apache.commons.lang.StringUtils.join ( invalidNetworkNames , ',' ) ) ; logable.addCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( invalidIfaceNames , ',' ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , getAuditLogTypeForInvalidInterfaces ( ) ) ; } }

Target:
protected void updateManagedDeviceMap ( org.ovirt.engine.core.common.businessentities.DiskImage disk , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > managedDeviceMap ) { org.ovirt.engine.core.compat.Guid oldDiskId = newDiskIdForDisk.get ( disk.getId ( ) ) . getId ( ) ; managedDeviceMap.put ( disk.getId ( ) , managedDeviceMap.get ( oldDiskId ) ) ; managedDeviceMap.remove ( oldDiskId ) ; }
Source:
public void rerun ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.setVm ( null ) ; determineMigrationFailureForAuditLog ( ) ; if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { setVdsDestinationId ( null ) ; super . rerun ( ) ; } else { decreasePendingVms ( getDestinationVds ( ) . getId ( ) ) ; _isRerun = true ; org.ovirt.engine.core.bll.MigrateVmCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.MigrateVmCommand.log ( ) ; } }

Target:
public void rerun ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.setVm ( null ) ; determineMigrationFailureForAuditLog ( ) ; if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { setVdsDestinationId ( null ) ; super . rerun ( ) ; } else { decreasePendingVms ( getDestinationVds ( ) . getId ( ) ) ; _isRerun = true ; org.ovirt.engine.core.bll.MigrateVmCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.MigrateVmCommand.log ( ) ; failedToRunVm ( ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getCachedIsoListByStoragePoolAndDomainId ( org.ovirt.engine.core.compat.Guid isoStoragePoolId , org.ovirt.engine.core.compat.Guid isoStorageDomainId ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > fileListMD = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; if ( ( ( isoStorageDomainId != null ) && ( isoStoragePoolId != null ) ) && ( ( org.ovirt.engine.core.bll.VmRunHandler.getInstance ( ) . findActiveISODomain ( isoStoragePoolId ) ) != null ) ) { fileListMD = repoStorageDom.getRepoListForStorageDomainAndStoragePool ( isoStoragePoolId , isoStorageDomainId , FileTypeExtension.ISO ) ; } return fileListMD ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getCachedIsoListByStoragePoolAndDomainId ( org.ovirt.engine.core.compat.Guid isoStoragePoolId , org.ovirt.engine.core.compat.Guid isoStorageDomainId , org.ovirt.engine.core.common.businessentities.FileTypeExtension fileTypeExtension ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > fileListMD = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; if ( ( ( isoStorageDomainId != null ) && ( isoStoragePoolId != null ) ) && ( ( org.ovirt.engine.core.bll.VmRunHandler.getInstance ( ) . findActiveISODomain ( isoStoragePoolId ) ) != null ) ) { fileListMD = repoStorageDom.getRepoListForStorageDomainAndStoragePool ( isoStoragePoolId , isoStorageDomainId , fileTypeExtension ) ; } return fileListMD ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return 262144 ; }

Target:
public static boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ( getVm ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ! ( memoryChecker.evaluate ( vds , getVm ( ) ) ) ) ) { sb.append ( "has insufficient memory to run the VM" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_MEMORY ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( isMigrate && ( ( ( getVm ( ) . getrun_on_vds ( ) ) != null ) && ( getVm ( ) . getrun_on_vds ( ) . equals ( vds.getId ( ) ) ) ) ) { sb.append ( "is the same host the VM is currently running on" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_TO_SAME_HOST ; } return null ; }
Source:
private void checkStoragePoolFails ( ) { org.junit.Assert.assertFalse ( cmd.checkStoragePool ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST.toString ( ) ) ) ; }

Target:
private void checkStoragePoolFails ( ) { org.mockito.Mockito.when ( facade.getStoragePoolDao ( ) . get ( storagePool.getId ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( cmd.checkStoragePool ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST.toString ( ) ) ) ; }
Source:
public void onSucceeded ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; log.debug ( "Removing ImageUpload id {}" , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.endSuccessfully ( ) ; log.info ( "Successfully uploaded (command id '{}')" , getUploadDescription ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; }

Target:
public void onSucceeded ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; log.debug ( "Removing ImageUpload id {}" , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.endSuccessfully ( ) ; log.info ( "Successfully transferred disk '{}' (command id '{}')" , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; }
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.common.eventqueue.EventResult result = null ; if ( _domainsInProblem.containsKey ( domainId ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.info ( ( "starting processDomainRecovery for domain " + ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.getDomainIdTuple ( domainId ) ) ) ) ; result = processDomainRecovery ( domainId ) ; } _timers.remove ( domainId ) ; return result ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.common.eventqueue.EventResult result = null ; if ( _domainsInProblem.containsKey ( domainId ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.info ( "starting processDomainRecovery for domain '{}'." , org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.getDomainIdTuple ( domainId ) ) ; result = processDomainRecovery ( domainId ) ; } _timers.remove ( domainId ) ; return result ; }