auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VmHostDevice > getExistingVmHostDevicesByName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > existingDevices = org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmId ( ) , VmDeviceGeneralType.HOSTDEV ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmHostDevice > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : existingDevices ) { result.add ( new org.ovirt.engine.core.common.businessentities.VmHostDevice ( device ) ) ; } return org.ovirt.engine.core.common.businessentities.Entities.vmDevicesByDevice ( result ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VmHostDevice > getExistingVmHostDevicesByName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > existingDevices = org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmId ( ) , VmDeviceGeneralType.HOSTDEV ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmHostDevice > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : existingDevices ) { result.add ( new org.ovirt.engine.core.common.businessentities.VmHostDevice ( device ) ) ; } return org.ovirt.engine.core.bll.utils.VmDeviceUtils.vmDevicesByDevice ( result ) ; }
Source:
protected void grayOutItem ( java.util.ArrayList < java.lang.String > grayOutReasons , org.ovirt.engine.ui.uicommonweb.models.storage.LunModel model , org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable < org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.storage.LunModel > > table ) { for ( int row = 0 ; row < ( table.getRowCount ( ) ) ; row ++ ) { if ( table.getVisibleItem ( row ) . equals ( model ) ) { com.google.gwt.dom.client.TableRowElement tableRowElement = table.getRowElement ( row ) ; tableRowElement.setPropertyBoolean ( "disabled" , true ) ; updateInputTitle ( grayOutReasons , tableRowElement ) ; } } }

Target:
protected void grayOutItem ( java.util.ArrayList < java.lang.String > grayOutReasons , org.ovirt.engine.ui.uicommonweb.models.storage.LunModel model , org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable < org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.storage.LunModel > > table ) { for ( int row = 0 ; row < ( table.getRowCount ( ) ) ; row ++ ) { com.google.gwt.dom.client.TableRowElement tableRowElement = table.getRowElement ( row ) ; if ( table.getVisibleItem ( row ) . equals ( model ) ) { tableRowElement.setPropertyBoolean ( "disabled" , true ) ; updateInputTitle ( grayOutReasons , tableRowElement ) ; } else { org.ovirt.engine.ui.common.utils.ElementTooltipUtils.destroyTooltip ( tableRowElement ) ; } } }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( getMessage ( ) ) == null ? 0 : getMessage ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getVariableReplacements ( ) ) == null ? 0 : getVariableReplacements ( ) . hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.bll.ValidationResult ) ) { return false ; } org.ovirt.engine.core.bll.ValidationResult other = ( ( org.ovirt.engine.core.bll.ValidationResult ) ( obj ) ) ; return ( java.util.Objects.equals ( message , other.message ) ) && ( java.util.Objects.equals ( variableReplacements , other.variableReplacements ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( object.getMemSizeMB ( ) ) == null ) { return "" ; } else if ( object.getMemSizeMB ( ) . equals ( QuotaVdsGroup.UNLIMITED_MEM ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.tab.quota.SubTabQuotaClusterView.messages.unlimitedMemConsumption ( object.getMemSizeMBUsage ( ) ) ; } else { return org.ovirt.engine.ui.webadmin.section.main.view.tab.quota.SubTabQuotaClusterView.messages.limitedMemConsumption ( object.getMemSizeMBUsage ( ) , object.getMemSizeMB ( ) ) ; } }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaCluster object ) { if ( ( object.getMemSizeMB ( ) ) == null ) { return "" ; } else if ( object.getMemSizeMB ( ) . equals ( QuotaCluster.UNLIMITED_MEM ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.tab.quota.SubTabQuotaClusterView.messages.unlimitedMemConsumption ( object.getMemSizeMBUsage ( ) ) ; } else { return org.ovirt.engine.ui.webadmin.section.main.view.tab.quota.SubTabQuotaClusterView.messages.limitedMemConsumption ( object.getMemSizeMBUsage ( ) , object.getMemSizeMB ( ) ) ; } }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
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.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void testGetStorageDomainIdWithPermissions ( ) { mockStoragePoolDao ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.mockito.Mockito.when ( storageDomainDaoMock.getIsoStorageDomainIdForPool ( getQueryParameters ( ) . getStoragePoolId ( ) , StorageDomainStatus.Active ) ) . thenReturn ( storageDomainId ) ; org.junit.Assert.assertEquals ( "wrong storage domain id" , storageDomainId , getQuery ( ) . getStorageDomainIdForQuery ( ) ) ; }

Target:
public void testGetStorageDomainIdWithPermissions ( org.ovirt.engine.core.common.businessentities.storage.ImageFileType expectedType ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getImageType ( ) ) . thenReturn ( expectedType ) ; mockStoragePoolDao ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.mockito.Mockito.when ( storageDomainDaoMock.getIsoStorageDomainIdForPool ( getQueryParameters ( ) . getStoragePoolId ( ) , StorageDomainStatus.Active ) ) . thenReturn ( storageDomainId ) ; org.junit.jupiter.api.Assertions.assertEquals ( storageDomainId , getQuery ( ) . getStorageDomainIdForQuery ( ) , "wrong storage domain id" ) ; }
Source:
public void canDoActionNoDisksSpecified ( ) { initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED.toString ( ) ) ) ; }

Target:
public void canDoActionNoDisksSpecified ( ) { initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED.toString ( ) ) ) ; }
Source:
public static void GetLocalFSPath ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }
Source:
void setSessionId ( java.lang.String sessionId ) { clientStorage.setLocalItem ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_KEY , sessionId ) ; }

Target:
public void reuseSession ( ) { if ( ( getSessionId ( ) ) != null ) { processSessionId ( getSessionId ( ) ) ; } else { getSessionId ( new org.ovirt.engine.ui.frontend.communication.StorageCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { if ( result != null ) { restApiSessionId = result ; processSessionId ( result ) ; } else { processSessionIdException ( ) ; } } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { processSessionIdException ( ) ; } private void processSessionIdException ( ) { org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.logger.severe ( "Engine REST API session ID is not available" ) ; } } ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Job model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.junit.Assert.assertTrue ( model.isExternal ( ) ) ; org.junit.Assert.assertTrue ( model.isAutoCleared ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Job model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( model.isExternal ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( model.isAutoCleared ( ) ) ; verifyLinks ( model ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 3 , VMStatus.Down ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVm , org.ovirt.engine.core.common.action.VmManagementParametersBase.class , new java.lang.String [ ] { "VmStaticData.iso_path" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendCdRomResourceTest.ISO_PATH } , true , true ) ) ; org.ovirt.engine.api.model.CdRom cdrom = resource.update ( getUpdate ( ) ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 3 , VMStatus.Down ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVm , org.ovirt.engine.core.common.action.VmManagementParametersBase.class , new java.lang.String [ ] { "VmStaticData.IsoPath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendCdRomResourceTest.ISO_PATH } , true , true ) ) ; org.ovirt.engine.api.model.CdRom cdrom = resource.update ( getUpdate ( ) ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { org.ovirt.engine.ui.uicommonweb.Configurator configurator = ( ( org.ovirt.engine.ui.uicommonweb.Configurator ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . Resolve ( org.ovirt.engine.ui.uicommonweb.Configurator.class ) ) ) ; if ( configurator.isDocumentationAvailable ( ) ) { java.lang.String url = ( configurator.getDocumentationLibURL ( ) ) + ( documentationGuidePath ) ; org.ovirt.engine.ui.common.utils.WebUtils.openUrlInNewWindow ( windowName , url , WebUtils.OPTION_SCROLLBARS ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { org.ovirt.engine.ui.uicommonweb.Configurator configurator = ( ( org.ovirt.engine.ui.uicommonweb.Configurator ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.Configurator.class ) ) ) ; if ( configurator.isDocumentationAvailable ( ) ) { java.lang.String url = ( configurator.getDocumentationLibURL ( ) ) + ( documentationGuidePath ) ; org.ovirt.engine.ui.common.utils.WebUtils.openUrlInNewWindow ( windowName , url , WebUtils.OPTION_SCROLLBARS ) ; } }
Source:
public void getVdsWithVdsId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setrun_on_vds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , v.getId ( ) ) ; }

Target:
public void getVdsWithVdsId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , v.getId ( ) ) ; }
Source:
public void testRetryWithInfiniteNumberOfRetries ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy policy = new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 5 , 0 , java.io.IOException.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; org.mockito.Mockito.stub ( callable.call ( ) ) . toThrow ( new java.io.IOException ( ) ) ; retryable.call ( ) ; }

Target:
public void testRetryWithInfiniteNumberOfRetries ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy policy = new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 5 , 0 , 10 , java.io.IOException.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; org.mockito.Mockito.stub ( callable.call ( ) ) . toThrow ( new java.io.IOException ( ) ) ; retryable.call ( ) ; }
Source:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void mockAsyncDataProvider ( ) { final org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider adp = org.mockito.Mockito.mock ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.class ) ; org.mockito.Mockito.when ( adp.getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( adp.osNameExists ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.OS_TYPE ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( adp.getMaxVmNameLengthWin ( ) ) . thenReturn ( 15 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setInstance ( adp ) ; }

Target:
public static void mockAsyncDataProvider ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider adp = org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.setup.getMocks ( ) . asyncDataProvider ( ) ; org.mockito.Mockito.when ( adp.getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( adp.osNameExists ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.OS_TYPE ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( adp.getMaxVmNameLengthWin ( ) ) . thenReturn ( 15 ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc stopImageTransferSession ( java.lang.String ticketId , java.lang.String spId , java.lang.String sdId , java.lang.String imgId , java.lang.String volId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.stopImageTransferSession" ) . withParameter ( "ticketUUID" , ticketId ) . withParameter ( "spUUID" , spId ) . withParameter ( "sdUUID" , sdId ) . withParameter ( "imgUUID" , imgId ) . withParameter ( "volUUID" , volId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extend_image_ticket ( java.lang.String ticketId , long timeout ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.extend_image_ticket" ) . withParameter ( "uuid" , ticketId ) . withParameter ( "timeout" , timeout ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( macPoolDaoMock.getDcUsageCount ( org.mockito.Matchers.eq ( macPool.getId ( ) ) ) ) . thenReturn ( 0 ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.MacPoolValidator ( macPool ) . notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.getAllDataCentersByMacPoolId ( macPool.getId ( ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.StoragePool > emptyList ( ) ) ; org.junit.Assert.assertThat ( macPoolValidator.notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
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.VM > ( ) ; } return source ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public static org.ovirt.engine.api.model.PmProxyType fromValue ( java.lang.String v ) { try { if ( v == null ) { return null ; } if ( v.equals ( "cluster" ) ) { return org.ovirt.engine.api.model.PmProxyType.CLUSTER ; } else if ( v.equals ( "dc" ) ) { return org.ovirt.engine.api.model.PmProxyType.DC ; } else { return null ; } } catch ( java.lang.IllegalArgumentException e ) { return null ; } }

Target:
public static org.ovirt.engine.api.model.PmProxyType fromValue ( java.lang.String v ) { try { if ( v == null ) { return null ; } if ( v.equals ( "cluster" ) ) { return org.ovirt.engine.api.model.PmProxyType.CLUSTER ; } else if ( v.equals ( "dc" ) ) { return org.ovirt.engine.api.model.PmProxyType.DC ; } else if ( v.equals ( "other_dc" ) ) { return org.ovirt.engine.api.model.PmProxyType.OTHER_DC ; } else { return null ; } } catch ( java.lang.IllegalArgumentException e ) { return null ; } }
Source:
public void reportCompleted ( ) { if ( isRunAndPaused ( ) ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , true ) ; } else { super . reportCompleted ( ) ; } }

Target:
public void reportCompleted ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , true ) ; } else { super . reportCompleted ( ) ; } }
Source:
public static void getRpmVersion ( 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.VdcBllMessages message = org.ovirt.engine.core.common.errors.VdcBllMessages.BOND_REFERENCES_NICS_INCOHERENTLY ; return validateCoherentIdentification ( bond.getId ( ) , nicId , nicName , message , existingInterfacesMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return validateCoherentIdentification ( bond.getId ( ) , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
public void run ( ) { processVmPoolOnStopVm ( ) ; }

Target:
public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vdsId : getRunVdssList ( ) ) { if ( ! ( getCurrentVdsId ( ) . equals ( vdsId ) ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.FailedToRunVm , new org.ovirt.engine.core.common.vdscommands.FailedToRunVmVDSCommandParameters ( vdsId ) ) ; } } }
Source:
public static void IsMTUOverrideSupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
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.VmGuestAgentInterface > ( ) ; } return source ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( asyncTask.getCommandId ( ) ) ; if ( ( asyncTask.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) { cmdEntity.setCommandStatus ( CommandStatus.SUCCEEDED ) ; } coco.persistCommand ( map ( asyncTask , cmdEntity ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask ) ; return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.CommandEntity getParentCommandEntity ( org.ovirt.engine.core.compat.Guid cmdId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( cmdId ) ; if ( cmdEntity == null ) { cmdEntity = coco.createCommandEntity ( cmdId , actionType , parameters ) ; if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( cmdId ) ) ) { cmdEntity.setCommandStatus ( CommandStatus.ACTIVE ) ; coco.persistCommand ( cmdEntity ) ; } } return cmdEntity ; }
Source:
protected void refreshModel ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; super . SyncSearch ( VdcQueryType.GetAllAuditLogsByVMName , new org.ovirt.engine.core.common.queries.GetAllAuditLogsByVMNameParameters ( vm.getvm_name ( ) ) ) ; }

Target:
protected void refreshModel ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; super . SyncSearch ( VdcQueryType.GetAllAuditLogsByVMName , new org.ovirt.engine.core.common.queries.GetAllAuditLogsByVMNameParameters ( vm.getVmName ( ) ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GraphicsConsole console ) { org.ovirt.engine.core.common.businessentities.GraphicsDevice device = getMapper ( org.ovirt.engine.api.model.GraphicsConsole.class , org.ovirt.engine.core.common.businessentities.GraphicsDevice.class ) . map ( console , null ) ; device.setVmId ( guid ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase res = doCreateEntity ( VdcActionType.AddGraphicsDevice , createAddGraphicsDeviceParams ( device ) ) ; if ( ( res != null ) && ( res.getSucceeded ( ) ) ) { return org.ovirt.engine.api.restapi.resource.BackendGraphicsConsoleHelper.find ( console , this :: list ) ; } throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.NOT_FOUND ) . build ( ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GraphicsConsole console ) { org.ovirt.engine.core.common.businessentities.GraphicsDevice device = getMapper ( org.ovirt.engine.api.model.GraphicsConsole.class , org.ovirt.engine.core.common.businessentities.GraphicsDevice.class ) . map ( console , null ) ; device.setVmId ( guid ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase res = doCreateEntity ( VdcActionType.AddGraphicsAndVideoDevices , createAddGraphicsDeviceParams ( device ) ) ; if ( ( res != null ) && ( res.getSucceeded ( ) ) ) { return org.ovirt.engine.api.restapi.resource.BackendGraphicsConsoleHelper.find ( console , this :: list ) ; } throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.NOT_FOUND ) . build ( ) ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { getVmTemplate ( ) . setVdsGroupId ( getVdsGroupId ( ) ) ; getVmTemplate ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVmTemplate ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVmTemplate ( ) . setVdsGroupId ( getVdsGroupId ( ) ) ; getVmTemplate ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVmTemplate ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) , getUserId ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageSnapshotListModel storageSnapshotListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageSnapshotListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > newItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.DiskImageByActualSizeComparer ( ) ) ; java.util.Collections.reverse ( newItems ) ; storageSnapshotListModel.setItems ( newItems ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } super . syncSearch ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( getEntity ( ) . getId ( ) ) ; parameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDiskSnapshotsByStorageDomainId , parameters , new org.ovirt.engine.ui.uicommonweb.models.storage.SetSortedItemsAsyncQuery ( java.util.Collections.reverseOrder ( new org.ovirt.engine.ui.uicommonweb.Linq.DiskImageByActualSizeComparer ( ) ) ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > getLinuxOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; }

Target:
private static void initOsIds ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds = new java.util.ArrayList < java.lang.Integer > ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.keySet ( ) ) ; java.util.Collections.sort ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds , new java.util.Comparator < java.lang.Integer > ( ) { @ java.lang.Override public int compare ( java.lang.Integer o1 , java.lang.Integer o2 ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o1 ) . compareTo ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o2 ) ) ; } } ) ; }
Source:
public org.ovirt.engine.ui.common.widget.ImageWithDecorator getValue ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; com.google.gwt.resources.client.ImageResource changesImage = null ; if ( ( vm != null ) && ( vm.isNextRunConfigurationExists ( ) ) ) { changesImage = getApplicationResources ( ) . vmDelta ( ) ; } return new org.ovirt.engine.ui.common.widget.ImageWithDecorator ( getMainImage ( item ) , changesImage , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_LEFT , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_TOP ) ; }

Target:
public org.ovirt.engine.ui.common.widget.ImageWithDecorator getValue ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; com.google.gwt.resources.client.ImageResource changesImage = null ; if ( ( vm != null ) && ( vm.isNextRunConfigurationExists ( ) ) ) { changesImage = org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.resources.vmDelta ( ) ; } return new org.ovirt.engine.ui.common.widget.ImageWithDecorator ( getMainImage ( item ) , changesImage , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_LEFT , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_TOP ) ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vds.getId ( ) , reason , customLogValues ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( ActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vds.getId ( ) , reason , customLogValues ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class ) . runInternalAction ( ActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
private boolean isMakeCreatorExplicitOwner ( ) { return ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isMakeCreatorExplicitOwner ( ) ) || ( ( ( org.ovirt.engine.core.bll.AddVmCommand.getCurrentUser ( ) ) != null ) && ( ! ( checkUserAuthorization ( org.ovirt.engine.core.bll.AddVmCommand.getCurrentUser ( ) . getId ( ) , ActionGroup.MANIPULATE_PERMISSIONS , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , VdcObjectType.VM ) ) ) ) ; }

Target:
private boolean isMakeCreatorExplicitOwner ( ) { return ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isMakeCreatorExplicitOwner ( ) ) || ( ( ( ( org.ovirt.engine.core.bll.AddVmCommand.getCurrentUser ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getPoolId ( ) ) == null ) ) && ( ! ( checkUserAuthorization ( org.ovirt.engine.core.bll.AddVmCommand.getCurrentUser ( ) . getId ( ) , ActionGroup.MANIPULATE_PERMISSIONS , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , VdcObjectType.VM ) ) ) ) ; }
Source:
public void testDisplayTypes ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > > supportedGraphicsAndDisplays = OsRepositoryImpl.INSTANCE.getGraphicsAndDisplays ( ) . get ( 777 ) . get ( null ) ; boolean isSizeCorrect = ( supportedGraphicsAndDisplays.size ( ) ) == 2 ; boolean containsSameElements = new java.util.HashSet ( supportedGraphicsAndDisplays ) . equals ( new java.util.HashSet ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.utils.Pair ( org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE , org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) , new org.ovirt.engine.core.common.utils.Pair ( org.ovirt.engine.core.common.businessentities.GraphicsType.VNC , org.ovirt.engine.core.common.businessentities.DisplayType.cirrus ) ) ) ) ; org.junit.Assert.assertTrue ( isSizeCorrect ) ; org.junit.Assert.assertTrue ( containsSameElements ) ; }

Target:
public void testDisplayTypes ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > > supportedGraphicsAndDisplays = OsRepositoryImpl.INSTANCE.getGraphicsAndDisplays ( ) . get ( 777 ) . get ( null ) ; boolean isSizeCorrect = ( supportedGraphicsAndDisplays.size ( ) ) == 2 ; boolean containsSameElements = new java.util.HashSet ( supportedGraphicsAndDisplays ) . equals ( new java.util.HashSet ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.utils.Pair ( org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE , org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) , new org.ovirt.engine.core.common.utils.Pair ( org.ovirt.engine.core.common.businessentities.GraphicsType.VNC , org.ovirt.engine.core.common.businessentities.DisplayType.cirrus ) ) ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( isSizeCorrect ) ; org.junit.jupiter.api.Assertions.assertTrue ( containsSameElements ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo prepareServerInfo ( java.util.Map < java.lang.String , java.lang.Object > map ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ( ) ; entity.setHostnameOrIp ( map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServersListReturnForXmlRpc.HOST_NAME ) . toString ( ) ) ; entity.setUuid ( new org.ovirt.engine.core.compat.Guid ( map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServersListReturnForXmlRpc.UUID ) . toString ( ) ) ) ; java.lang.String status = map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServersListReturnForXmlRpc.PEER_STATUS ) . toString ( ) ; entity.setStatus ( org.ovirt.engine.core.common.businessentities.gluster.PeerStatus.valueOf ( status ) ) ; return entity ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo prepareServerInfo ( java.util.Map < java.lang.String , java.lang.Object > map ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ( ) ; entity.setHostnameOrIp ( map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServersListReturn.HOST_NAME ) . toString ( ) ) ; entity.setUuid ( new org.ovirt.engine.core.compat.Guid ( map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServersListReturn.UUID ) . toString ( ) ) ) ; java.lang.String status = map.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServersListReturn.PEER_STATUS ) . toString ( ) ; entity.setStatus ( org.ovirt.engine.core.common.businessentities.gluster.PeerStatus.valueOf ( status ) ) ; return entity ; }
Source:
private void refreshVmStats ( ) { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > pair : monitoredVms ) { if ( tryLockVmForUpdate ( pair ) ) { org.ovirt.engine.core.vdsbroker.VmAnalyzer vmAnalyzer = new org.ovirt.engine.core.vdsbroker.VmAnalyzer ( pair.getFirst ( ) , pair.getSecond ( ) , this , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirectorDelegator.getInstance ( ) ) ; vmAnalyzers.add ( vmAnalyzer ) ; vmAnalyzer.analyze ( ) ; } else { org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.debug ( ( "skipping VM '{}' from this monitoring cycle" + " - the VM is locked by its VmManager " ) , getVmId ( pair ) ) ; } } }

Target:
private void refreshVmStats ( ) { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > pair : monitoredVms ) { if ( tryLockVmForUpdate ( pair ) ) { org.ovirt.engine.core.vdsbroker.VmAnalyzer vmAnalyzer = new org.ovirt.engine.core.vdsbroker.VmAnalyzer ( pair.getFirst ( ) , pair.getSecond ( ) , this , auditLogDirector ) ; vmAnalyzers.add ( vmAnalyzer ) ; vmAnalyzer.analyze ( ) ; } else { org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.debug ( ( "skipping VM '{}' from this monitoring cycle" + " - the VM is locked by its VmManager " ) , getVmId ( pair ) ) ; } } }
Source:
public org.ovirt.engine.core.compat.Guid findActiveISODomain ( org.ovirt.engine.core.compat.Guid storagePoolId ) { return null ; }

Target:
public void testNoDiskBootFromIsoDomain ( ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer mock = mockIsoDomainListSyncronizer ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.compat.Guid ( ) ) . when ( mock ) . findActiveISODomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.CD , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , true , null ) ; }