auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public < E extends java.lang.Enum < E > > java.util.List < E > validateEnums ( java.lang.Class < E > clz , java.util.List < java.lang.String > names ) { java.util.ArrayList < E > enumList = new java.util.ArrayList < E > ( ) ; for ( java.lang.String name : names ) { enumList.add ( validateEnum ( clz , name ) ) ; } return enumList ; }

Target:
public < E extends java.lang.Enum < E > > java.util.List < E > validateEnumValues ( java.lang.Class < E > clz , java.util.List < java.lang.String > names ) { java.util.ArrayList < E > enumList = new java.util.ArrayList < E > ( ) ; for ( java.lang.String name : names ) { enumList.add ( validateEnum ( clz , name ) ) ; } return enumList ; }
Source:
public void testHostsRuleStructureNeg ( ) { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( false ) ; rule.setPositive ( true ) ; model.setHostsRule ( rule ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.POSITIVE , entity.getVdsAffinityRule ( ) ) ; org.junit.Assert.assertFalse ( entity.isVdsEnforcing ( ) ) ; }

Target:
public void testHostsRuleStructureNeg ( ) { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( false ) ; rule.setPositive ( true ) ; model.setHostsRule ( rule ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.jupiter.api.Assertions.assertEquals ( EntityAffinityRule.POSITIVE , entity.getVdsAffinityRule ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( entity.isVdsEnforcing ( ) ) ; }
Source:
public void calculateFreeVirtualMemory ( ) { if ( ( ( ( getmem_commited ( ) ) != null ) && ( ( getphysical_mem_mb ( ) ) != null ) ) && ( ( getreserved_mem ( ) ) != null ) ) { maxSchedulingMemory = ( ( ( getmax_vds_memory_over_commit ( ) ) * ( getphysical_mem_mb ( ) ) ) / 100.0F ) - ( ( getmem_commited ( ) ) + ( getreserved_mem ( ) ) ) ; maxSchedulingMemory = ( ( maxSchedulingMemory ) > 0 ) ? maxSchedulingMemory : 0 ; } }

Target:
public void calculateFreeVirtualMemory ( ) { if ( ( ( ( getMemCommited ( ) ) != null ) && ( ( getPhysicalMemMb ( ) ) != null ) ) && ( ( getReservedMem ( ) ) != null ) ) { maxSchedulingMemory = ( ( ( getMaxVdsMemoryOverCommit ( ) ) * ( getPhysicalMemMb ( ) ) ) / 100.0F ) - ( ( getMemCommited ( ) ) + ( getReservedMem ( ) ) ) ; maxSchedulingMemory = ( ( maxSchedulingMemory ) > 0 ) ? maxSchedulingMemory : 0 ; } }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( getActionState ( ) ) { case EXECUTE : return getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_STARTING_IMPORT_VM : org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; case END_SUCCESS : return getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM : org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; } return super . getAuditLogTypeValue ( ) ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.ImportVmCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.ImportVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_STARTING_IMPORT_VM : org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; case END_SUCCESS : return org.ovirt.engine.core.bll.ImportVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM : org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; } return super . getAuditLogTypeValue ( ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.DiskImageDynamic entity ) { return createIdParameterMapper ( entity.getId ( ) ) . addValue ( "read_rate" , entity.getread_rate ( ) ) . addValue ( "write_rate" , entity.getwrite_rate ( ) ) . addValue ( "actual_size" , entity.getactual_size ( ) ) . addValue ( "read_latency_seconds" , entity.getReadLatency ( ) ) . addValue ( "write_latency_seconds" , entity.getWriteLatency ( ) ) . addValue ( "flush_latency_seconds" , entity.getFlushLatency ( ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic entity ) { return createIdParameterMapper ( entity.getId ( ) ) . addValue ( "read_rate" , entity.getread_rate ( ) ) . addValue ( "write_rate" , entity.getwrite_rate ( ) ) . addValue ( "actual_size" , entity.getactual_size ( ) ) . addValue ( "read_latency_seconds" , entity.getReadLatency ( ) ) . addValue ( "write_latency_seconds" , entity.getWriteLatency ( ) ) . addValue ( "flush_latency_seconds" , entity.getFlushLatency ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.host.provider.foreman.ContentHost findContentHost ( java.lang.String hostName ) { return new org.ovirt.engine.core.bll.host.provider.foreman.KatelloV21Provider ( this ) . findContentHost ( hostName ) ; }

Target:
private org.ovirt.engine.core.bll.host.provider.ContentHostProvider getContentHostProvider ( ) { org.ovirt.engine.core.compat.Version foremanVersion = getForemanVersion ( ) ; if ( ( foremanVersion != null ) && ( foremanVersion.greaterOrEquals ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.KATELLO_V3_VERSION ) ) ) { return new org.ovirt.engine.core.bll.host.provider.foreman.KatelloV30Provider ( this ) ; } else { return new org.ovirt.engine.core.bll.host.provider.foreman.KatelloV21Provider ( this ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__DETACH ) ; return canDetachDomain ( org.ovirt.engine.core.bll.storage.DetachStorageDomainFromPoolCommand.getParameters ( ) . getDestroyingPool ( ) , org.ovirt.engine.core.bll.storage.DetachStorageDomainFromPoolCommand.getParameters ( ) . getRemoveLast ( ) , org.ovirt.engine.core.bll.storage.DetachStorageDomainFromPoolCommand.isInternalExecution ( ) ) ; }

Target:
protected void setActionMessageParameters ( ) { addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN ) ; addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__DETACH ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc validateStorageServerConnection ( int serverType , java.lang.String spUUID , java.util.Map < java.lang.String , java.lang.String > [ ] args ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.validateStorageServerConnection ( serverType , spUUID , args ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc ( 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.irsbroker.StoragePoolInfoReturnForXmlRpc getStoragePoolInfo ( java.lang.String spUUID ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getStoragePoolInfo ( spUUID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StoragePoolInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StoragePoolInfoReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }
Source:
public static void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , 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 static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setactual_size ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; i.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return i ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeFromDiskImage ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return i ; }
Source:
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 ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc getHostJobs ( java.lang.String jobType , java.util.List < java.lang.String > jobIds ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getJobs" ) . withOptionalParameter ( "job_type" , jobType ) . withOptionalParameterAsList ( "job_ids" , jobIds ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "jobs" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc ( response ) ; }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public java.util.Map spmStop ( java.lang.String spUUID ) { final org.ovirt.vdsmfake.domain.Host host = getActiveHost ( ) ; host.setSpmId ( ( - 1 ) ) ; host.setSpmStatus ( Host.SpmStatus.FREE ) ; host.setSpmLver ( ( - 1 ) ) ; updateHost ( host ) ; java.util.Map resultMap = getOKStatus ( ) ; return resultMap ; }

Target:
public java.util.Map spmStop ( java.lang.String spUUID ) { final org.ovirt.vdsmfake.domain.Host host = getActiveHost ( ) ; host.setSpmId ( ( - 1 ) ) ; host.setSpmStatus ( Host.SpmStatus.FREE ) ; host.setSpmLver ( ( - 1 ) ) ; updateHost ( host ) ; java.util.Map resultMap = getOKStatus ( ) ; org.ovirt.vdsmfake.domain.VdsmManager.getInstance ( ) . removeSpmFromMap ( spUUID ) ; return resultMap ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return diskImage.getStoragesNames ( ) . get ( 0 ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return diskImage.getStoragesNames ( ) . get ( 0 ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic updateDiskImageDynamicIntoDB ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic diskDynamic = new org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic ( ) ; diskDynamic.setId ( image.getImageId ( ) ) ; diskDynamic.setActualSize ( image.getActualSizeInBytes ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getDiskImageDynamicDao ( ) . save ( diskDynamic ) ; return diskDynamic ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic updateDiskImageDynamicIntoDB ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic diskDynamic = new org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic ( ) ; diskDynamic.setId ( image.getImageId ( ) ) ; diskDynamic.setActualSize ( image.getActualSizeInBytes ( ) ) ; diskImageDynamicDao.save ( diskDynamic ) ; return diskDynamic ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondaryDestinations ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED ) ) ? java.lang.Long.valueOf ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED ) ) : 0L ; return getUnderUtilizedMemoryHosts ( candidateHosts , requiredMemory , 0 ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondaryDestinations ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED ) ) ? java.lang.Long.parseLong ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED ) ) : 0L ; return getUnderUtilizedMemoryHosts ( candidateHosts , requiredMemory , 0 ) ; }
Source:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( org.ovirt.engine.core.common.businessentities.network.VmNic oldNic ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , oldNic , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) ) ) ) ) { return false ; } return true ; }
Source:
protected void setGetVmQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , vm ) ; } }

Target:
protected void setGetVmQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , vm ) ; } }
Source:
private org.ovirt.engine.core.bll.validator.HostValidator mockHostForUniqueId ( java.lang.String value ) { mockConfigRule.mockConfigValue ( ConfigValues.InstallVds , java.lang.Boolean.TRUE ) ; org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( host.getUniqueId ( ) ) . thenReturn ( value ) ; return new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; }

Target:
public void setup ( ) { mockConfigRule.mockConfigValue ( ConfigValues.MaxVdsNameLength , org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) ; mockConfigRule.mockConfigValue ( ConfigValues.EncryptHostCommunication , java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; }
Source:
protected javax.ws.rs.core.Response performNonBlockingAction ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { try { doNonBlockingAction ( task , params ) ; return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . build ( ) ; } catch ( java.lang.Exception e ) { return handleError ( javax.ws.rs.core.Response.class , e , false ) ; } }

Target:
protected javax.ws.rs.core.Response performNonBlockingAction ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.api.model.Action action ) { try { doNonBlockingAction ( task , params ) ; if ( action != null ) { action.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( CreationStatus.IN_PROGRESS ) ) ; return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . entity ( action ) . build ( ) ; } else { return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . build ( ) ; } } catch ( java.lang.Exception e ) { return handleError ( javax.ws.rs.core.Response.class , e , false ) ; } }
Source:
protected void executeQueryCommand ( ) { java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) ; org.ovirt.engine.core.common.utils.ExternalId id = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.aaa.Directory directory = org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getDirectory ( directoryName ) ; if ( directory == null ) { org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; } else { org.ovirt.engine.core.aaa.DirectoryUser user = directory.findUser ( id ) ; org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setReturnValue ( user ) ; } }

Target:
protected void executeQueryCommand ( ) { java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) ; java.lang.String id = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.aaa.Directory directory = org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getDirectory ( directoryName ) ; if ( directory == null ) { org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; } else { org.ovirt.engine.core.aaa.DirectoryUser user = directory.findUserById ( id ) ; org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setReturnValue ( user ) ; } }
Source:
private void mockStoragePoolDao ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDaoMock ) ; org.mockito.Mockito.when ( storagePoolDaoMock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; }

Target:
private void mockStoragePoolDao ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { org.ovirt.engine.core.dao.StoragePoolDao storagePoolDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDaoMock ) ; org.mockito.Mockito.when ( storagePoolDaoMock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { originalVfsConfigs.add ( vfsConfig ) ; nicToVfsConfig.put ( vfsConfig.getNicId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( vfsConfig ) ) ; } queryFreeBonds ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { originalVfsConfigs.add ( vfsConfig ) ; nicToVfsConfig.put ( vfsConfig.getNicId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( vfsConfig ) ) ; } queryVfMap ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; if ( ( org.ovirt.engine.core.bll.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 ( ) , getRequestDiskSpace ( ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , getStorageDomainId ( ) , getRequestDiskSpace ( ) ) ) ; } return list ; }
Source:
public void failedFenceWithAllError ( ) { mockFenceAgents ( ) ; mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; mockFenceResult ( agentExecutor2 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.STATUS ) ; org.junit.Assert.assertEquals ( Status.ERROR , result.getStatus ( ) ) ; org.junit.Assert.assertEquals ( PowerStatus.UNKNOWN , result.getPowerStatus ( ) ) ; }

Target:
public void failedFenceWithAllError ( ) { mockFenceAgents ( ) ; mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; mockFenceResult ( agentExecutor2 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.STATUS ) ; org.junit.jupiter.api.Assertions.assertEquals ( Status.ERROR , result.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( PowerStatus.UNKNOWN , result.getPowerStatus ( ) ) ; }
Source:
private org.ovirt.engine.core.common.queries.VdcQueryReturnValue generateDescriptorResponse ( ) throws java.lang.Exception { org.ovirt.engine.api.model.GraphicsType graphicsType = org.ovirt.engine.api.restapi.resource.BackendGraphicsConsoleHelper.asGraphicsType ( consoleId ) ; org.ovirt.engine.core.common.console.ConsoleOptions consoleOptions = new org.ovirt.engine.core.common.console.ConsoleOptions ( graphicsType ) ; consoleOptions.setVmId ( guid ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue configuredOptionsReturnValue = runQuery ( QueryType.ConfigureConsoleOptions , new org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams ( consoleOptions , true ) ) ; if ( ! ( configuredOptionsReturnValue.getSucceeded ( ) ) ) { throw new java.lang.Exception ( configuredOptionsReturnValue.getExceptionString ( ) ) ; } return runQuery ( QueryType.GetConsoleDescriptorFile , new org.ovirt.engine.core.common.queries.ConsoleOptionsParams ( configuredOptionsReturnValue.getReturnValue ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.queries.QueryReturnValue generateDescriptorResponse ( ) throws java.lang.Exception { org.ovirt.engine.api.model.GraphicsType graphicsType = org.ovirt.engine.api.restapi.resource.BackendGraphicsConsoleHelper.asGraphicsType ( consoleId ) ; org.ovirt.engine.core.common.console.ConsoleOptions consoleOptions = new org.ovirt.engine.core.common.console.ConsoleOptions ( graphicsType ) ; consoleOptions.setVmId ( guid ) ; org.ovirt.engine.core.common.queries.QueryReturnValue configuredOptionsReturnValue = runQuery ( QueryType.ConfigureConsoleOptions , new org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams ( consoleOptions , true ) ) ; if ( ! ( configuredOptionsReturnValue.getSucceeded ( ) ) ) { throw new java.lang.Exception ( configuredOptionsReturnValue.getExceptionString ( ) ) ; } return runQuery ( QueryType.GetConsoleDescriptorFile , new org.ovirt.engine.core.common.queries.ConsoleOptionsParams ( configuredOptionsReturnValue.getReturnValue ( ) ) ) ; }
Source:
protected boolean validateImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesToValidate = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( imagesToValidate ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . isQualifiedForLiveSnapshotMerge ( ) ) || ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesToValidate ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( disks , true , false , true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( disks ) ; allDisks.addAll ( cinderDisks ) ; return allDisks ; }
Source:
private void auditLogOvfLoadError ( java.lang.String machineName ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Template" , machineName ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_FAILED_TO_IMPORT_TEMPLATE ) ; }

Target:
private void auditLogOvfLoadError ( java.lang.String machineName , java.lang.String errorMessage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Template" , machineName ) ; logable.addCustomValue ( "ErrorMessage" , errorMessage ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.IMPORTEXPORT_FAILED_TO_IMPORT_TEMPLATE ) ; }
Source:
public void cpuTypeDoesNotSupportVirtServiceForVirtCluster ( ) { org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . cpuExists ( ) ; org.junit.Assert.assertThat ( validator.cpuTypeSupportsVirtService ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_CPU_NOT_FOUND ) ) ; }

Target:
public void cpuTypeDoesNotSupportVirtServiceForVirtCluster ( ) { org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . cpuExists ( ) ; org.junit.Assert.assertThat ( validator.cpuTypeSupportsVirtService ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CPU_NOT_FOUND ) ) ; }
Source:
public static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient createClient ( java.lang.String hostname , int port , int connectionTimeout , int clientTimeout , int connectionRetry , int heartbeat , boolean isSecure , org.ovirt.vdsm.jsonrpc.client.reactors.ReactorType type , java.lang.String protocol ) { org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy connectionPolicy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( connectionTimeout , connectionRetry , heartbeat , java.io.IOException.class ) ; org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clientPolicy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( clientTimeout , connectionRetry , heartbeat , java.io.IOException.class ) ; return org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createClient ( hostname , port , connectionPolicy , clientPolicy , isSecure , type , protocol ) ; }

Target:
public static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient createClient ( java.lang.String hostname , int port , int connectionTimeout , int clientTimeout , int connectionRetry , int heartbeat , boolean isSecure , org.ovirt.vdsm.jsonrpc.client.reactors.ReactorType type , java.lang.String protocol , int parallelism ) { org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy connectionPolicy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( connectionTimeout , connectionRetry , heartbeat , java.io.IOException.class ) ; org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clientPolicy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( clientTimeout , connectionRetry , heartbeat , java.io.IOException.class ) ; return org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createClient ( hostname , port , connectionPolicy , clientPolicy , isSecure , type , protocol , parallelism ) ; }
Source:
public static void getUpHostListByCluster ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public void getUpHostListByCluster ( 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 ) { return source != null ? source : java.util.Collections.emptyList ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
protected com.woorea.openstack.quantum.model.Port modifyPortForAllocate ( com.woorea.openstack.quantum.model.Port port , java.lang.String hostId , boolean hostChanged , java.util.List < java.lang.String > modifiedSecurityGroups ) { com.woorea.openstack.quantum.model.Port portForUpdate = new org.ovirt.engine.core.bll.provider.network.openstack.PortForUpdate ( ) ; portForUpdate.setId ( port.getId ( ) ) ; portForUpdate.setSecurityGroups ( modifiedSecurityGroups ) ; if ( hostChanged ) { portForUpdate.setBinding ( new com.woorea.openstack.quantum.model.Port.Binding ( ) ) ; portForUpdate.getBinding ( ) . setHostId ( hostId ) ; } return portForUpdate ; }

Target:
protected com.woorea.openstack.quantum.model.Port modifyPortForAllocate ( com.woorea.openstack.quantum.model.Port port , java.lang.String hostId , boolean hostChanged , java.util.List < java.lang.String > modifiedSecurityGroups , java.lang.String macAddress ) { com.woorea.openstack.quantum.model.Port portForUpdate = new org.ovirt.engine.core.bll.provider.network.openstack.PortForUpdate ( ) ; portForUpdate.setId ( port.getId ( ) ) ; portForUpdate.setSecurityGroups ( modifiedSecurityGroups ) ; if ( hostChanged ) { portForUpdate.setBinding ( new com.woorea.openstack.quantum.model.Port.Binding ( ) ) ; portForUpdate.getBinding ( ) . setHostId ( hostId ) ; portForUpdate.setMacAddress ( macAddress ) ; } return portForUpdate ; }
Source:
public void testUrlWithFilterByTypes ( ) { org.ovirt.engine.core.common.queries.ErrataFilter errataFilter = new org.ovirt.engine.core.common.queries.ErrataFilter ( ) ; errataFilter.setErrataTypes ( java.util.EnumSet.of ( Erratum.ErrataType.BUGFIX , Erratum.ErrataType.SECURITY ) ) ; org.ovirt.engine.core.bll.host.provider.foreman.FilteredErrataRelativeUrlBuilder underTest = new org.ovirt.engine.core.bll.host.provider.foreman.FilteredErrataRelativeUrlBuilder ( org.ovirt.engine.core.bll.host.provider.foreman.FilteredErrataRelativeUrlBuilderTest.HOST_ID , errataFilter ) ; org.junit.Assert.assertEquals ( "/katello/api/v2/systems/xxx/errata?search=type+%3D+bugfix+or+type+%3D+security" , underTest.build ( ) ) ; }

Target:
public void testUrlWithFilterByTypes ( ) { org.ovirt.engine.core.common.queries.ErrataFilter errataFilter = new org.ovirt.engine.core.common.queries.ErrataFilter ( ) ; errataFilter.setErrataTypes ( java.util.EnumSet.of ( Erratum.ErrataType.BUGFIX , Erratum.ErrataType.SECURITY ) ) ; org.ovirt.engine.core.bll.host.provider.foreman.FilteredErrataRelativeUrlBuilder underTest = createFilteredErrataRelativeUrlBuilder ( errataFilter ) ; org.junit.Assert.assertEquals ( "/katello/api/v2/systems/xxx/errata?search=type+%3D+bugfix+or+type+%3D+security" , underTest.build ( ) ) ; }
Source:
public void testRemoveVmsFromExistingAffinityGroup ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup existing = dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) ; org.junit.Assert.assertFalse ( existing.getEntityNames ( ) . isEmpty ( ) ) ; existing.getEntityIds ( ) . clear ( ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.scheduling.AffinityGroup fetched = dao.get ( existing.getId ( ) ) ; org.junit.Assert.assertNull ( fetched.getEntityNames ( ) ) ; }

Target:
public void testRemoveVmsFromExistingAffinityGroup ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup existing = dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) ; org.junit.Assert.assertFalse ( existing.getEntityNames ( ) . isEmpty ( ) ) ; existing.getEntityIds ( ) . clear ( ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.scheduling.AffinityGroup fetched = dao.get ( existing.getId ( ) ) ; org.junit.Assert.assertTrue ( fetched.getEntityNames ( ) . isEmpty ( ) ) ; }
Source:
private void memSize_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.updateMinAllocatedMemory ( ) ; }

Target:
private void memSize_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.updateMinAllocatedMemory ( ) ; if ( ( getMemSize ( ) . getEntity ( ) ) != null ) { maxMemorySize.setEntity ( ( ( getMemSize ( ) . getEntity ( ) ) * ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.DEFAULT_MAX_MEMORY_RATIO ) ) ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getBookmarkDao ( ) ; new_bookmark = new org.ovirt.engine.core.common.businessentities.Bookmark ( ) ; java.util.Random r = new java.util.Random ( java.lang.System.currentTimeMillis ( ) ) ; new_bookmark.setbookmark_name ( ( "newbookmarkname" + ( ( r.nextInt ( ) ) % ( org.ovirt.engine.core.dao.BookmarkDaoTest.BOOKMARK_MAX_RANDOM_NUMBER ) ) ) ) ; new_bookmark.setbookmark_value ( "newbookmarkvalue" ) ; existing_bookmark = dao.get ( new org.ovirt.engine.core.compat.Guid ( "a4affabf-7b45-4a6c-b0a9-107d0bbe265e" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getBookmarkDao ( ) ; new_bookmark = new org.ovirt.engine.core.common.businessentities.Bookmark ( ) ; java.util.Random r = new java.util.Random ( java.lang.System.currentTimeMillis ( ) ) ; new_bookmark.setName ( ( "newbookmarkname" + ( ( r.nextInt ( ) ) % ( org.ovirt.engine.core.dao.BookmarkDaoTest.BOOKMARK_MAX_RANDOM_NUMBER ) ) ) ) ; new_bookmark.setValue ( "newbookmarkvalue" ) ; existing_bookmark = dao.get ( new org.ovirt.engine.core.compat.Guid ( "a4affabf-7b45-4a6c-b0a9-107d0bbe265e" ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , true ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , true ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }