auphong2707/dl4se-code-review-dataset huggingface dataset:
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 ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public 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 void testGetVmIconByDataUrlWithValidUrl ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmIcon > result = prepareDao ( ) . getByDataUrl ( org.ovirt.engine.core.dao.VmIconDaoTest.OTHER_SMALL_DATAURL ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.common.businessentities.VmIcon ( FixturesTool.SMALL_ICON_ID , org.ovirt.engine.core.dao.VmIconDaoTest.OTHER_SMALL_DATAURL ) , result.get ( 0 ) ) ; }

Target:
public void testGetVmIconByDataUrlWithValidUrl ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmIcon > result = dao.getByDataUrl ( org.ovirt.engine.core.dao.VmIconDaoTest.OTHER_SMALL_DATAURL ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.common.businessentities.VmIcon ( FixturesTool.SMALL_ICON_ID , org.ovirt.engine.core.dao.VmIconDaoTest.OTHER_SMALL_DATAURL ) , result.get ( 0 ) ) ; }
Source:
private void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getvm_name ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.AddCustomValue ( "FieldName" , fieldName ) ; logable.AddCustomValue ( "VmName" , vmName ) ; logable.AddCustomValue ( "FieldValue" , fieldValue ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }

Target:
private static void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getvm_name ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.AddCustomValue ( "FieldName" , fieldName ) ; logable.AddCustomValue ( "VmName" , vmName ) ; logable.AddCustomValue ( "FieldValue" , fieldValue ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }
Source:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.VmCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getId ( ) ) ; endActionOnDisks ( ) ; unlockVm ( ) ; org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getId ( ) ) ; } endActionOnDisks ( ) ; unlockVm ( ) ; org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( getParameters ( ) . getSnapshotId ( ) ) ; getCompensationContext ( ) . snapshotEntityStatus ( snapshot , snapshot.getStatus ( ) ) ; getSnapshotDao ( ) . updateStatus ( getParameters ( ) . getSnapshotId ( ) , SnapshotStatus.LOCKED ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( snapshot , snapshot.getStatus ( ) ) ; getSnapshotDao ( ) . updateStatus ( getParameters ( ) . getSnapshotId ( ) , SnapshotStatus.LOCKED ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private void commonTestFlow ( boolean withDummyLun ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVgId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.VG_ID ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getVdsId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.VDS_ID ) ; expectGetLunsForVg ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.VG_ID , withDummyLun ) ; expectGetDeviceList ( ) ; expectGetLunsMap ( storageServerConnectionLunMapDAO ) ; expectGetConnections ( storageServerConnectionDAO ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; checkReturnValue ( getQuery ( ) ) ; }

Target:
private void commonTestFlow ( boolean withDummyLun ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVgId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.VG_ID ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.VDS_ID ) ; expectGetLunsForVg ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.VG_ID , withDummyLun ) ; expectGetDeviceList ( ) ; expectGetLunsMap ( storageServerConnectionLunMapDAO ) ; expectGetConnections ( storageServerConnectionDAO ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; checkReturnValue ( getQuery ( ) ) ; }
Source:
protected java.lang.Object resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.EntityResolver entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { try { return entityResolver.resolve ( ( ( org.ovirt.engine.core.compat.Guid ) ( result.getActionReturnValue ( ) ) ) ) ; } catch ( java.lang.Exception e ) { return null ; } }

Target:
protected java.lang.Object resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.EntityResolver entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { try { return entityResolver.resolve ( result.getActionReturnValue ( ) ) ; } catch ( java.lang.Exception e ) { return null ; } }
Source:
public void testLogMtuDiffs ( ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : org.ovirt.engine.core.vdsbroker.vdsbroker.VdsUpdateRunTimeInfoTest.getInterfaces ( ) ) { updater.logMTUDifferences ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsUpdateRunTimeInfoTest.getClustersMap ( ) , iface ) ; } java.lang.System.out.println ( mockAuditLogDao.getAll ( ) . get ( 0 ) . getmessage ( ) ) ; junit.framework.Assert.assertTrue ( ( ( mockAuditLogDao.getAll ( ) . size ( ) ) == 1 ) ) ; }

Target:
public void testLogMtuDiffs ( ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : org.ovirt.engine.core.vdsbroker.vdsbroker.VdsUpdateRunTimeInfoTest.getInterfaces ( ) ) { updater.logMTUDifferences ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsUpdateRunTimeInfoTest.getClustersMap ( ) , iface ) ; } junit.framework.Assert.assertEquals ( 1 , mockAuditLogDao.getAll ( ) . size ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.authentication.DirectoryUser > findUsers ( java.util.List < org.ovirt.engine.core.common.utils.ExternalId > ids ) { org.ovirt.engine.core.bll.adbroker.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserIdList , new org.ovirt.engine.core.bll.adbroker.LdapSearchByUserIdListParameters ( domain , ids , false ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ldapUsers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUsers ( ldapUsers ) ; }

Target:
public java.util.List < org.ovirt.engine.core.authentication.DirectoryUser > findUsers ( java.util.List < org.ovirt.engine.core.common.utils.ExternalId > ids ) { org.ovirt.engine.core.bll.adbroker.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserIdList , new org.ovirt.engine.core.bll.adbroker.LdapSearchByUserIdListParameters ( domain , ids , true ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ldapUsers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUsers ( ldapUsers ) ; }
Source:
protected void init ( T model ) { this . model = model ; widgets.clear ( ) ; super . init ( model ) ; if ( ! ( enabled ) ) { org.ovirt.engine.ui.common.widget.form.key_value.KeyValueLineWidget lastWidget = widgets.getLast ( ) ; if ( isGhost ( lastWidget.flush ( ) ) ) { removeWidget ( lastWidget ) ; } } }

Target:
protected void init ( T model ) { this . model = model ; widgets.clear ( ) ; super . init ( model ) ; }
Source:
protected boolean validateImagesAndVMStates ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , hasImages ( ) , hasImages ( ) , hasImages ( ) , hasImages ( ) , true , false , true , true , null ) ; }

Target:
protected boolean validateImagesAndVMStates ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , hasImages ( ) , hasImages ( ) , hasImages ( ) , hasImages ( ) , true , true , true , null ) ; }
Source:
private void refreshAllVdssInPool ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > vdsIdsToSetNonOperational = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; runSynchronizeOperation ( new org.ovirt.engine.core.bll.storage.RefreshPoolSingleAsyncOperationFactory ( ) , vdsIdsToSetNonOperational ) ; for ( org.ovirt.engine.core.compat.Guid vdsId : vdsIdsToSetNonOperational ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vdsId , org.ovirt.engine.core.common.businessentities.NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE ) ; tempVar.setSaveToDb ( true ) ; tempVar.setStorageDomainId ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ; tempVar.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } }

Target:
private void refreshAllVdssInPool ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > vdsIdsToSetNonOperational = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; runSynchronizeOperation ( new org.ovirt.engine.core.bll.storage.RefreshPoolSingleAsyncOperationFactory ( ) , vdsIdsToSetNonOperational ) ; for ( org.ovirt.engine.core.compat.Guid vdsId : vdsIdsToSetNonOperational ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vdsId , org.ovirt.engine.core.common.businessentities.NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE ) ; tempVar.setStorageDomainId ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ; tempVar.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } }
Source:
public static java.lang.String getDiskLabelList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks.isEmpty ( ) ) { return null ; } final java.util.List < java.lang.String > labels = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { labels.add ( disk.getDiskAlias ( ) ) ; } return org.ovirt.engine.ui.uicompat.external.StringUtils.join ( labels , ", " ) ; }

Target:
public static java.lang.String getDiskLabelList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks.isEmpty ( ) ) { return null ; } final java.util.List < java.lang.String > labels = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { labels.add ( disk.getDiskAlias ( ) ) ; } return java.lang.String.join ( ", " , labels ) ; }
Source:
public void testNoChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.getChangedFields ( jedi1 , jedi2 ) ; org.junit.Assert.assertTrue ( "Should be no changes" , ( ( changes.size ( ) ) == 0 ) ) ; }

Target:
public void testNoChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.getChangedFields ( jedi1 , jedi2 ) ; org.junit.Assert.assertEquals ( "Should be no changes" , 0 , changes.size ( ) ) ; }
Source:
protected void endWithFailure ( ) { if ( ( commandCoordinatorUtil.getCommandExecutionStatus ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCommandId ( ) ) ) != ( org.ovirt.engine.core.compat.backendcompat.CommandExecutionStatus.EXECUTED ) ) { changeStorageDomainStatusInTransaction ( loadStoragePoolIsoMap ( ) , StorageDomainStatus.Unknown ) ; auditLogDirector.log ( this , AuditLogType.USER_DEACTIVATE_STORAGE_DOMAIN_OVF_UPDATE_INCOMPLETE ) ; } else { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { if ( ( commandCoordinatorUtil.getCommandExecutionStatus ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCommandId ( ) ) ) != ( org.ovirt.engine.core.compat.backendcompat.CommandExecutionStatus.EXECUTED ) ) { changeStorageDomainStatusInTransaction ( loadStoragePoolIsoMap ( ) , StorageDomainStatus.Unknown ) ; auditLogDirector.log ( this , AuditLogType.USER_DEACTIVATE_STORAGE_DOMAIN_OVF_UPDATE_INCOMPLETE ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }
Source:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceGeneralType.DISK , payload.getDeviceType ( ) , payload.getSpecParams ( ) , true , true , null , false ) ; } }

Target:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceGeneralType.DISK , payload.getDeviceType ( ) , payload.getSpecParams ( ) , true , true ) ; } }
Source:
private void initVmDiskImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.VM ) ; diskImage.setvm_guid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }

Target:
private void initVmDiskImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.VM ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }
Source:
public boolean awaitVdsmResponse ( ) { final int checks = ( org.ovirt.engine.core.bll.network.NetworkConfigurator.VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS ) / ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SetupNetworksPollingTimeout ) ) ; for ( int i = 0 ; i < checks ; i ++ ) { if ( pollVds ( ) ) { org.ovirt.engine.core.bll.network.NetworkConfigurator.log.infoFormat ( "Engine managed to communicate with VDSM agent on host {0}" , host.getName ( ) , host.getId ( ) ) ; return true ; } else { delayPolling ( ) ; } } return false ; }

Target:
public boolean awaitVdsmResponse ( ) { final int checks = ( org.ovirt.engine.core.bll.network.NetworkConfigurator.VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS ) / ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SetupNetworksPollingTimeout ) ) ; for ( int i = 0 ; i < checks ; i ++ ) { if ( pollVds ( ) ) { org.ovirt.engine.core.bll.network.NetworkConfigurator.log.infoFormat ( "Engine managed to communicate with VDSM agent on host {0}" , host.getName ( ) , host.getId ( ) ) ; return true ; } else { delayPolling ( ) ; } } return false ; }
Source:
public boolean CheckIfCpusSameManufacture ( java.lang.String cpuName1 , java.lang.String cpuName2 ) { boolean result = false ; if ( ( cpuName1 != null ) && ( cpuName2 != null ) ) { result = ( _intelCpuByNameDictionary.containsKey ( cpuName1 ) ) ? _intelCpuByNameDictionary.containsKey ( cpuName2 ) : _amdCpuByNameDictionary.containsKey ( cpuName2 ) ; } return result ; }

Target:
public boolean CheckIfCpusSameManufacture ( java.lang.String cpuName1 , java.lang.String cpuName2 ) { boolean result = false ; if ( ( cpuName1 != null ) && ( cpuName2 != null ) ) { if ( _intelCpuByNameDictionary.containsKey ( cpuName1 ) ) { result = _intelCpuByNameDictionary.containsKey ( cpuName2 ) ; } else if ( _amdCpuByNameDictionary.containsKey ( cpuName1 ) ) { result = _amdCpuByNameDictionary.containsKey ( cpuName2 ) ; } } return result ; }
Source:
public void testWrongFormatCustomProerties ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setCustomProperties ( "sap_agent;" ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_3 ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < java.lang.String > ( ) ; org.junit.Assert.assertFalse ( runVmValidator.validateVmProperties ( vm , messages ) ) ; org.junit.Assert.assertFalse ( messages.isEmpty ( ) ) ; }

Target:
public void testWrongFormatCustomProerties ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_3 ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < java.lang.String > ( ) ; org.junit.Assert.assertFalse ( runVmValidator.validateVmProperties ( vm , "sap_agent;" , messages ) ) ; org.junit.Assert.assertFalse ( messages.isEmpty ( ) ) ; }
Source:
public void mockVdsDao ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsType ( VDSType.oVirtVintageNode ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; }

Target:
public void mockVdsDao ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsType ( VDSType.oVirtVintageNode ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; }
Source:
public void removeLun ( org.ovirt.engine.core.common.businessentities.LUNs lun ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > lunsList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLunDao ( ) . getAllForVolumeGroup ( lun.getvolume_group_id ( ) ) ; if ( ( lunsList.size ( ) ) == 1 ) { for ( org.ovirt.engine.core.common.businessentities.storage_server_connections connection : filterConnectionsUsedByOthers ( lun.getLunConnections ( ) , "" , lun.getLUN_id ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } } }

Target:
public void removeLun ( org.ovirt.engine.core.common.businessentities.LUNs lun ) { if ( lun.getvolume_group_id ( ) . isEmpty ( ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLunDao ( ) . remove ( lun.getLUN_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_server_connections connection : filterConnectionsUsedByOthers ( lun.getLunConnections ( ) , "" , lun.getLUN_id ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } } }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel userPortalListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.storage_pool [ ] { ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( result ) ) } ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel unitModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( userPortalListModel.getWindow ( ) ) ) ; unitModel.getDataCenter ( ) . setItems ( list ) ; unitModel.getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( list ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel userPortalListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.storage_pool [ ] { ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( result ) ) } ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel unitModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( userPortalListModel.getWindow ( ) ) ) ; unitModel.getDataCenter ( ) . setItems ( list ) ; unitModel.getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( list ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = super . getPermissionCheckSubjects ( ) ; org.ovirt.engine.core.compat.Guid networkId = ( ( org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getNetworkCluster ( ) ) == null ) ? null : org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getNetworkCluster ( ) . getNetworkId ( ) ; permissions.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( networkId , org.ovirt.engine.core.common.VdcObjectType.Network , org.ovirt.engine.core.common.businessentities.ActionGroup.ASSIGN_CLUSTER_NETWORK ) ) ; return permissions ; }

Target:
private org.ovirt.engine.core.compat.Guid getNetworkId ( ) { return ( org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getNetworkCluster ( ) ) == null ? null : org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getNetworkCluster ( ) . getNetworkId ( ) ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { if ( returnValue != null ) { _defaultConfigurationVersion = returnValue.getReturnValue ( ) ; } else { _defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { if ( returnValue != null ) { _defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { _defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }
Source:
private static java.io.File [ ] getMessagesLocalePropertiesFiles ( final java.io.File currentDir , final java.lang.String fileNamePrefix ) throws java.net.URISyntaxException { return currentDir.listFiles ( new java.io.FilenameFilter ( ) { @ java.lang.Override public boolean accept ( java.io.File dir , java.lang.String name ) { return name.matches ( ( ( "^" + fileNamePrefix ) + "_[a-zA-Z]{2}.*\\.properties$" ) ) ; } } ) ; }

Target:
private static java.io.File [ ] getMessagesLocalePropertiesFiles ( final java.io.File currentDir , final java.lang.String fileNamePrefix ) throws java.net.URISyntaxException { return currentDir.listFiles ( ( dir , name ) -> name.matches ( ( ( "^" + fileNamePrefix ) + "_[a-zA-Z]{2}.*\\.properties$" ) ) ) ; }
Source:
public void testRunQuery_GetUserBySessionId ( ) { java.lang.String sessionId = "sessionId" ; org.ovirt.engine.core.common.queries.VdcQueryType queryType = org.ovirt.engine.core.common.queries.VdcQueryType.GetUserBySessionId ; java.lang.Object result = testServlet.runQuery ( queryType , mockQueryParams , sessionId ) ; org.junit.Assert.assertEquals ( result , mockUser ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setSessionId ( sessionId ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setHttpSessionId ( sessionId ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setFiltered ( testServlet.filterQueries ( ) ) ; org.mockito.Mockito.verify ( mockBackend ) . RunQuery ( queryType , mockQueryParams ) ; }

Target:
public void testRunQuery_GetUserBySessionId ( ) { java.lang.String sessionId = "sessionId" ; org.ovirt.engine.core.common.queries.VdcQueryType queryType = org.ovirt.engine.core.common.queries.VdcQueryType.GetUserBySessionId ; java.lang.Object result = testServlet.runQuery ( queryType , mockQueryParams , sessionId ) ; org.junit.Assert.assertEquals ( result , mockUser ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setSessionId ( sessionId ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setHttpSessionId ( sessionId ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setFiltered ( testServlet.filterQueries ( ) ) ; org.mockito.Mockito.verify ( mockBackend ) . runQuery ( queryType , mockQueryParams ) ; }
Source:
public static boolean interfaceHasVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allIfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : allIfaces ) { if ( ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( i ) ) && ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( i.getName ( ) , iface.getName ( ) ) ) ) { return true ; } } return false ; }

Target:
public static boolean interfaceHasVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allIfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : allIfaces ) { if ( ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( i ) ) && ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( i , iface.getName ( ) ) ) ) { return true ; } } return false ; }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
protected void updateHashName ( T model ) { java.lang.String hashName = model.getHashName ( ) ; org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget.getView ( ) . setHashName ( hashName ) ; org.ovirt.engine.ui.uicommonweb.UICommand openDocumentationCommand = model.getOpenDocumentationCommand ( ) ; if ( openDocumentationCommand != null ) { boolean isDocumentationAvailable = ( ( model.getConfigurator ( ) . isDocumentationAvailable ( ) ) && ( hashName != null ) ) && ( ( org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.getPath ( hashName ) ) != null ) ; openDocumentationCommand.setIsAvailable ( isDocumentationAvailable ) ; updateHelpCommand ( ( isDocumentationAvailable ? openDocumentationCommand : null ) ) ; } }

Target:
protected void updateHashName ( T model ) { java.lang.String hashName = model.getHashName ( ) ; org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget.getView ( ) . setHashName ( hashName ) ; org.ovirt.engine.ui.uicommonweb.UICommand openDocumentationCommand = model.getOpenDocumentationCommand ( ) ; if ( openDocumentationCommand != null ) { boolean isDocumentationAvailable = ( hashName != null ) && ( ( org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.getPath ( hashName ) ) != null ) ; openDocumentationCommand.setIsAvailable ( isDocumentationAvailable ) ; updateHelpCommand ( ( isDocumentationAvailable ? openDocumentationCommand : null ) ) ; } }
Source:
public void onSaveNetworkConfig ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ( model.getProgress ( ) ) != null ) { return ; } model.startProgress ( ) ; setcurrentModel ( model ) ; new org.ovirt.engine.ui.uicommonweb.models.hosts.SaveNetworkConfigAction ( this , model , getEntity ( ) ) . execute ( ) ; }

Target:
public void onSaveNetworkConfig ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ( model.getProgress ( ) ) != null ) { return ; } model.startProgress ( ) ; new org.ovirt.engine.ui.uicommonweb.models.hosts.SaveNetworkConfigAction ( this , model , getEntity ( ) ) . execute ( ) ; }
Source:
public void testNotificationService ( ) { org.ovirt.engine.core.notifier.NotificationService notificationService = null ; try { notificationService = new org.ovirt.engine.core.notifier.NotificationService ( new org.ovirt.engine.core.notifier.utils.NotificationConfigurator ( "src/test/resources/conf/notifier.conf" ) ) ; } catch ( org.ovirt.engine.core.notifier.NotificationServiceException e ) { e.printStackTrace ( ) ; } org.junit.Assert.assertNotNull ( notificationService ) ; notificationService.run ( ) ; notificationService.shutdown ( ) ; }

Target:
public void testNotificationService ( ) { org.ovirt.engine.core.notifier.NotificationService notificationService = null ; try { notificationService = new org.ovirt.engine.core.notifier.NotificationService ( new org.ovirt.engine.core.notifier.utils.NotificationConfigurator ( "src/test/resources/conf/notifier.conf" ) ) ; } catch ( org.ovirt.engine.core.notifier.NotificationServiceException e ) { e.printStackTrace ( ) ; } org.junit.Assert.assertNotNull ( notificationService ) ; notificationService.run ( ) ; }
Source:
private boolean isRngSupportedForClusterVersion ( org.ovirt.engine.core.compat.Version version ) { if ( version == null ) { return false ; } java.lang.Boolean supported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.VirtIoRngDeviceSupported , version.toString ( ) ) ) ) ; return supported == null ? false : supported ; }

Target:
private boolean isRngSupportedForClusterVersion ( org.ovirt.engine.core.compat.Version version ) { if ( version == null ) { return false ; } java.lang.Boolean supported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VirtIoRngDeviceSupported , version.toString ( ) ) ) ) ; return supported == null ? false : supported ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , getStorageDomainId ( ) . getValue ( ) , getRequestDiskSpace ( ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , getStorageDomainId ( ) , getRequestDiskSpace ( ) ) ) ; } return list ; }
Source:
public void testCheckGlusterQuorumWithoutBricks ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.DUMMY_SERVER_ID , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 ) ; org.mockito.Mockito.doReturn ( java.util.Collections.EMPTY_LIST ) . when ( brickDao ) . getGlusterVolumeBricksByServerId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.DUMMY_SERVER_ID ) ; org.junit.Assert.assertTrue ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) ) ; }

Target:
public void testCheckGlusterQuorumWithoutBricks ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.DUMMY_SERVER_ID , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 ) ; org.junit.Assert.assertTrue ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) ) ; }
Source:
protected java.lang.Object runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( queryType , queryParams ) ; return result.getSucceeded ( ) ? result.getReturnValue ( ) : null ; }

Target:
protected java.lang.Object runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }
Source:
private static void updateOption ( org.ovirt.engine.core.common.businessentities.VdcOption option ) { java.util.Map < java.lang.String , java.lang.Object > values = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.get ( option.getoption_name ( ) ) ; if ( values == null ) { values = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.put ( option.getoption_name ( ) , values ) ; } values.put ( option.getversion ( ) , org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.GetValue ( option ) ) ; }

Target:
private static void updateOption ( org.ovirt.engine.core.common.businessentities.VdcOption option ) { java.util.Map < java.lang.String , java.lang.Object > values = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.get ( option.getoption_name ( ) ) ; if ( values == null ) { values = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.put ( option.getoption_name ( ) , values ) ; } values.put ( option.getversion ( ) , org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.getValue ( option ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = super . getVm ( ) ; if ( vm == null ) { vm = org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getVmDAO ( ) . getVmsListForDisk ( org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getImageGroupId ( ) ) . get ( 0 ) ; setVm ( vm ) ; setVmId ( vm.getId ( ) ) ; } return vm ; }

Target:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = super . getVm ( ) ; if ( vm == null ) { vm = org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getVmDAO ( ) . getVmsListForDisk ( org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getImageGroupId ( ) , false ) . get ( 0 ) ; setVm ( vm ) ; setVmId ( vm.getId ( ) ) ; } return vm ; }
Source:
public void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk = ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.getNewDisk ( ) ) ) ; org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.getCinderBroker ( ) . extendDisk ( cinderDisk , ( ( int ) ( getNewDiskSizeInGB ( ) ) ) ) ; persistCommand ( org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.getParameters ( ) . getParentCommand ( ) , true ) ; org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.getReturnValue ( ) . setActionReturnValue ( cinderDisk.getId ( ) ) ; org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.setSucceeded ( true ) ; }

Target:
public void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk = ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.getNewDisk ( ) ) ) ; org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.getCinderBroker ( ) . extendDisk ( cinderDisk , ( ( int ) ( org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.getNewDiskSizeInGB ( ) ) ) ) ; persistCommand ( org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.getParameters ( ) . getParentCommand ( ) , true ) ; org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.getReturnValue ( ) . setActionReturnValue ( cinderDisk.getId ( ) ) ; org.ovirt.engine.core.bll.storage.ExtendCinderDiskCommand.setSucceeded ( true ) ; }
Source:
private boolean containsVmCluster ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters ) { for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( ( cluster.getStoragePoolId ( ) ) != null ) { if ( org.ovirt.engine.core.compat.Guid.OpEquality ( cluster.getId ( ) , vm.getVdsGroupId ( ) . getValue ( ) ) ) { return true ; } } } return false ; }

Target:
private boolean containsVmCluster ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters ) { for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( ( cluster.getStoragePoolId ( ) ) != null ) { if ( vm.getVdsGroupId ( ) . equals ( cluster.getId ( ) ) ) { return true ; } } } return false ; }
Source:
protected void reexecuteCommand ( ) { org.ovirt.engine.core.bll.RunVmCommandBase.getReturnValue ( ) . setCanDoAction ( false ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ) != null ) { org.ovirt.engine.core.common.job.Job job = org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) . getJob ( ) ; if ( job != null ) { org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . closeCompletedJobSteps ( job.getId ( ) , JobExecutionStatus.FAILED ) ; } } org.ovirt.engine.core.bll.RunVmCommandBase.insertAsyncTaskPlaceHolders ( ) ; org.ovirt.engine.core.bll.RunVmCommandBase.executeAction ( ) ; }

Target:
protected void reexecuteCommand ( ) { org.ovirt.engine.core.bll.RunVmCommandBase.getReturnValue ( ) . setCanDoAction ( false ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ) != null ) { org.ovirt.engine.core.common.job.Job job = org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) . getJob ( ) ; if ( job != null ) { org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . closeCompletedJobSteps ( job.getId ( ) , JobExecutionStatus.FAILED ) ; } } org.ovirt.engine.core.bll.RunVmCommandBase.executeAction ( ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.String > assertNeworkWasSent ( org.ovirt.engine.core.common.businessentities.network.Network net ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct networksStruct = networksCaptor.getValue ( ) ; java.util.Map < java.lang.String , java.lang.String > networkStruct = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( networksStruct.getItem ( net.getName ( ) ) ) ) ; org.junit.Assert.assertNotNull ( ( ( "Network " + ( net.getName ( ) ) ) + " should've been sent but wasn't." ) , networkStruct ) ; return networkStruct ; }

Target:
private java.util.Map < java.lang.String , java.lang.String > assertNeworkWasSent ( org.ovirt.engine.core.common.businessentities.network.Network net ) { java.util.Map networksStruct = networksCaptor.getValue ( ) ; java.util.Map < java.lang.String , java.lang.String > networkStruct = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( networksStruct.get ( net.getName ( ) ) ) ) ; org.junit.Assert.assertNotNull ( ( ( "Network " + ( net.getName ( ) ) ) + " should've been sent but wasn't." ) , networkStruct ) ; return networkStruct ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VmTemplate.name ( ) . toLowerCase ( ) , ( ( getVmTemplateName ( ) ) == null ? "" : getVmTemplateName ( ) ) ) ; jobProperties.put ( VdcObjectType.Storage.name ( ) . toLowerCase ( ) , getStorageDomainName ( ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VmTemplate.name ( ) . toLowerCase ( ) , ( ( getVmTemplateName ( ) ) == null ? "" : getVmTemplateName ( ) ) ) ; } return jobProperties ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }