auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addDisksDeactivatedMessage ( java.util.List < org.ovirt.engine.core.common.action.MoveDiskParameters > moveDiskParamsList ) { setActionMessageParameters ( ) ; addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , org.apache.commons.lang.StringUtils.join ( getDisksAliases ( moveDiskParamsList ) , ", " ) ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_MOVE_DISKS_MIXED_PLUGGED_STATUS ) ; org.ovirt.engine.core.bll.MoveDisksCommand.getReturnValue ( ) . setCanDoAction ( false ) ; }

Target:
private void addDisksDeactivatedMessage ( java.util.List < org.ovirt.engine.core.common.action.MoveDiskParameters > moveDiskParamsList ) { setActionMessageParameters ( ) ; addCanDoActionMessageVariable ( "diskAliases" , org.apache.commons.lang.StringUtils.join ( getDisksAliases ( moveDiskParamsList ) , ", " ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_MOVE_DISKS_MIXED_PLUGGED_STATUS ) ; org.ovirt.engine.core.bll.MoveDisksCommand.getReturnValue ( ) . setCanDoAction ( false ) ; }
Source:
protected org.ovirt.engine.api.model.GlusterBrick addParents ( org.ovirt.engine.api.model.GlusterBrick glusterBrick ) { org.ovirt.engine.api.model.GlusterVolume volume = new org.ovirt.engine.api.model.GlusterVolume ( ) ; volume.setId ( getVolumeId ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( getClusterId ( ) ) ; volume.setCluster ( cluster ) ; glusterBrick.setGlusterVolume ( volume ) ; return glusterBrick ; }

Target:
protected org.ovirt.engine.api.model.GlusterBrick doPopulate ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return populateAdvancedDetails ( model , entity ) ; }
Source:
public void updateStatusForIp ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus existing = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; existing.setStatus ( KdumpFlowStatus.FINISHED ) ; existing.setAddress ( "[\"10.35.110.10\", 4444]" ) ; dao.updateForIp ( "10.35.110.10" , existing ) ; existing.setVdsId ( FixturesTool.VDS_RHEL6_NFS_SPM ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dao.get ( existing.getVdsId ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( existing , found ) ; }

Target:
public void updateStatusForIp ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus existing = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; existing.setStatus ( KdumpFlowStatus.FINISHED ) ; existing.setAddress ( "[\"10.35.110.10\", 4444]" ) ; dao.updateForIp ( "10.35.110.10" , existing ) ; existing.setVdsId ( FixturesTool.VDS_RHEL6_NFS_SPM ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dao.get ( existing.getVdsId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( found ) ; org.junit.jupiter.api.Assertions.assertEquals ( existing , found ) ; }
Source:
public void nGuidGuidCtorNullGuid ( ) { b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , null ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , gu ) ; }

Target:
public void nGuidGuidCtorNullGuid ( ) { b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , null ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( Guid.Empty , gu ) ; }
Source:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.VDSGroup selectedItem ) { driver.edit ( getDetailModel ( ) ) ; form.update ( ) ; glusterSwiftPanel.setVisible ( ( ( selectedItem.supportsGlusterService ( ) ) && ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterFeaturesUtil.isGlusterSwiftSupported ( selectedItem.getCompatibilityVersion ( ) ) ) ) ) ; }

Target:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.Cluster selectedItem ) { driver.edit ( getDetailModel ( ) ) ; form.update ( ) ; glusterSwiftPanel.setVisible ( ( ( selectedItem.supportsGlusterService ( ) ) && ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterFeaturesUtil.isGlusterSwiftSupported ( selectedItem.getCompatibilityVersion ( ) ) ) ) ) ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < java.lang.String > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( "filter" ) ) . andReturn ( filterValue ) ; resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; resource.get ( ) ; }

Target:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < java.lang.String > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . andReturn ( filterValue ) ; resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; resource.get ( ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private void removeVmStatelessImages ( ) { if ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }

Target:
private void removeVmStatelessImages ( ) { if ( ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) && ( ( getVmPoolType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmPoolType.Manual ) ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }
Source:
public org.ovirt.engine.api.v3.types.V3Host get ( @ javax.ws.rs.core.Context javax.ws.rs.core.HttpHeaders headers , @ javax.ws.rs.core.Context javax.ws.rs.core.UriInfo ui ) { boolean force = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( headers , ui , "force" , true , false ) ; if ( force ) { try { getDelegate ( ) . refresh ( new org.ovirt.engine.api.model.Action ( ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } } return adaptGet ( getDelegate ( ) :: get ) ; }

Target:
public org.ovirt.engine.api.v3.types.V3Host get ( @ javax.ws.rs.core.Context javax.ws.rs.core.HttpHeaders headers , @ javax.ws.rs.core.Context javax.ws.rs.core.UriInfo ui ) { boolean force = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( headers , ui , "force" , true , false ) ; if ( force ) { try { getDelegate ( ) . refresh ( new org.ovirt.engine.api.model.Action ( ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } } org.ovirt.engine.api.v3.types.V3Host host = adaptGet ( getDelegate ( ) :: get ) ; org.ovirt.engine.api.v3.helpers.V3HostHelper.addStatistics ( host ) ; return host ; }
Source:
public void setSearchString ( java.lang.String searchString ) { if ( ( org.ovirt.engine.ui.uicompat.external.StringUtils.isNotEmpty ( searchString ) ) && ( searchString.trim ( ) . toUpperCase ( ) . startsWith ( searchStringPrefixLabel.getText ( ) . toUpperCase ( ) ) ) ) { searchStringInput.setText ( searchString.trim ( ) . substring ( searchStringPrefixLabel.getText ( ) . length ( ) ) ) ; } else { searchStringInput.setText ( searchString ) ; } }

Target:
public void setHasSelectedTags ( boolean hasSelectedTags ) { if ( hasSelectedTags ) { searchStringPrefixLabel.addStyleName ( style.hasSelectedTags ( ) ) ; searchStringInput.addStyleName ( style.hasSelectedTags ( ) ) ; searchBoxClear.addStyleName ( style.hasSelectedTags ( ) ) ; } else { searchStringPrefixLabel.removeStyleName ( style.hasSelectedTags ( ) ) ; searchStringInput.removeStyleName ( style.hasSelectedTags ( ) ) ; searchBoxClear.removeStyleName ( style.hasSelectedTags ( ) ) ; } }
Source:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmGuestAgentInterfacesByVmId ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > getGraphicsDevicesForEntity ( org.ovirt.engine.api.restapi.resource.BackendResource backendResource , org.ovirt.engine.core.compat.Guid id ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = backendResource.getEntity ( java.util.List.class , VdcQueryType.GetGraphicsDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , id.toString ( ) , true ) ; return graphicsDevices ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > getGraphicsDevicesForEntity ( org.ovirt.engine.api.restapi.resource.BackendResource backendResource , org.ovirt.engine.core.compat.Guid id , boolean nextRun ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = backendResource.getEntity ( java.util.List.class , ( nextRun ? org.ovirt.engine.core.common.queries.VdcQueryType.GetNextRunGraphicsDevices : org.ovirt.engine.core.common.queries.VdcQueryType.GetGraphicsDevices ) , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , id.toString ( ) , true ) ; return graphicsDevices ; }
Source:
public void canDoActionSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
private void mockStoragePoolDAO ( org.ovirt.engine.core.common.businessentities.storage_pool pool ) { org.ovirt.engine.core.compat.Guid storagePoolId = getQueryParameters ( ) . getStoragePoolId ( ) ; if ( pool != null ) { pool.setId ( storagePoolId ) ; } org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAOMock.get ( storagePoolId , getUser ( ) . getUserId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStoragePoolDAO ( ) ) . thenReturn ( storagePoolDAOMock ) ; }

Target:
private void mockStoragePoolDAO ( org.ovirt.engine.core.common.businessentities.storage_pool pool ) { org.ovirt.engine.core.compat.Guid storagePoolId = getQueryParameters ( ) . getStoragePoolId ( ) ; if ( pool != null ) { pool.setId ( storagePoolId ) ; } org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAOMock.get ( storagePoolId , getUser ( ) . getUserId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDAOMock ) ; }
Source:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; initAndAssertValidation ( true ) ; }

Target:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; initAndAssertValidation ( true ) ; }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity selectedItem ) { driver.edit ( getDetailModel ( ) ) ; replicaFormItem.setIsAvailable ( selectedItem.getVolumeType ( ) . isReplicatedType ( ) ) ; stripeFormItem.setIsAvailable ( selectedItem.getVolumeType ( ) . isStripedType ( ) ) ; formBuilder.update ( getDetailModel ( ) ) ; }

Target:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity selectedItem ) { driver.edit ( getDetailModel ( ) ) ; replicaFormItem.setIsAvailable ( selectedItem.getVolumeType ( ) . isReplicatedType ( ) ) ; stripeFormItem.setIsAvailable ( selectedItem.getVolumeType ( ) . isStripedType ( ) ) ; disperseCount.setVisible ( selectedItem.getVolumeType ( ) . isDispersedType ( ) ) ; redundancyCount.setVisible ( selectedItem.getVolumeType ( ) . isDispersedType ( ) ) ; formBuilder.update ( getDetailModel ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc shutdownHost ( int reboot ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.shutdownHost ( reboot ) ; 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 ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc glusterServicesList ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String [ ] serviceNames ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterServicesGet ( serviceNames ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc ( serverId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void shouldDetectSuspendedVM ( ) { invalidVM.setStatus ( VMStatus.Suspended ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( UpgradeError.VM_SUSPENDED ) ; }

Target:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( EngineMessage.CLUSTER_UPGRADE_DETAIL_VM_NUMA_PINNED.name ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc getVGList ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getLVMVolumeGroups" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vglist" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getDeviceList" ) . withParameter ( "storageType" , storageType ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseType ( java.lang.Object [ ] . class ) . withResponseKey ( "devList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( response ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.ExistingVmModelBehavior existingVmModelBehavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExistingVmModelBehavior ) ( model ) ) ; runningOnHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; hostCpu = calculateHostCpus ( ) ; existingVmModelBehavior.updateNumOfSockets ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterByArchitecture ( clusters , vm.getClusterArch ( ) ) ; model.setDataCentersAndClusters ( model , dataCenters , filteredClusters , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; initCdImage ( ) ; }
Source:
public void testRemoveNotFound ( ) { setUpEntityQueryExpectations ( QueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testRemoveNotFound ( ) { setUpEntityQueryExpectations ( QueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.resource.remove ( ) ) ) ; }
Source:
protected void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef ) { item.setVisible ( ( ( buttonDef.isAccessible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) && ( buttonDef.isVisible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ; if ( ( buttonDef.getMenuItemToolTip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( buttonDef.getMenuItemToolTip ( ) ) , item.getElement ( ) ) ; } }

Target:
protected void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef ) { item.setVisible ( ( ( buttonDef.isAccessible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) && ( buttonDef.isVisible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ; if ( ( buttonDef.getMenuItemTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( buttonDef.getMenuItemTooltip ( ) , item.getElement ( ) ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkListModel networkListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkListModel ) ( result1.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; networkListModel1.PostNetworkAction ( null , ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) ) ; }

Target:
public void apply ( ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel ) ( getWindow ( ) ) ) ; model.apply ( ) ; }
Source:
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 ( ) ) ) ; } }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , getStorageDomainId ( ) . getValue ( ) , getRequestDiskSpace ( ) ) ) ; } return list ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( ( source.getConfirmWindow ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.ImportCloneModel ) { return importClonePopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Creation model ) throws java.lang.Exception { org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( java.net.URLEncoder.encode ( org.ovirt.engine.api.restapi.resource.BackendCreationResourceTest.CREATION_ID , "UTF-8" ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( CreationStatus.COMPLETE.value ( ) , model.getStatus ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Creation model ) throws java.lang.Exception { org.junit.jupiter.api.Assertions.assertNotNull ( model ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.net.URLEncoder.encode ( org.ovirt.engine.api.restapi.resource.BackendCreationResourceTest.CREATION_ID , "UTF-8" ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( CreationStatus.COMPLETE.value ( ) , model.getStatus ( ) ) ; verifyLinks ( model ) ; }
Source:
private void mockGraphicsDevice ( ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setDeviceId ( Guid.Empty ) ; graphicsDevice.setVmId ( vm.getId ( ) ) ; org.mockito.Mockito.when ( vmDeviceDAO.getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.GRAPHICS ) ) . thenReturn ( java.util.Arrays.asList ( graphicsDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }

Target:
private void mockGraphicsDevice ( ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setDeviceId ( Guid.Empty ) ; graphicsDevice.setVmId ( vm.getId ( ) ) ; mockVmDevice ( graphicsDevice ) ; }
Source:
public java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > executeAsyncCommand ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.action.VdcActionParametersBase parameters ) { final org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; return org.ovirt.engine.core.bll.tasks.CommandExecutor.executor.submit ( new java.util.concurrent.Callable < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.action.VdcReturnValueBase call ( ) throws java.lang.Exception { return executeCommand ( command ) ; } } ) ; }

Target:
public java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > executeAsyncCommand ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { final org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters , cmdContext ) ; return org.ovirt.engine.core.bll.tasks.CommandExecutor.executor.submit ( new java.util.concurrent.Callable < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.action.VdcReturnValueBase call ( ) throws java.lang.Exception { return executeCommand ( command ) ; } } ) ; }
Source:
public void canDoActionFailsWhenGlusterMultipleHostHasVolumesWithForce ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , true ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockHasMultipleClusters ( true ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void canDoActionFailsWhenGlusterMultipleHostHasVolumesWithForce ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , true ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockHasMultipleClusters ( true ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }
Source:
public void testGetAllInterfacesForVmFilteredWithPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result = dao.getAllForVm ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , iface.getVmId ( ) ) ; } }

Target:
public void testGetAllInterfacesForVmFilteredWithPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result = dao.getAllForVm ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.PRIVILEGED_USER_ID , true ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , iface.getVmId ( ) ) ; } }
Source:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void testGetAllOfType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllOfType ( VDSType.VDS ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( VDSType.VDS , vds.getVdsType ( ) ) ; } }

Target:
public void testGetAllOfType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllOfType ( VDSType.VDS ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.jupiter.api.Assertions.assertEquals ( VDSType.VDS , vds.getVdsType ( ) ) ; } }
Source:
public static void IsUSBEnabledByDefault ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault ) , aQuery ) ; }

Target:
public static void IsVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters ( name ) , aQuery ) ; }
Source:
protected void setStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { if ( ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getStatus ( ) ) != status ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getId ( ) , status ) ) ; } }

Target:
protected void setStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { if ( ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getStatus ( ) ) != status ) { runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getId ( ) , status ) ) ; } }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public static java.lang.String getDiskAliasWithDefault ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , java.lang.String aliasIfNull ) { java.lang.String diskAlias = disk.getDiskAlias ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( diskAlias ) ) { org.ovirt.engine.core.bll.ImagesHandler.log.info ( ( "Disk alias retrieved from the client is null or empty, the suggested default disk alias to be" + " used is '{}'" ) , aliasIfNull ) ; return aliasIfNull ; } return diskAlias ; }

Target:
public static java.lang.String getDiskAliasWithDefault ( org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk , java.lang.String aliasIfNull ) { java.lang.String diskAlias = disk.getDiskAlias ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( diskAlias ) ) { org.ovirt.engine.core.bll.ImagesHandler.log.info ( ( "Disk alias retrieved from the client is null or empty, the suggested default disk alias to be" + " used is '{}'" ) , aliasIfNull ) ; return aliasIfNull ; } return diskAlias ; }
Source:
private static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.List < java.lang.String > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.< java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > > get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { if ( ! ( accumulator.contains ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.add ( group.get ( Authz.GroupRecord.ID ) ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }

Target:
private static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.< java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > > get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { if ( ! ( accumulator.containsKey ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.put ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) , group ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }
Source:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { 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 source ; } return "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefaultTimeZone , params , aQuery ) ; }

Target:
public static void isVirtioScsiEnabledForVm ( 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 ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private static java.lang.String AssignStringValueFromArray ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { java.lang.String [ ] arr = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignStringArrayValue ( input , name ) ; if ( arr != null ) { return org.apache.commons.lang.StringUtils.join ( arr , ',' ) ; } return null ; }

Target:
private static java.lang.String assignStringValueFromArray ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { java.lang.String [ ] arr = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.assignStringArrayValue ( input , name ) ; if ( arr != null ) { return org.apache.commons.lang.StringUtils.join ( arr , ',' ) ; } return null ; }