auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > before = dao.getAllForNetwork ( networkNoCluster.getId ( ) ) ; org.junit.Assert.assertTrue ( before.isEmpty ( ) ) ; dao.save ( newNetworkCluster ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > after = dao.getAllForNetwork ( networkNoCluster.getId ( ) ) ; org.junit.Assert.assertFalse ( after.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( newNetworkCluster , after.get ( 0 ) ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > before = dao.getAllForNetwork ( networkNoCluster.getId ( ) ) ; org.junit.Assert.assertTrue ( before.isEmpty ( ) ) ; dao.save ( newNetworkCluster ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > after = dao.getAllForNetwork ( networkNoCluster.getId ( ) ) ; org.junit.Assert.assertFalse ( after.isEmpty ( ) ) ; assertNetworkClustersEqual ( newNetworkCluster , after.get ( 0 ) ) ; }
Source:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Host ) ) ) { org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.HostPredicate ( host.getId ( ) ) ) ) ; } }

Target:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Host ) ) ) { org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.HostPredicate ( host.getId ( ) ) ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > getDataCentersWithPermittedActionOnClusters ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup , boolean supportsVirtService , boolean supportsGlusterService ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , userId ) . addValue ( "action_group_id" , actionGroup.getId ( ) ) . addValue ( "supports_virt_service" , supportsVirtService ) . addValue ( "supports_gluster_service" , supportsGlusterService ) ; return getCallsHandler ( ) . executeReadList ( "fn_perms_get_storage_pools_with_permitted_action_on_vds_groups" , org.ovirt.engine.core.dao.StoragePoolDaoImpl.mapper , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > getDataCentersWithPermittedActionOnClusters ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup , boolean supportsVirtService , boolean supportsGlusterService ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , userId ) . addValue ( "action_group_id" , actionGroup.getId ( ) ) . addValue ( "supports_virt_service" , supportsVirtService ) . addValue ( "supports_gluster_service" , supportsGlusterService ) ; return getCallsHandler ( ) . executeReadList ( "fn_perms_get_storage_pools_with_permitted_action_on_clusters" , org.ovirt.engine.core.dao.StoragePoolDaoImpl.mapper , parameterSource ) ; }
Source:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; return false ; } } return true ; }

Target:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }
Source:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveGroup , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
public void testAddGroupWithImplicitDirectoryName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDomainList , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpDomains ( ) ) ; setUpGetEntityExpectations ( ( ( ( "ADGROUP@" + ( DOMAIN ) ) + ":: name=" ) + ( org.ovirt.engine.api.restapi.resource.aaa.BackendGroupsResourceTest.GROUP_NAMES_WITH_NO_DOMAIN [ 0 ] ) ) , SearchType.DirectoryGroup , getDirectoryGroup ( 0 ) ) ; setUpCreationExpectations ( VdcActionType.AddGroup , org.ovirt.engine.core.common.action.AddGroupParameters.class , new java.lang.String [ ] { "GroupToAdd" } , new java.lang.Object [ ] { new org.ovirt.engine.core.common.businessentities.aaa.DbGroup ( getDirectoryGroup ( 0 ) ) } , true , true , GUIDS [ 0 ] , VdcQueryType.GetDbGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.Group model = new org.ovirt.engine.api.model.Group ( ) ; model.setName ( org.ovirt.engine.api.restapi.resource.aaa.BackendGroupsResourceTest.GROUP_NAMES [ 0 ] ) ; javax.ws.rs.core.Response response = collection.add ( model ) ; assertEquals ( 201 , response.getStatus ( ) ) ; assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.Group ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.Group ) ( response.getEntity ( ) ) ) , 0 ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getMigrationStatus" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotplugMemory ( java.util.Map info ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.hotplugMemory" ) . withParameter ( "vmID" , getVmId ( info ) ) . withParameter ( "params" , info ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { UpdateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { ProxyUp ( ) ; }
Source:
public void testPersistNetworkAttachmentsWhenIpConfigurationChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentForClusterNetworkA = createNetworkAttachment ( clusterNetworkA ) ; networkAttachmentForClusterNetworkA.setNicId ( interfaceWithAttachedClusterNetworkA.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = org.ovirt.engine.core.utils.NetworkUtils.createIpConfigurationFromVdsNetworkInterface ( interfaceWithAttachedClusterNetworkA ) ; ipConfiguration.getIpv4PrimaryAddress ( ) . setAddress ( "192.168.1.11" ) ; networkAttachmentForClusterNetworkA.setIpConfiguration ( ipConfiguration ) ; networkAttachmentForClusterNetworkA.setProperties ( customPropertiesForNics.getCustomPropertiesFor ( interfaceWithAttachedClusterNetworkA ) ) ; callPersistNetworkAttachmentsAndVerifyThatNetworkAttachmentIsSynced ( networkAttachmentForClusterNetworkA , createLegacyPersister ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfiguration ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration result = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address ipv4Address = createIpv4Address ( ) ; org.ovirt.engine.core.common.businessentities.network.IpV6Address ipv6Address = createIpv6Address ( ) ; result.setIPv4Addresses ( java.util.Collections.singletonList ( ipv4Address ) ) ; result.setIpV6Addresses ( java.util.Collections.singletonList ( ipv6Address ) ) ; return result ; }
Source:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = getVmStatistics ( ) ; java.lang.Object [ ] disksUsages = null ; org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xml = setDisksUsageInXmlRpc ( disksUsages ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertEquals ( null , vmStatistics.getDisksUsage ( ) ) ; }

Target:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = getVmStatistics ( ) ; java.lang.Object [ ] disksUsages = null ; org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsageInXmlRpc ( disksUsages ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertEquals ( null , vmStatistics.getDisksUsage ( ) ) ; }
Source:
private void networkNameTest ( org.ovirt.engine.core.bll.ValidationResult expected , boolean networkLinkingSupported , java.lang.String networkName ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.getNetworkName ( ) ) . thenReturn ( networkName ) ; org.junit.Assert.assertEquals ( expected , validator.networkNameValid ( ) ) ; }

Target:
private void networkNameTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , boolean networkLinkingSupported , java.lang.String networkName ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.getNetworkName ( ) ) . thenReturn ( networkName ) ; org.junit.Assert.assertThat ( validator.networkNameValid ( ) , matcher ) ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) , aQuery ) ; }

Target:
public void getClusterEditWarnings ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterEditWarnings , new org.ovirt.engine.core.common.queries.ClusterEditParameters ( cluster ) , aQuery ) ; }
Source:
public void testNicExistsWhenNicNameIsNotNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicId ( null ) ; attachment.setNicName ( "whatever" ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . nicExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateGatewayWhenGatewayIsNull ( ) { doTestValidateGateway ( null , false , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private static int setCDBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( device.getType ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) && ( device.getDevice ( ) . equals ( VmDeviceType.CDROM.getName ( ) ) ) ) { if ( device.getIsPlugged ( ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } break ; } } return bootOrder ; }

Target:
private static int setCDBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( ( device.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK ) ) && ( device.getDevice ( ) . equals ( VmDeviceType.CDROM.getName ( ) ) ) ) { if ( device.getIsPlugged ( ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } break ; } } return bootOrder ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain model = new org.ovirt.engine.api.model.StorageDomain ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "StorageDomain" , "add" , "id|name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain model = new org.ovirt.engine.api.model.StorageDomain ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "StorageDomain" , "add" , "id|name" ) ; } }
Source:
public static void isSoundcardEnabled ( 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 < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , 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 < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }
Source:
public void FilterUnSelectableModels ( ) { java.util.ArrayList < java.lang.Object > filterredItems = new java.util.ArrayList < java.lang.Object > ( ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > cast ( getModel ( ) . getItems ( ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : items ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.Model ) ( model ) ) . getIsSelectable ( ) ) { filterredItems.add ( model ) ; } } getModel ( ) . getAvailableStorageItems ( ) . setItems ( filterredItems ) ; }

Target:
public void filterUnSelectableModels ( ) { java.util.ArrayList < java.lang.Object > filterredItems = new java.util.ArrayList < java.lang.Object > ( ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > cast ( getModel ( ) . getItems ( ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : items ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.Model ) ( model ) ) . getIsSelectable ( ) ) { filterredItems.add ( model ) ; } } getModel ( ) . getAvailableStorageItems ( ) . setItems ( filterredItems ) ; }
Source:
protected void verifyAddDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.verify ( macPoolManager , addMacVerification ) . forceAddMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNicDao ) . save ( iface ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . save ( iface.getStatistics ( ) ) ; }

Target:
protected void verifyAddDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.network.VmNic iface , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.verify ( macPoolManager , addMacVerification ) . forceAddMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNicDao ) . save ( iface ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . save ( iface.getStatistics ( ) ) ; }
Source:
protected void addMoveOrCopyParameters ( java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.core.compat.Guid sourceStorageDomainGuid , org.ovirt.engine.core.compat.Guid destStorageDomainGuid , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = createParameters ( sourceStorageDomainGuid , destStorageDomainGuid , disk ) ; params.setQuotaId ( disk.getQuotaId ( ) ) ; params.setDiskProfileId ( disk.getDiskProfileId ( ) ) ; parameters.add ( params ) ; }

Target:
protected void addMoveOrCopyParameters ( java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.core.compat.Guid sourceStorageDomainGuid , org.ovirt.engine.core.compat.Guid destStorageDomainGuid , org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = createParameters ( sourceStorageDomainGuid , destStorageDomainGuid , disk ) ; params.setQuotaId ( disk.getQuotaId ( ) ) ; params.setDiskProfileId ( disk.getDiskProfileId ( ) ) ; params.setNewAlias ( disk.getDiskAlias ( ) ) ; parameters.add ( params ) ; }
Source:
private static void SetVmTemplateStatus ( org.ovirt.engine.core.compat.Guid vmTemplateGuid , org.ovirt.engine.core.common.businessentities.VmTemplateStatus status , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDAO ( ) . get ( vmTemplateGuid ) ; if ( vmTemplate != null ) { if ( compensationContext != null ) { compensationContext.snapshotEntityStatus ( vmTemplate , vmTemplate.getstatus ( ) ) ; } vmTemplate.setstatus ( status ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDAO ( ) . update ( vmTemplate ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.log.warnFormat ( "VmTemplateHandler::SetVmTemplateStatus: vmTemplate is null, not setting status '{0}' to vmTemplate" , status ) ; } }

Target:
private static void SetVmTemplateStatus ( org.ovirt.engine.core.compat.Guid vmTemplateGuid , org.ovirt.engine.core.common.businessentities.VmTemplateStatus status , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . get ( vmTemplateGuid ) ; if ( vmTemplate != null ) { if ( compensationContext != null ) { compensationContext.snapshotEntityStatus ( vmTemplate , vmTemplate.getstatus ( ) ) ; } vmTemplate.setstatus ( status ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . update ( vmTemplate ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.log.warnFormat ( "VmTemplateHandler::SetVmTemplateStatus: vmTemplate is null, not setting status '{0}' to vmTemplate" , status ) ; } }
Source:
protected void setBallooning ( org.ovirt.engine.api.model.VM vm ) { java.lang.Boolean balloonEnabled = getEntity ( java.lang.Boolean.class , VdcQueryType.IsBalloonEnabled , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( new org.ovirt.engine.core.compat.Guid ( vm.getId ( ) ) ) , null , true ) ; if ( ! ( vm.isSetMemoryPolicy ( ) ) ) { vm.setMemoryPolicy ( new org.ovirt.engine.api.model.MemoryPolicy ( ) ) ; } vm.getMemoryPolicy ( ) . setBallooning ( balloonEnabled ) ; }

Target:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < org.ovirt.engine.api.common.util.DetailHelper.Detail > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( getHttpHeaders ( ) ) ; parent.addInlineDetails ( details , model ) ; addStatistics ( model , entity , uriInfo , httpHeaders ) ; parent.setPayload ( model ) ; parent.setBallooning ( model ) ; parent.setCertificateInfo ( model ) ; return model ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > getUsers ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > users = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.DbUser user = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; user.setId ( GUIDS [ i ] ) ; user.setFirstName ( NAMES [ i ] ) ; user.setLoginName ( NAMES [ i ] ) ; users.add ( user ) ; } return users ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.DbUser > getUsers ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.DbUser > users = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.DbUser > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; user.setId ( GUIDS [ i ] ) ; user.setFirstName ( NAMES [ i ] ) ; user.setLoginName ( NAMES [ i ] ) ; users.add ( user ) ; } return users ; }
Source:
private void addResource ( final org.ovirt.engine.api.restapi.resource.BackendResource resource ) { resource.setMessageBundle ( messageBundle ) ; resource.setBackend ( backend ) ; resource.setMappingLocator ( mappingLocator ) ; resource.setValidatorLocator ( validatorLocator ) ; singletons.add ( resource ) ; }

Target:
private void addResource ( final org.ovirt.engine.api.restapi.resource.BackendResource resource ) { resource.setMessageBundle ( messageBundle ) ; resource.setBackend ( backend ) ; resource.setSessionHelper ( sessionHelper ) ; resource.setMappingLocator ( mappingLocator ) ; resource.setValidatorLocator ( validatorLocator ) ; singletons.add ( resource ) ; }
Source:
protected void onMouseOver ( ) { super . onMouseOver ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel network = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ; if ( ( ( network != null ) && ( ( network.getAttachedToNic ( ) ) != null ) ) && ( ! ( network.isAttachedViaLabel ( ) ) ) ) { actionButton.setVisible ( true ) ; } }

Target:
protected void onMouseOver ( ) { super . onMouseOver ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel network = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ; if ( ( ( network != null ) && ( ( network.getAttachedToNic ( ) ) != null ) ) && ( ( network.isManaged ( ) ) || ( ! ( network.isAttachedViaLabel ( ) ) ) ) ) { actionButton.setVisible ( true ) ; } }
Source:
public void setup ( ) { org.ovirt.engine.core.common.config.IConfigUtilsInterface configUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( configUtils.GetValue ( ConfigValues.AdUserPassword , Config.DefaultConfigurationVersion ) ) . thenReturn ( new java.util.HashMap < java.lang.String , java.lang.String > ( ) ) ; org.mockito.Mockito.when ( configUtils.GetValue ( ConfigValues.AdUserName , Config.DefaultConfigurationVersion ) ) . thenReturn ( "" ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( configUtils ) ; }

Target:
public void setup ( ) { org.ovirt.engine.core.common.config.IConfigUtilsInterface configUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( configUtils.GetValue ( ConfigValues.AdUserPassword , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( new java.util.HashMap < java.lang.String , java.lang.String > ( ) ) ; org.mockito.Mockito.when ( configUtils.GetValue ( ConfigValues.AdUserName , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( "" ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( configUtils ) ; }
Source:
public java.util.concurrent.Future < java.util.Map < java.lang.String , java.lang.Object > > setupNetworks ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct networks , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct bonds , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options ) { return vdsServer.futureSetupNetworks ( networks.getInnerMap ( ) , bonds.getInnerMap ( ) , options.getInnerMap ( ) ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc glusterServicesAction ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String [ ] serviceList , java.lang.String actionType ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterServicesAction ( serviceList , actionType ) ; 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:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { org.ovirt.engine.core.bll.tasks.interfaces.CommandCallBack callBack = command.getCallback ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( org.ovirt.engine.core.bll.tasks.CommandExecutor.log ) . runAction ( command , null ) ; updateCommand ( command , result ) ; if ( callBack != null ) { callBack.executed ( result ) ; } return result ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback callBack = command.getCallback ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( org.ovirt.engine.core.bll.tasks.CommandExecutor.log ) . runAction ( command , null ) ; updateCommand ( command , result ) ; if ( callBack != null ) { callBack.executed ( result ) ; } return result ; }
Source:
public void setUp ( ) { createStorageDomain ( ) ; storageDomainDisks = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( diskImageDao.getAllForStorageDomain ( storageDomain.getId ( ) ) ) . thenReturn ( storageDomainDisks ) ; storageDomainVmDisks = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( diskVmElementDao.getAllDiskVmElementsByDisksIds ( org.mockito.ArgumentMatchers.anyCollectionOf ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomainVmDisks ) ; org.mockito.Mockito.when ( storageDomainDao.get ( storageDomain.getId ( ) ) ) . thenReturn ( storageDomain ) ; }

Target:
public void setUp ( ) { createStorageDomain ( ) ; storageDomainDisks = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( diskImageDao.getAllForStorageDomain ( storageDomain.getId ( ) ) ) . thenReturn ( storageDomainDisks ) ; storageDomainVmDisks = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( diskVmElementDao.getAllDiskVmElementsByDisksIds ( org.mockito.ArgumentMatchers.anyCollection ( ) ) ) . thenReturn ( storageDomainVmDisks ) ; org.mockito.Mockito.when ( storageDomainDao.get ( storageDomain.getId ( ) ) ) . thenReturn ( storageDomain ) ; }
Source:
private org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler getBackendCommandObjectsHandler ( ) { try { javax.naming.InitialContext ctx = new javax.naming.InitialContext ( ) ; return ( ( org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler ) ( ctx.lookup ( org.ovirt.engine.core.bll.CommandBase.BACKEND_COMMAND_OBJECTS_HANDLER_JNDI_NAME ) ) ) ; } catch ( javax.naming.NamingException e ) { log.error ( ( "Getting backend command objects handler failed" + ( e.getMessage ( ) ) ) ) ; log.debug ( "" , e ) ; return null ; } }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runInternalAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( actionType , parameters ) ; }
Source:
public void setUsePatternFly ( boolean use ) { overrideSerialNumberPolicyWithInfo.setUsePatternFly ( use ) ; overrideSerialNumberPolicy.setUsePatternFly ( use ) ; }

Target:
public void setUsePatternFly ( boolean use ) { overrideSerialNumberPolicyWithInfo.setUsePatternFly ( use ) ; overrideSerialNumberPolicy.setUsePatternFly ( use ) ; if ( use ) { label.getElement ( ) . getStyle ( ) . setPaddingLeft ( 10 , Unit.PX ) ; label.getElement ( ) . getStyle ( ) . setPaddingRight ( 10 , Unit.PX ) ; label.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VmDynamic , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > > convertEvent ( java.util.Map < java.lang.String , java.lang.Object > map ) { java.lang.Double notifyTime = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.removeNotifyTimeFromVmStatusEvent ( map ) ; return map.entrySet ( ) . stream ( ) . map ( ( idToMap ) -> toMonitoredVm ( new org.ovirt.engine.core.compat.Guid ( idToMap.getKey ( ) ) , ( ( java.util.Map < java.lang.String , java.lang.Object > ) ( idToMap.getValue ( ) ) ) , notifyTime ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VmDynamic , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > > convertEvent ( java.util.Map < java.lang.String , java.lang.Object > map ) { java.lang.Double notifyTime = vdsBrokerObjectsBuilder.removeNotifyTimeFromVmStatusEvent ( map ) ; return map.entrySet ( ) . stream ( ) . map ( ( idToMap ) -> toMonitoredVm ( new org.ovirt.engine.core.compat.Guid ( idToMap.getKey ( ) ) , ( ( java.util.Map < java.lang.String , java.lang.Object > ) ( idToMap.getValue ( ) ) ) , notifyTime ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
private void init ( ) { org.ovirt.engine.core.vdsbroker.ResourceManager.setInstance ( this ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; populateVdsAndVmsList ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > allVdsList = hostDao.getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS curVds : allVdsList ) { AddVds ( curVds , true ) ; } org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.init ( ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; }

Target:
private void init ( ) { org.ovirt.engine.core.vdsbroker.ResourceManager.setInstance ( this ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; populateVdsAndVmsList ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > allVdsList = hostDao.getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS curVds : allVdsList ) { addVds ( curVds , true ) ; } org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.init ( ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; }
Source:
public void validateDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void validateSourceDomainValid ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; initializeCommand ( disk , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SOURCE_STORAGE_DOMAIN_DOES_CONTAINS_THE_DISK ) ; }
Source:
private boolean isListenerAlive ( ) { org.ovirt.engine.core.common.ExternalVariable fkAlive = org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getDbFacade ( ) . getExternalVariableDao ( ) . get ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.LISTENER_HEARTBEAT ) ; return ( fkAlive != null ) && ( ( ( fkAlive.getUpdateDate ( ) . getTime ( ) ) + ( listenerTimeoutInterval ) ) >= ( java.lang.System.currentTimeMillis ( ) ) ) ; }

Target:
private boolean isListenerAlive ( ) { org.ovirt.engine.core.common.ExternalVariable fkAlive = externalVariableDao.get ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.LISTENER_HEARTBEAT ) ; return ( fkAlive != null ) && ( ( ( fkAlive.getUpdateDate ( ) . getTime ( ) ) + ( listenerTimeoutInterval ) ) >= ( java.lang.System.currentTimeMillis ( ) ) ) ; }
Source:
void addReportedDevices ( org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.List < org.ovirt.engine.api.model.ReportedDevice > devices = getDevices ( entity.getVmId ( ) , entity.getMacAddress ( ) ) ; if ( ! ( devices.isEmpty ( ) ) ) { org.ovirt.engine.api.model.ReportedDevices reportedDevices = new org.ovirt.engine.api.model.ReportedDevices ( ) ; reportedDevices.getReportedDevices ( ) . addAll ( devices ) ; model.setReportedDevices ( reportedDevices ) ; } }

Target:
protected org.ovirt.engine.api.model.Nic addParents ( org.ovirt.engine.api.model.Nic nic ) { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setId ( vmId.toString ( ) ) ; nic.setVm ( vm ) ; return nic ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.HostNetworkQos createQos ( ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; qos.setOutAverageLinkshare ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 0 , 100 ) ) ; qos.setOutAverageUpperlimit ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 0 , 2000 ) ) ; qos.setOutAverageRealtime ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 0 , 2000 ) ) ; return qos ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.HostNetworkQos createQos ( ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; qos.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; qos.setOutAverageLinkshare ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 0 , 100 ) ) ; qos.setOutAverageUpperlimit ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 0 , 2000 ) ) ; qos.setOutAverageRealtime ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 0 , 2000 ) ) ; return qos ; }
Source:
public void testHotsetNotUpdateableWhenHotsetNotRequested ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; org.junit.Assert.assertFalse ( "Should be false by default" , oic.isFieldUpdatable ( "name" ) ) ; oic.addHotsetFields ( "name" ) ; org.junit.Assert.assertFalse ( "hot set not requested should return false even if field is hot set" , oic.isFieldUpdatable ( null , "name" , null , false ) ) ; }

Target:
public void testHotsetNotUpdateableWhenHotsetNotRequested ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; org.junit.Assert.assertFalse ( "Should be false by default" , oic.isFieldUpdatable ( "name" ) ) ; oic.addHotsetField ( "name" , java.util.EnumSet.of ( VMStatus.Up ) ) ; org.junit.Assert.assertFalse ( "hot set not requested should return false even if field is hot set" , oic.isFieldUpdatable ( null , "name" , null , false ) ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getBroker ( ) . refreshStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getMasterStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getBroker ( ) . refreshStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getMasterStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
protected void setUpSpyQuery ( ) throws java.lang.Exception { setUpSpyQuery ( getQueryParameters ( ) ) ; }

Target:
private Q createQuery ( ) { try { java.lang.reflect.Constructor < ? extends Q > con = getQueryType ( ) . getConstructor ( getParameterType ( ) ) ; return con.newInstance ( getQueryParameters ( ) ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
private org.ovirt.engine.core.compat.Version clusterVersionOrNull ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = model.getSelectedCluster ( ) ; if ( ( vdsGroup == null ) || ( ( vdsGroup.getCompatibilityVersion ( ) ) == null ) ) { return null ; } return vdsGroup.getCompatibilityVersion ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = this ; behavior.maxThreadsPerCore = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { _isoList = org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.getIrsProxy ( ) . getFloppyList ( org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.proceedProxyReturnValue ( ) ; if ( ( ( _isoList.mVMList ) != null ) && ( ( _isoList.mVMList.length ) > 0 ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.setReturnValue ( new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( _isoList.mVMList ) ) ) ; } else { org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.setReturnValue ( new java.util.ArrayList < java.lang.String > ( ) ) ; } }

Target:
protected void executeIrsBrokerCommand ( ) { _isoList = org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.getIrsProxy ( ) . getFloppyList ( org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.proceedProxyReturnValue ( ) ; if ( ( ( _isoList.mVMList ) != null ) && ( ( _isoList.mVMList.length ) > 0 ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.setReturnValue ( new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( _isoList.mVMList ) ) ) ; } else { org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.setReturnValue ( new java.util.ArrayList < java.lang.String > ( ) ) ; } }
Source:
protected static boolean IsLegalClusterId ( org.ovirt.engine.core.compat.Guid clusterId , java.util.List < java.lang.String > reasons ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( clusterId ) ; boolean legalClusterId = vdsGroup != null ; if ( ! legalClusterId ) { reasons.add ( VdcBllErrors.VM_INVALID_SERVER_CLUSTER_ID.toString ( ) ) ; } return legalClusterId ; }

Target:
protected static boolean isLegalClusterId ( org.ovirt.engine.core.compat.Guid clusterId , java.util.List < java.lang.String > reasons ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( clusterId ) ; boolean legalClusterId = vdsGroup != null ; if ( ! legalClusterId ) { reasons.add ( VdcBllErrors.VM_INVALID_SERVER_CLUSTER_ID.toString ( ) ) ; } return legalClusterId ; }