auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.compat.Guid pickProxyHostFromDataCenter ( ) { org.ovirt.engine.core.compat.Guid dataCenterId = org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdss = org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getDbFacade ( ) . getVdsDao ( ) . getAllForStoragePoolAndStatus ( dataCenterId , VDSStatus.Up ) ; if ( vdss.isEmpty ( ) ) { logNoProxyAvailable ( dataCenterId ) ; throw new java.lang.IllegalArgumentException ( ) ; } return vdss.get ( 0 ) . getId ( ) ; }

Target:
private org.ovirt.engine.core.compat.Guid pickProxyHostFromDataCenter ( ) { org.ovirt.engine.core.compat.Guid dataCenterId = org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdss = vdsDao.getAllForStoragePoolAndStatus ( dataCenterId , VDSStatus.Up ) ; if ( vdss.isEmpty ( ) ) { logNoProxyAvailable ( dataCenterId ) ; throw new java.lang.IllegalArgumentException ( ) ; } return vdss.get ( 0 ) . getId ( ) ; }
Source:
public javax.ws.rs.core.Response reorderMacAddresses ( org.ovirt.engine.api.model.Action action ) { getEntity ( org.ovirt.engine.api.model.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , ( "VM: id=" + ( guid ) ) , true ) ; final org.ovirt.engine.core.common.action.VmOperationParameterBase params = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( guid ) ; final javax.ws.rs.core.Response response = doAction ( VdcActionType.ReorderVmNics , params , action ) ; return response ; }

Target:
public javax.ws.rs.core.Response reorderMacAddresses ( org.ovirt.engine.api.model.Action action ) { getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , ( "VM: id=" + ( guid ) ) , true ) ; final org.ovirt.engine.core.common.action.VmOperationParameterBase params = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( guid ) ; final javax.ws.rs.core.Response response = doAction ( VdcActionType.ReorderVmNics , params , action ) ; return response ; }
Source:
private void DataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.DataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }

Target:
private void defaultHost_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.defaultHost_SelectedItemChanged ( ) ; }
Source:
public static void getClusterById ( 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.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
protected void removeQuotaCommandLeftOver ( ) { org.ovirt.engine.core.bll.QuotaManager.removeStorageDeltaQuotaCommand ( org.ovirt.engine.core.bll.AddDiskCommand.getQuotaId ( ) , getStorageDomainId ( ) . getValue ( ) , org.ovirt.engine.core.bll.AddDiskCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) , org.ovirt.engine.core.bll.AddDiskCommand.getCommandId ( ) ) ; }

Target:
public void rollbackQuota ( ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.bll.AddDiskCommand.getQuotaManager ( ) . rollbackQuota ( org.ovirt.engine.core.bll.AddDiskCommand.getStoragePool ( ) , org.ovirt.engine.core.bll.AddDiskCommand.getQuotaManager ( ) . getQuotaListFromParameters ( getStorageQuotaListParameters ( ) ) ) ; } }
Source:
public void testSetValidatorWithOutKey ( ) { org.ovirt.engine.core.config.EngineConfigMap engineConfigMap = org.mockito.Mockito.mock ( org.ovirt.engine.core.config.EngineConfigMap.class ) ; org.mockito.Mockito.when ( engineConfigMap.getValue ( ) ) . thenReturn ( "valueToSet" ) ; org.ovirt.engine.core.config.validation.ConfigActionType setAction = org.ovirt.engine.core.config.validation.ConfigActionType.ACTION_SET ; setAction.validate ( engineConfigMap ) ; }

Target:
public void testSetValidatorWithOutKey ( ) { org.ovirt.engine.core.config.EngineConfigMap engineConfigMap = org.mockito.Mockito.mock ( org.ovirt.engine.core.config.EngineConfigMap.class ) ; org.mockito.Mockito.when ( engineConfigMap.getValue ( ) ) . thenReturn ( "valueToSet" ) ; org.ovirt.engine.core.config.validation.ConfigActionType setAction = org.ovirt.engine.core.config.validation.ConfigActionType.ACTION_SET ; org.junit.jupiter.api.Assertions.assertThrows ( java.lang.IllegalArgumentException.class , ( ) -> setAction.validate ( engineConfigMap ) ) ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain getEntity ( int index ) { return org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainsResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.api.model.StorageDomain.class ) , index , StorageType.NFS ) ; }

Target:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachStorageDomainFromPool , org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { try { org.ovirt.engine.core.sso.servlets.OpenIdConfigurationServlet.sendJsonData ( response , buildResponse ( request ) ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.sso.utils.SsoUtils.sendJsonDataWithMessage ( response , SsoConstants.ERR_CODE_SERVER_ERROR , ex ) ; } }

Target:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { try { org.ovirt.engine.core.sso.utils.SsoUtils.sendJsonData ( response , org.ovirt.engine.core.sso.servlets.OpenIdUtils.getJson ( buildResponse ( request ) ) ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.sso.utils.SsoUtils.sendJsonDataWithMessage ( response , SsoConstants.ERR_CODE_SERVER_ERROR , ex ) ; } }
Source:
public boolean qosParametersEqual ( ) { if ( ( ifaceQos ) == ( hostNetworkQos ) ) { return true ; } boolean ifaceQosUnset = qosUnset ( ifaceQos ) ; boolean hostNetworkQosUnset = qosUnset ( hostNetworkQos ) ; if ( ifaceQosUnset && hostNetworkQosUnset ) { return true ; } if ( ifaceQosUnset != hostNetworkQosUnset ) { return false ; } return ( ( isOutAverageLinkShareInSync ( ) ) && ( isOutAverageUpperLimitInSync ( ) ) ) && ( isOutAverageRealTimeInSync ( ) ) ; }

Target:
private boolean isIpv6GatewayInSync ( ) { java.lang.String gatewayDesiredValue = getIpv6PrimaryAddress ( ) . getGateway ( ) ; java.lang.String gatewayActualValue = iface.getIpv6Gateway ( ) ; boolean bothBlank = ( org.apache.commons.lang.StringUtils.isBlank ( gatewayDesiredValue ) ) && ( org.apache.commons.lang.StringUtils.isBlank ( gatewayActualValue ) ) ; return bothBlank || ( java.util.Objects.equals ( gatewayDesiredValue , gatewayActualValue ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc glusterSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc ( vdsServer.glusterSnapshotCreate ( volumeName , snapshotName , description , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDeleteAll ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotDeleteAll ( volumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testSimple ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Label red = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( ) . entities ( vm , host1 ) . build ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Label > labels = java.util.Collections.singletonList ( red ) ; org.mockito.Mockito.doReturn ( labels ) . when ( labelDao ) . getAllByEntityIds ( org.mockito.Matchers.any ( ) ) ; org.assertj.core.api.Assertions.assertThat ( unit.filter ( cluster , hosts , vm , new java.util.HashMap < > ( ) , new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ) ) . contains ( host1 ) . doesNotContain ( host2 ) ; }

Target:
public void testSimple ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Label red = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( ) . entities ( vm , host1 ) . build ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Label > labels = java.util.Collections.singletonList ( red ) ; org.mockito.Mockito.doReturn ( labels ) . when ( labelDao ) . getAllByEntityIds ( org.mockito.ArgumentMatchers.any ( ) ) ; org.assertj.core.api.Assertions.assertThat ( unit.filter ( cluster , hosts , vm , new java.util.HashMap < > ( ) , new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ) ) . contains ( host1 ) . doesNotContain ( host2 ) ; }
Source:
public synchronized void StopStoragePoolTasks ( final org.ovirt.engine.core.common.businessentities.storage_pool sp ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "AsyncTaskManager::StopStoragePoolTask: Attempting to get and stop tasks on storage pool '{0}'" , sp.getname ( ) ) ; AddStoragePoolExistingTasks ( sp ) ; java.util.List < org.ovirt.engine.core.bll.SPMAsyncTask > list = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( _tasks.values ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.bll.SPMAsyncTask > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.bll.SPMAsyncTask a ) { return a.getStoragePoolID ( ) . equals ( sp.getId ( ) ) ; } } ) ; for ( org.ovirt.engine.core.bll.SPMAsyncTask task : list ) { task.StopTask ( ) ; } }

Target:
public synchronized void StopStoragePoolTasks ( final org.ovirt.engine.core.common.businessentities.storage_pool sp ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Attempting to get and stop tasks on storage pool '{0}'" , sp.getname ( ) ) ; AddStoragePoolExistingTasks ( sp ) ; java.util.List < org.ovirt.engine.core.bll.SPMAsyncTask > list = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( _tasks.values ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.bll.SPMAsyncTask > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.bll.SPMAsyncTask a ) { return a.getStoragePoolID ( ) . equals ( sp.getId ( ) ) ; } } ) ; for ( org.ovirt.engine.core.bll.SPMAsyncTask task : list ) { task.StopTask ( ) ; } }
Source:
protected void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getBaseDiskDao ( ) . remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getId ( ) ) ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . get ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ; } } super . endWithFailure ( ) ; }

Target:
protected void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) ) != null ) { baseDiskDao.remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getId ( ) ) ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . get ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ; } } super . endWithFailure ( ) ; }
Source:
public static java.lang.String getSuggestedDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , java.lang.String diskPrefix ) { java.lang.String diskAlias ; if ( disk == null ) { diskAlias = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( diskPrefix , org.ovirt.engine.core.bll.ImagesHandler.DefaultDriveName ) ; org.ovirt.engine.core.bll.ImagesHandler.log.warnFormat ( "Disk object is null, the suggested default disk alias to be used is {0}" , diskAlias ) ; } else { diskAlias = disk.getDiskAlias ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( diskAlias ) ) { diskAlias = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( diskPrefix , java.lang.String.valueOf ( disk.getInternalDriveMapping ( ) ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.infoFormat ( "Disk alias retrieved from the client is null or empty, the suggested default disk alias to be used is {0}" , diskAlias ) ; } } return diskAlias ; }

Target:
public static java.lang.String getSuggestedDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , java.lang.String diskPrefix , int count ) { java.lang.String diskAlias ; if ( disk == null ) { diskAlias = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( diskPrefix , org.ovirt.engine.core.bll.ImagesHandler.DefaultDriveName ) ; org.ovirt.engine.core.bll.ImagesHandler.log.warnFormat ( "Disk object is null, the suggested default disk alias to be used is {0}" , diskAlias ) ; } else { diskAlias = disk.getDiskAlias ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( diskAlias ) ) { diskAlias = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( diskPrefix , java.lang.String.valueOf ( count ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.infoFormat ( "Disk alias retrieved from the client is null or empty, the suggested default disk alias to be used is {0}" , diskAlias ) ; } } return diskAlias ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue getStatsReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( true ) ; if ( vdsmVm != null ) { value.setReturnValue ( vdsmVm ) ; } else { value.setReturnValue ( null ) ; } return value ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue getStatsReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm vdsmVm ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( true ) ; if ( vdsmVm != null ) { value.setReturnValue ( vdsmVm ) ; } else { value.setReturnValue ( null ) ; } return value ; }
Source:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; onImportSourceChanged ( ) ; }

Target:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }
Source:
public 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 ) ; }

Target:
public void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; initSorting ( ) ; getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminButtonDefinition < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > ( constants.setupHostNetworksInterface ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getDetailModel ( ) . getSetupNetworksCommand ( ) ; } } ) ; }

Target:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; initSorting ( ) ; getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminButtonDefinition < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > ( org.ovirt.engine.ui.webadmin.section.main.view.tab.network.SubTabNetworkHostView.constants.setupHostNetworksInterface ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getDetailModel ( ) . getSetupNetworksCommand ( ) ; } } ) ; }
Source:
protected boolean ValidateAdd ( org.ovirt.engine.core.common.EventNotificationMethods eventNotificationMethods , org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber , org.ovirt.engine.core.common.businessentities.DbUser user ) { java.lang.String tagName = event_subscriber.gettag_name ( ) ; boolean retValue = ValidateNotificationMethod ( eventNotificationMethods , event_subscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }

Target:
protected boolean ValidateAdd ( org.ovirt.engine.core.common.EventNotificationMethod eventNotificationMethod , org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber , org.ovirt.engine.core.common.businessentities.DbUser user ) { java.lang.String tagName = event_subscriber.gettag_name ( ) ; boolean retValue = ValidateNotificationMethod ( eventNotificationMethod , event_subscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }
Source:
public void testQuotaVdsGroupByQuotaGuidWithGeneralDefaultWithDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupList = dao.getQuotaVdsGroupByQuotaGuidWithGeneralDefault ( FixturesTool.QUOTA_GENERAL ) ; org.junit.Assert.assertNotNull ( quotaVdsGroupList ) ; org.junit.Assert.assertEquals ( "wrong number of quotas returned" , 1 , quotaVdsGroupList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup group : quotaVdsGroupList ) { org.junit.Assert.assertEquals ( "VDS ID should be empty in general mode" , Guid.Empty , group.getVdsGroupId ( ) ) ; org.junit.Assert.assertNull ( "VDS name should be null in general mode" , group.getVdsGroupName ( ) ) ; } }

Target:
public void testQuotaClusterByQuotaGuidWithGeneralDefaultWithDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByQuotaGuidWithGeneralDefault ( FixturesTool.QUOTA_GENERAL ) ; org.junit.Assert.assertNotNull ( quotaClusterList ) ; org.junit.Assert.assertEquals ( "wrong number of quotas returned" , 1 , quotaClusterList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaCluster group : quotaClusterList ) { org.junit.Assert.assertEquals ( "VDS ID should be empty in general mode" , Guid.Empty , group.getClusterId ( ) ) ; org.junit.Assert.assertNull ( "VDS name should be null in general mode" , group.getClusterName ( ) ) ; } }
Source:
private void AddVdsStatisticsToDb ( ) { org.ovirt.engine.core.common.businessentities.VdsStatistics vdsStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; vdsStatistics.setId ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) . getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStatisticsDAO ( ) . save ( vdsStatistics ) ; org.ovirt.engine.core.bll.AddVdsCommand.getCompensationContext ( ) . snapshotNewEntity ( vdsStatistics ) ; }

Target:
private void AddVdsStatisticsToDb ( ) { org.ovirt.engine.core.common.businessentities.VdsStatistics vdsStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; vdsStatistics.setId ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) . getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStatisticsDao ( ) . save ( vdsStatistics ) ; org.ovirt.engine.core.bll.AddVdsCommand.getCompensationContext ( ) . snapshotNewEntity ( vdsStatistics ) ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain map ( org.ovirt.engine.core.common.businessentities.storage_domains entity , org.ovirt.engine.api.model.StorageDomain template ) { org.ovirt.engine.api.model.StorageDomain model = super . map ( entity , template ) ; switch ( entity.getstorage_type ( ) ) { case ISCSI : mapVolumeGroupIscsi ( model , entity ) ; break ; case FCP : mapVolumeGroupFcp ( model , entity ) ; break ; case NFS : case LOCALFS : case POSIXFS : mapNfsOrLocalOrPosix ( model , entity ) ; break ; } return model ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain map ( org.ovirt.engine.core.common.businessentities.storage_domains entity , org.ovirt.engine.api.model.StorageDomain template ) { org.ovirt.engine.api.model.StorageDomain model = super . map ( entity , template ) ; if ( ! ( isFiltered ( ) ) ) { switch ( entity.getstorage_type ( ) ) { case ISCSI : mapVolumeGroupIscsi ( model , entity ) ; break ; case FCP : mapVolumeGroupFcp ( model , entity ) ; break ; case NFS : case LOCALFS : case POSIXFS : mapNfsOrLocalOrPosix ( model , entity ) ; break ; } } return model ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.userportal.ConsoleProtocol resolveSelectedProtocol ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.compat.Guid vmId = ( ( item.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item.getEntity ( ) ) ) . getId ( ) : null ; if ( vmId == null ) { return null ; } for ( org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel model : cachedConsoleModels.get ( vmId ) ) { if ( model.isUserSelected ( ) ) { return org.ovirt.engine.ui.uicommonweb.models.userportal.ConsoleProtocol.getProtocolByModel ( model.getClass ( ) ) ; } } return null ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.userportal.ConsoleProtocol resolveSelectedProtocol ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.compat.Guid vmId = ( ( item.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item.getEntity ( ) ) ) . getId ( ) : null ; if ( vmId == null ) { return null ; } org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel selectedConsoleModel = resolveSelectedConsoleModel ( vmId ) ; return selectedConsoleModel == null ? null : org.ovirt.engine.ui.uicommonweb.models.userportal.ConsoleProtocol.getProtocolByModel ( selectedConsoleModel.getClass ( ) ) ; }
Source:
private static void exitOnError ( org.ovirt.engine.core.utils.kerberos.ManageDomainsResult result ) { if ( ! ( result.isSuccessful ( ) ) ) { java.lang.System.out.println ( result.getDetailedMessage ( ) ) ; java.lang.System.exit ( result.getExitCode ( ) ) ; } }

Target:
private static void exitOnError ( org.ovirt.engine.core.utils.kerberos.ManageDomainsResult result ) { if ( ! ( result.isSuccessful ( ) ) ) { org.ovirt.engine.core.utils.kerberos.ManageDomains.log.error ( result.getDetailedMessage ( ) ) ; java.lang.System.out.println ( result.getDetailedMessage ( ) ) ; java.lang.System.exit ( result.getExitCode ( ) ) ; } }
Source:
public void lunDiskInvalid ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createVds ( ) ; setupForLun ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > luns = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( luns ) . when ( lunValidator ) . executeGetDeviceList ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ) ; org.junit.Assert.assertThat ( lunValidator.isLunDiskVisible ( lunDisk.getLun ( ) , vds ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_INVALID ) ) ; }

Target:
public void lunDiskInvalid ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createVds ( ) ; setupForLun ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( luns ) . when ( lunValidator ) . executeGetDeviceList ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ) ; org.junit.Assert.assertThat ( lunValidator.isLunDiskVisible ( lunDisk.getLun ( ) , vds ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_INVALID ) ) ; }
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void addOrUpdateTaskInDB ( final org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override 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:
public void addOrUpdateTaskInDB ( final org.ovirt.engine.core.common.businessentities.AsyncTask asyncTask ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { coco.persistCommand ( asyncTask.getRootCmdEntity ( ) ) ; coco.persistCommand ( asyncTask.getChildCmdEntity ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask ) ; return null ; } } ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.aaa.DbUser getDbUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; user.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( getId ( ) ) ) ; user.setDomain ( getDomain ( ) ) ; user.setLoginName ( getUserName ( ) ) ; return user ; }

Target:
public org.ovirt.engine.core.common.businessentities.aaa.DbUser getDbUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; user.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( getId ( ) ) ) ; user.setDomain ( getDomain ( ) ) ; user.setLoginName ( getUserName ( ) ) ; user.setAdmin ( isAdmin ( ) ) ; return user ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetExternalSubnetsOnProviderByExternalNetwork , org.ovirt.engine.core.common.queries.GetExternalSubnetsOnProviderByExternalNetworkQueryParameters.class , new java.lang.String [ ] { "ProviderId" , "NetworkId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( NAMES [ 1 ] ) } , getSubnets ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetExternalSubnetsOnProviderByExternalNetwork , org.ovirt.engine.core.common.queries.GetExternalSubnetsOnProviderByExternalNetworkQueryParameters.class , new java.lang.String [ ] { "ProviderId" , "NetworkId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( NAMES [ 1 ] ) } , getSubnets ( ) , failure ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetErrataForHost , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getErrata ( ) , failure ) ; control.replay ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.ErrataData getErrataData ( ) { org.ovirt.engine.core.common.businessentities.ErrataData errataData = new org.ovirt.engine.core.common.businessentities.ErrataData ( ) ; errataData.setErrata ( getErrata ( ) ) ; return errataData ; }
Source:
private static void addUsbSlots ( org.ovirt.engine.core.common.businessentities.VmBase vm , int numOfSlots ) { for ( int index = 1 ; index <= numOfSlots ; index ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.CHANNEL , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getUsbSlotSpecParams ( ) , true , false , null ) ; } }

Target:
private static void addUsbSlots ( org.ovirt.engine.core.common.businessentities.VmBase vm , int numOfSlots ) { for ( int index = 1 ; index <= numOfSlots ; index ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.CHANNEL , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getUsbSlotSpecParams ( ) , true , false , null ) ; } }
Source:
public void prepare2 ( ) { org.ovirt.engine.ui.uicompat.PreparingEnlistment enlistment = ( ( org.ovirt.engine.ui.uicompat.PreparingEnlistment ) ( context.enlistment ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = context.changeVDSClusterReturnValue ; context.enlistment = null ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { enlistment.Prepared ( ) ; } else { enlistment.ForceRollback ( ) ; } }

Target:
public void prepare2 ( ) { org.ovirt.engine.ui.uicompat.PreparingEnlistment enlistment = ( ( org.ovirt.engine.ui.uicompat.PreparingEnlistment ) ( context.enlistment ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = context.changeVDSClusterReturnValue ; context.enlistment = null ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { enlistment.prepared ( ) ; } else { enlistment.forceRollback ( ) ; } }
Source:
public void getAAANamespaces ( 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.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void getUserIdVdcUserDefault ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.DbUser u = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.compat.Guid g = b.getUserId ( ) ; org.junit.Assert.assertEquals ( null , g ) ; }

Target:
public void getUserIdVdcUserDefault ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.compat.Guid g = b.getUserId ( ) ; org.junit.Assert.assertEquals ( null , g ) ; }
Source:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public void testExecuteQueryCommand ( ) throws java.io.IOException { org.mockito.Mockito.doReturn ( serverKeyFingerprint ) . when ( mockEngineSSHDialog ) . getHostFingerprint ( ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.Map < java.lang.String , java.lang.String > servers = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertNotNull ( servers ) ; org.junit.Assert.assertEquals ( getAddedServers ( ) , servers ) ; }

Target:
public void testExecuteQueryCommand ( ) throws java.io.IOException { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQueryTest.serverKeyFingerprint ) . when ( mockEngineSSHDialog ) . getHostFingerprint ( ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.Map < java.lang.String , java.lang.String > servers = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertNotNull ( servers ) ; org.junit.Assert.assertEquals ( getAddedServers ( ) , servers ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.permissions > getAllForAdElement ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "ad_element_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsByAdElementId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.permissions > getAllForAdElement ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { int appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "ad_element_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsByAdElementId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView network : importModel.getNetworkProfiles ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.getRemoteNetworkName ( ) ; }
Source:
public void onConsoleModelChanged ( org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent event ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupConsole ( modelProvider ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { try { org.ovirt.engine.ui.uicommonweb.models.VmConsoles vmConsoles = modelProvider.getModel ( ) . getSelectedItem ( ) . getVmConsoles ( ) ; if ( vmConsoles.canConnectToConsole ( ) ) { vmConsoles.connect ( ) ; } } catch ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles e ) { errorPopupManager.show ( e.getLocalizedErrorMessage ( ) ) ; } }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; org.ovirt.engine.api.model.VnicProfile model = org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; org.ovirt.engine.api.model.VnicProfile model = org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
private static boolean failVmFree ( java.util.List < java.lang.String > messages , java.lang.String ... messagesToAdd ) { for ( java.lang.String messageToAdd : messagesToAdd ) { messages.add ( messageToAdd ) ; } messages.add ( VdcBllMessages.VAR__TYPE__DESKTOP_POOL.toString ( ) ) ; messages.add ( VdcBllMessages.VAR__ACTION__ATTACH_DESKTOP_TO.toString ( ) ) ; return false ; }

Target:
private static boolean failVmFree ( java.util.List < java.lang.String > messages , java.util.List < java.lang.String > messagesToAdd ) { messages.addAll ( messagesToAdd ) ; messages.add ( VdcBllMessages.VAR__TYPE__DESKTOP_POOL.toString ( ) ) ; messages.add ( VdcBllMessages.VAR__ACTION__ATTACH_DESKTOP_TO.toString ( ) ) ; return false ; }
Source:
public void qosBaloonSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( Version.v3_3 ) ; org.mockito.Mockito.when ( cluster.isEnableBallooning ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.qosBaloonSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void qosBaloonSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( Version.v3_3 ) ; org.mockito.Mockito.when ( cluster.isEnableBallooning ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.qosBaloonSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }