auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean releaseUsedHostDevices ( ) { if ( hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) ) ) { try { hostDeviceManager.acquireHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ; hostDeviceManager.freeVmHostDevices ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; } finally { hostDeviceManager.releaseHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ; } return true ; } return false ; }

Target:
private boolean releaseUsedHostDevices ( ) { if ( hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) ) ) { try { hostDeviceManager.acquireHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . get ( 0 ) ) ; hostDeviceManager.freeVmHostDevices ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; } finally { hostDeviceManager.releaseHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . get ( 0 ) ) ; } return true ; } return false ; }
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.RunVmOnceCommand.isRunAsStateless ( ) ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( image.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , image.getStorageIds ( ) . get ( 0 ) , image.getActualSize ( ) ) ) ; } } 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 < > ( ) ; if ( org.ovirt.engine.core.bll.RunVmOnceCommand.isRunAsStateless ( ) ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( image.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , image.getStorageIds ( ) . get ( 0 ) , image.getActualSize ( ) ) ) ; } } return list ; }
Source:
public void setupEnvironment ( ) { org.ovirt.engine.core.utils.CorrelationIdTracker.clean ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.aaa.DbUser.class ) ; org.mockito.Mockito.when ( engineSessionDao.remove ( org.mockito.ArgumentMatchers.any ( java.lang.Long.class ) ) ) . thenReturn ( 1 ) ; sessionDataContainer.setUser ( org.ovirt.engine.core.bll.aaa.GetUserBySessionIdQueryTest.sessionID , user ) ; }

Target:
public void setupEnvironment ( ) { org.ovirt.engine.core.utils.CorrelationIdTracker.clean ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.aaa.DbUser.class ) ; org.mockito.Mockito.when ( engineSessionDao.remove ( org.mockito.ArgumentMatchers.anyLong ( ) ) ) . thenReturn ( 1 ) ; sessionDataContainer.setUser ( org.ovirt.engine.core.bll.aaa.GetUserBySessionIdQueryTest.sessionID , user ) ; }
Source:
public void testFetchVmDisks ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > disks = ovfUtils.fetchVmDisks ( xmlDocument ) ; org.junit.Assert.assertNotNull ( "The list of disks should not be null" , disks ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , ( ! ( disks.isEmpty ( ) ) ) ) ; }

Target:
public void testFetchVmDisks ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > disks = ovfUtils.fetchVmDisks ( xmlDocument ) ; org.junit.jupiter.api.Assertions.assertNotNull ( disks , "The list of disks should not be null" ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ! ( disks.isEmpty ( ) ) ) , "The list of disks should not be empty" ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel getSpecificImportModel ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel model = importFromExportDomainModelProvider.get ( ) ; model.init ( getVmsToImport ( ) , exportDomain.getId ( ) ) ; model.setEntity ( exportDomain.getId ( ) ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importVirtualMachinesTitle ( ) ) ; model.setHelpTag ( HelpTag.import_virtual_machine ) ; model.setHashName ( "import_virtual_machine" ) ; return model ; }

Target:
public void initImportFromExportDomainModel ( org.ovirt.engine.ui.uicommonweb.UICommand ... commands ) { importVmFromExportDomainModel = importFromExportDomainModelProvider.get ( ) ; importVmFromExportDomainModel.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importVirtualMachinesTitle ( ) ) ; importVmFromExportDomainModel.setHelpTag ( HelpTag.import_virtual_machine ) ; importVmFromExportDomainModel.setHashName ( "import_virtual_machine" ) ; for ( org.ovirt.engine.ui.uicommonweb.UICommand command : commands ) { importVmFromExportDomainModel.getCommands ( ) . add ( command ) ; } }
Source:
private void setUpGetEntityExpectations ( ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllDisksByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , getEntityList ( ) ) ; }

Target:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllDisksByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.VM_ID } , getEntityList ( ) , failure ) ; } }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK_NO_DOMAIN : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK_NO_DOMAIN ; } return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } }
Source:
private java.lang.String getConstraint ( ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; buffer.append ( "Providers: type=" ) ; buffer.append ( ProviderType.OPENSTACK_IMAGE.name ( ) ) ; java.lang.String query = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , null , modelType , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( query ) ) { buffer.append ( " AND (" ) ; buffer.append ( query ) ; buffer.append ( ")" ) ; } return buffer.toString ( ) ; }

Target:
private java.lang.String getConstraint ( ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; buffer.append ( "Providers: type=" ) ; buffer.append ( ProviderType.OPENSTACK_IMAGE.name ( ) ) ; java.lang.String query = org.ovirt.engine.api.restapi.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , null , modelType , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( query ) ) { buffer.append ( " AND (" ) ; buffer.append ( query ) ; buffer.append ( ")" ) ; } return buffer.toString ( ) ; }
Source:
public boolean isStartupTimeoutPassed ( ) { java.util.Date waitTo = getBackend ( ) . getStartedAt ( ) . addSeconds ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DisableFenceAtStartupInSec ) ) ; java.util.Date now = new java.util.Date ( ) ; return ( waitTo.before ( now ) ) || ( waitTo.equals ( now ) ) ; }

Target:
public boolean isStartupTimeoutPassed ( ) { java.util.Date waitTo = backend.getStartedAt ( ) . addSeconds ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DisableFenceAtStartupInSec ) ) ; java.util.Date now = new java.util.Date ( ) ; return ( waitTo.before ( now ) ) || ( waitTo.equals ( now ) ) ; }
Source:
private boolean verifyUnsupportedDisks ( ) { for ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters : org.ovirt.engine.core.bll.storage.disk.MoveDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.storage.disk.MoveDisksCommand.getDiskDao ( ) . get ( moveDiskParameters.getImageGroupID ( ) ) ; org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) ; if ( ! ( validate ( diskValidator.validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ) ) { return false ; } } return true ; }

Target:
private boolean verifyUnsupportedDisks ( ) { for ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters : org.ovirt.engine.core.bll.storage.disk.MoveDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.storage.disk.MoveDisksCommand.getDiskDao ( ) . get ( moveDiskParameters.getImageGroupID ( ) ) ; org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk , vmDeviceUtils ) ; if ( ! ( validate ( diskValidator.validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ) ) { return false ; } } return true ; }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( result.getState ( ) ) ) ; if ( dataCenterGuideModel.removeConnection ) { dataCenterGuideModel.CleanConnection ( dataCenterGuideModel.connection , dataCenterGuideModel.hostId ) ; dataCenterGuideModel.removeConnection = false ; } dataCenterGuideModel.OnFinish ( dataCenterGuideModel.context , false , dataCenterGuideModel.storageModel ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( result.getState ( ) ) ) ; if ( dataCenterGuideModel.removeConnection ) { dataCenterGuideModel.cleanConnection ( dataCenterGuideModel.connection , dataCenterGuideModel.hostId ) ; dataCenterGuideModel.removeConnection = false ; } dataCenterGuideModel.onFinish ( dataCenterGuideModel.context , false , dataCenterGuideModel.storageModel ) ; }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
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 org.ovirt.engine.core.bll.context.CommandContext createContextForStatelessSnapshotCreation ( ) { java.util.Map < java.lang.String , java.lang.String > values = getVmValuesForMsgResolving ( ) ; org.ovirt.engine.core.common.job.Step createSnapshotsStep = addSubStep ( StepEnum.EXECUTING , StepEnum.CREATING_SNAPSHOTS , values ) ; org.ovirt.engine.core.bll.job.ExecutionContext createSnapshotsCtx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; createSnapshotsCtx.setMonitored ( true ) ; createSnapshotsCtx.setStep ( createSnapshotsStep ) ; return new org.ovirt.engine.core.bll.context.CommandContext ( createSnapshotsCtx , org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public void separeteCustomPropertiesToUserAndPredefined ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { java.lang.String customProperties = vmStatic.getCustomProperties ( ) ; org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.VMCustomProperties properties = parseProperties ( version , customProperties ) ; vmStatic.setPredefinedProperties ( properties.getPredefinedProperties ( ) ) ; vmStatic.setUserDefinedProperties ( properties.getUseDefinedProperties ( ) ) ; }

Target:
public void separeteCustomPropertiesToUserAndPredefined ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { java.lang.String customProperties = vmStatic.getCustomProperties ( ) ; org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.VMCustomProperties properties = parseProperties ( version , customProperties ) ; vmStatic.setPredefinedProperties ( properties.getPredefinedProperties ( ) ) ; vmStatic.setUserDefinedProperties ( properties.getUseDefinedProperties ( ) ) ; }
Source:
public java.util.List < T > getSelectedItems ( ) { if ( org.ovirt.engine.ui.common.widget.action.SimpleActionPanel.getDataProvider ( ) . getModel ( ) . isSingleSelectionOnly ( ) ) { return ( ( java.util.List < T > ) ( java.util.Collections.singletonList ( org.ovirt.engine.ui.common.widget.action.SimpleActionPanel.getDataProvider ( ) . getModel ( ) . getSingleSelectionModel ( ) . getSelectedObject ( ) ) ) ) ; } else { return org.ovirt.engine.ui.common.widget.action.SimpleActionPanel.getDataProvider ( ) . getModel ( ) . getOrderedMultiSelectionModel ( ) . getSelectedList ( ) ; } }

Target:
public java.util.List < T > getSelectedItems ( ) { return org.ovirt.engine.ui.common.widget.action.SimpleActionPanel.getDataProvider ( ) . getModel ( ) . getSelectedObjects ( ) ; }
Source:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { callback.asyncCallback.OnSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunPublicQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult ( queryType , parameters , null ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.OnFailure ( f ) ; }
Source:
private void InitOldParentTagName ( ) { if ( ( ( org.ovirt.engine.core.bll.MoveTagCommand.getTag ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MoveTagCommand.getTag ( ) . getparent_id ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.Tags parent = org.ovirt.engine.core.bll.TagsDirector.getInstance ( ) . GetTagById ( new org.ovirt.engine.core.compat.Guid ( org.ovirt.engine.core.bll.MoveTagCommand.getTag ( ) . getparent_id ( ) . toString ( ) ) ) ; if ( parent != null ) { _oldParnetTagName = parent.gettag_name ( ) ; } } }

Target:
private void InitOldParentTagName ( ) { if ( ( ( org.ovirt.engine.core.bll.MoveTagCommand.getTag ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MoveTagCommand.getTag ( ) . getparent_id ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.Tags parent = org.ovirt.engine.core.bll.TagsDirector.getInstance ( ) . getTagById ( new org.ovirt.engine.core.compat.Guid ( org.ovirt.engine.core.bll.MoveTagCommand.getTag ( ) . getparent_id ( ) . toString ( ) ) ) ; if ( parent != null ) { _oldParnetTagName = parent.gettag_name ( ) ; } } }
Source:
private void removeVmStatelessImages ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.bll.CommandContext context ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vmId , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , vmId ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vmId ) , context ) ; core : Introducing = $missing$ ; org.ovirt.engine.core.bll.runInternalXXX at ; } }

Target:
private void removeVmStatelessImages ( ) { if ( getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getDeviceList ( storageType ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getDeviceList ( storageType , options.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.network.ProviderNetwork ) ) { return false ; } org.ovirt.engine.core.common.businessentities.network.ProviderNetwork other = ( ( org.ovirt.engine.core.common.businessentities.network.ProviderNetwork ) ( obj ) ) ; return ( java.util.Objects.equals ( externalId , other.externalId ) ) && ( java.util.Objects.equals ( providerId , other.providerId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.network.ProviderNetwork ) ) { return false ; } org.ovirt.engine.core.common.businessentities.network.ProviderNetwork other = ( ( org.ovirt.engine.core.common.businessentities.network.ProviderNetwork ) ( obj ) ) ; return ( ( java.util.Objects.equals ( externalId , other.externalId ) ) && ( java.util.Objects.equals ( providerId , other.providerId ) ) ) && ( java.util.Objects.equals ( physicalNetworkId , other.physicalNetworkId ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getvds ( ) ; java.lang.String vdsName = ( ( vds != null ) && ( ( vds.getvds_name ( ) ) != null ) ) ? vds.getvds_name ( ) : "" ; jobProperties.put ( VdcObjectType.VDS.name ( ) . toLowerCase ( ) , vdsName ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getvds ( ) ; java.lang.String vdsName = ( ( vds != null ) && ( ( vds.getVdsName ( ) ) != null ) ) ? vds.getVdsName ( ) : "" ; jobProperties.put ( VdcObjectType.VDS.name ( ) . toLowerCase ( ) , vdsName ) ; } return jobProperties ; }
Source:
protected void updateIsHotPlugAvailable ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = ( ( vm.getvds_group_compatibility_version ( ) ) != null ) ? vm.getvds_group_compatibility_version ( ) : new org.ovirt.engine.core.compat.Version ( ) ; isHotPlugSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ; }

Target:
protected void updateConfigValues ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = ( ( vm.getVdsGroupCompatibilityVersion ( ) ) != null ) ? vm.getVdsGroupCompatibilityVersion ( ) : new org.ovirt.engine.core.compat.Version ( ) ; isHotPlugSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ; }
Source:
public void getFCStorageTypeForLun ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; lun.setLunConnections ( connections ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageType = command.getLUNStorageType ( lun ) ; org.junit.Assert.assertEquals ( "Lun disk should be of FC storage type since it does not had connections" , StorageType.FCP , storageType ) ; }

Target:
public void setup ( ) { org.mockito.Mockito.doReturn ( diskValidator ) . when ( command ) . getDiskValidator ( disk ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskValidator ) . isDiskExists ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskValidator ) . isDiskAttachedToVm ( vm ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator createValidatorForTestingValidateQosOverridden ( org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkId ( network.getId ( ) ) ; networkAttachment.setHostNetworkQos ( new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = java.util.Collections.singletonList ( networkAttachment ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setNetworkAttachments ( networkAttachments ) ; return new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setHost ( host ) . setParams ( params ) . addNetworks ( network ) . build ( ) ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( nullParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getNetworkAttachments ( ) ) == null ) { parameters.setNetworkAttachments ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ( ) ) ; } parameters.getNetworkAttachments ( ) . addAll ( java.util.Arrays.asList ( networkAttachments ) ) ; return this ; }
Source:
private java.util.List < java.lang.String > createLocaleKeys ( ) { java.util.List < java.lang.String > keys = new java.util.ArrayList < java.lang.String > ( ) ; keys.add ( "de_DE" ) ; keys.add ( "en_US" ) ; keys.add ( "es_ES" ) ; keys.add ( "fr_FR" ) ; keys.add ( "ja_JP" ) ; keys.add ( "pt_BR" ) ; keys.add ( "zh_CN" ) ; return keys ; }

Target:
private java.util.List < java.lang.String > createLocaleKeys ( ) { java.util.List < java.lang.String > keys = new java.util.ArrayList < java.lang.String > ( ) ; keys.add ( "de_DE" ) ; keys.add ( "en_US" ) ; keys.add ( "es_ES" ) ; keys.add ( "fr_FR" ) ; keys.add ( "ja_JP" ) ; keys.add ( "ko_KR" ) ; keys.add ( "pt_BR" ) ; keys.add ( "zh_CN" ) ; return keys ; }
Source:
public void testIsCrossReference ( ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( true ) ; assertTrue ( "EVENTS" , comp.isCrossReferece ( "EVENTS" , "TEMPLATES" ) ) ; assertFalse ( "Garbage Cross" , comp.isCrossReferece ( "fsfsdf" , "TEMPLATES" ) ) ; assertFalse ( "Garbage Object" , comp.isCrossReferece ( "EVENTS" , "fsfds" ) ) ; assertFalse ( "Null Object" , comp.isCrossReferece ( "EVENTS" , null ) ) ; assertFalse ( "Null text" , comp.isCrossReferece ( null , "TEMPLATES" ) ) ; }

Target:
public void testIsCrossReference ( ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( true ) ; org.junit.Assert.assertTrue ( "EVENTS" , comp.isCrossReferece ( "EVENTS" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Cross" , comp.isCrossReferece ( "fsfsdf" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Object" , comp.isCrossReferece ( "EVENTS" , "fsfds" ) ) ; org.junit.Assert.assertFalse ( "Null Object" , comp.isCrossReferece ( "EVENTS" , null ) ) ; org.junit.Assert.assertFalse ( "Null text" , comp.isCrossReferece ( null , "TEMPLATES" ) ) ; }
Source:
protected void setUpGetPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , getPayloadModel ( ) ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( QueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , getPayloadModel ( ) ) ; } }
Source:
private static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { if ( ( ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) || ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) . equals ( iface.getNetworkName ( ) ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }

Target:
private static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { final org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil managementNetworkUtil = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getManagementNetworkUtil ( ) ; if ( ( ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) || ( managementNetworkUtil.isManagementNetwork ( iface.getNetworkName ( ) , host.getVdsGroupId ( ) ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }
Source:
public static void GetStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( id ) , aQuery ) ; }
Source:
private void removeMemoryVolumes ( java.lang.String memoryVolume , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolume , vmId ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.log.errorFormat ( "Failed to remove memory volumes: {0}" , memoryVolume ) ; } }

Target:
private void removeMemoryVolumes ( java.lang.String memoryVolume , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolume , vmId ) , org.ovirt.engine.core.bll.ImportVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.log.errorFormat ( "Failed to remove memory volumes: {0}" , memoryVolume ) ; } }
Source:
public void failRunStatelessSnapshotInPreview ( ) { java.util.Random rand = new java.util.Random ( ) ; canRunVmAsStateless ( rand.nextBoolean ( ) , true , true , true , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; canRunVmAsStateless ( rand.nextBoolean ( ) , true , true , null , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; canRunVmAsStateless ( rand.nextBoolean ( ) , true , false , true , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void failRunStatelessSnapshotInPreview ( ) { java.util.Random rand = new java.util.Random ( ) ; canRunVmAsStateless ( rand.nextBoolean ( ) , true , true , true , false , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; canRunVmAsStateless ( rand.nextBoolean ( ) , true , true , null , false , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; canRunVmAsStateless ( rand.nextBoolean ( ) , true , false , true , false , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
private void removeVmSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < java.lang.String > memoriesOfRemovedSnapshots = snapshotsManager.removeSnapshots ( vm.getId ( ) ) ; if ( ! ( memoriesOfRemovedSnapshots.isEmpty ( ) ) ) { new org.ovirt.engine.core.bll.memory.MemoryImageRemoverOnDataDomain ( vm , this ) . removeMemoryVolumes ( memoriesOfRemovedSnapshots ) ; } }

Target:
private void removeVmSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < java.lang.String > memoryStates = snapshotsManager.removeSnapshots ( vm.getId ( ) ) ; if ( ! ( memoryStates.isEmpty ( ) ) ) { new org.ovirt.engine.core.bll.memory.MemoryImageRemoverOnDataDomain ( vm , this ) . remove ( memoryStates ) ; } }
Source:
public void testPersistNetworkAttachmentsWhenIpConfigurationChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentForClusterNetworkA = createNetworkAttachment ( clusterNetworkA ) ; networkAttachmentForClusterNetworkA.setNicId ( interfaceWithAttachedClusterNetworkA.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = org.ovirt.engine.core.utils.NetworkUtils.createIpConfigurationFromVdsNetworkInterface ( interfaceWithAttachedClusterNetworkA ) ; ipConfiguration.getPrimaryAddress ( ) . setAddress ( "192.168.1.11" ) ; networkAttachmentForClusterNetworkA.setIpConfiguration ( ipConfiguration ) ; networkAttachmentForClusterNetworkA.setProperties ( customPropertiesForNics.getCustomPropertiesFor ( interfaceWithAttachedClusterNetworkA ) ) ; callPersistNetworkAttachmentsAndVerifyThatNetworkAttachmentIsSynced ( networkAttachmentForClusterNetworkA , createLegacyPersister ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) ) ; }

Target:
public void testPersistNetworkAttachmentsWhenNetworkMovedToDifferentNic ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentForClusterNetworkA = createNetworkAttachment ( clusterNetworkA ) ; org.ovirt.engine.core.compat.Guid notUpToDateNicId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; networkAttachmentForClusterNetworkA.setNicId ( notUpToDateNicId ) ; networkAttachmentForClusterNetworkA.setNicName ( "nonsense" ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = org.ovirt.engine.core.common.utils.NetworkCommonUtils.createIpConfigurationFromVdsNetworkInterface ( interfaceWithAttachedClusterNetworkA ) ; networkAttachmentForClusterNetworkA.setIpConfiguration ( ipConfiguration ) ; networkAttachmentForClusterNetworkA.setProperties ( customPropertiesForNics.getCustomPropertiesFor ( interfaceWithAttachedClusterNetworkA ) ) ; callPersistNetworkAttachmentsAndVerifyThatNetworkAttachmentIsSynced ( networkAttachmentForClusterNetworkA , createPersister ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , failure ) ; }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }
Source:
public void storageTypeUnsupported ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; sd.setStorageType ( StorageType.CINDER ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }

Target:
public void storageTypeUnsupported ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; sd.setStorageType ( StorageType.CINDER ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }
Source:
protected org.ovirt.engine.api.model.HostNIC slave ( java.lang.String id ) { org.ovirt.engine.api.model.HostNIC slave = new org.ovirt.engine.api.model.HostNIC ( ) ; slave.setId ( id ) ; slave.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; slave.getHost ( ) . setId ( hostId ) ; slave = org.ovirt.engine.api.common.util.LinkHelper.addLinks ( getUriInfo ( ) , slave ) ; slave.setHost ( null ) ; return slave ; }

Target:
protected org.ovirt.engine.api.model.HostNIC slave ( java.lang.String id ) { org.ovirt.engine.api.model.HostNIC slave = new org.ovirt.engine.api.model.HostNIC ( ) ; slave.setId ( id ) ; slave.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; slave.getHost ( ) . setId ( hostId ) ; slave = org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , slave ) ; slave.setHost ( null ) ; return slave ; }
Source:
public static void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }