auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { addPermission ( ) ; AddVmTemplateImages ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmInterfaces = addVmInterfaces ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( getVmId ( ) , getVmTemplateId ( ) , newDiskImages , vmInterfaces ) ; setSucceeded ( true ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { addPermission ( ) ; AddVmTemplateImages ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmInterfaces = addVmInterfaces ( ) ; if ( isVmInDb ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( getVmId ( ) , getVmTemplateId ( ) , newDiskImages , vmInterfaces ) ; } else { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( getVmId ( ) , getVmTemplateId ( ) , getVm ( ) , getVmTemplate ( ) , true , java.util.Collections.< org.ovirt.engine.core.common.businessentities.VmDevice > emptyList ( ) , newDiskImages , vmInterfaces ) ; } setSucceeded ( true ) ; return null ; }
Source:
public void getUsbPolicyIsSetDisabled ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.DISABLED ) ; }

Target:
public void getUsbPolicyUsbTypeNull31 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setCompatibilityVersion ( Version.v3_1 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }
Source:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getTemplateNicList ( 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.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void VdsIdRefVds ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVdsIdRef ( null ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVds ( v ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsIdRef ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }

Target:
public void vdsIdRefVds ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVdsIdRef ( null ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVds ( v ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsIdRef ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }
Source:
public boolean isNextBreakpoint ( ) { if ( ! ( openSocket ) ) { return false ; } java.io.InputStream in ; try { askForStatus ( ) ; in = s.getInputStream ( ) ; java.io.LineNumberReader reader = new java.io.LineNumberReader ( new java.io.InputStreamReader ( in ) ) ; return "NEXT_BREAKPOINT" . equals ( reader.readLine ( ) ) ; } catch ( java.io.IOException e ) { e.printStackTrace ( ) ; return false ; } }

Target:
public synchronized boolean isNextBreakpoint ( ) { if ( ! ( openSocket ) ) { return false ; } try { askForStatus ( ) ; ois = new routines.system.NoHeaderObjectInputStream ( s.getInputStream ( ) ) ; routines.system.TraceBean traceBean = ( ( routines.system.TraceBean ) ( ois.readObject ( ) ) ) ; return traceBean.equals ( TraceStatusBean.NEXT_BREAKPOINT ) ; } catch ( java.io.IOException e ) { e.printStackTrace ( ) ; return false ; } catch ( java.lang.ClassNotFoundException e ) { e.printStackTrace ( ) ; return false ; } }
Source:
public void test64BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_3 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_64_BIT ) + 1 ) ) ; vm.setVmOs ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }

Target:
public void test64BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v3_3 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_64_BIT ) + 1 ) ) ; vm.setVmOs ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain map ( org.ovirt.engine.api.model.StorageDomain entity , org.ovirt.engine.api.model.StorageDomain template ) { org.ovirt.engine.api.model.StorageDomain model = super . map ( entity , template ) ; if ( ! ( isFiltered ( ) ) ) { switch ( entity.getstorage_type ( ) ) { case ISCSI : mapVolumeGroupIscsi ( model , entity ) ; break ; case FCP : mapVolumeGroupFcp ( model , entity ) ; break ; case NFS : case LOCALFS : case POSIXFS : mapNfsOrLocalOrPosix ( model , entity ) ; break ; } } return model ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain map ( org.ovirt.engine.api.model.StorageDomain entity , org.ovirt.engine.api.model.StorageDomain template ) { org.ovirt.engine.api.model.StorageDomain model = super . map ( entity , template ) ; if ( ! ( isFiltered ( ) ) ) { switch ( entity.getStorageType ( ) ) { case ISCSI : mapVolumeGroupIscsi ( model , entity ) ; break ; case FCP : mapVolumeGroupFcp ( model , entity ) ; break ; case NFS : case LOCALFS : case POSIXFS : mapNfsOrLocalOrPosix ( model , entity ) ; break ; } } return model ; }
Source:
private void assertGetAllRelevantQuoatsForVdsGroup ( org.ovirt.engine.core.compat.Guid vdsGroupId , int expectedQuotas ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForVdsGroup ( vdsGroupId , org.ovirt.engine.core.dao.PRIVILEGED_USER_SESSION_ID , false ) ; org.junit.Assert.assertEquals ( "Wrong number of quotas retuend" , expectedQuotas , quotas.size ( ) ) ; }

Target:
public void testGetRelevantStorageQuotaForUserWithoutPrivileges ( ) throws java.lang.Exception { org.junit.Assert.assertNotNull ( unprivilegedUserSession ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForStorage ( FixturesTool.STORAGE_DOAMIN_NFS_MASTER , unprivilegedUserSession.getId ( ) , true ) ; org.junit.Assert.assertEquals ( "Unprivileged user is not allowed to fetch for quota" , 0 , quotas.size ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc monitorCommand ( java.lang.String vmId , java.lang.String monitorCommand ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.monitorCommand" ) . withParameter ( "vmID" , vmId ) . withParameter ( "command" , monitorCommand ) . 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 sparsifyVolume ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > volumeAddress ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.sparsify_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , volumeAddress ) . 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 static void getMaxNumOfVmCpus ( 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 ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.isInternalExecution ( ) ) || ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.RestartVds ) ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getName ( ) , getRequestedAuditEvent ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addCanDoActionMessage ( VdcBllMessages.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.addCanDoActionMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }

Target:
private boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.isInternalExecution ( ) ) || ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.RestartVds ) ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getName ( ) , getRequestedAuditEvent ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addCanDoActionMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.addCanDoActionMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . withParameter ( "volName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc glusterVolumeGeoRepConfigList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepConfigList" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . 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.gluster.GlusterVolumeGeoRepConfigListXmlRpc ( response ) ; }
Source:
public void modifyPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { org.ovirt.engine.core.compat.Guid macPoolId = macPool.getId ( ) ; if ( ! ( macPools.containsKey ( macPoolId ) ) ) { throw new java.lang.IllegalStateException ( createExceptionMessageMacPoolHavingIdDoesNotExist ( macPoolId ) ) ; } org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.debug ( "Updating pool {}. (old will be deleted and new initialized from db entity)" , macPool ) ; removeWithoutLocking ( macPoolId ) ; initializeMacPool ( macPool ) ; } }

Target:
public void modifyPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { org.ovirt.engine.core.compat.Guid macPoolId = macPool.getId ( ) ; if ( ! ( macPools.containsKey ( macPoolId ) ) ) { throw new java.lang.IllegalStateException ( createExceptionMessageMacPoolHavingIdDoesNotExist ( macPoolId ) ) ; } org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.debug ( "Updating pool {}. (old will be deleted and new initialized from db entity)" , macPool ) ; removeWithoutLocking ( macPoolId ) ; createPoolInternal ( macPool , false ) ; } }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
private static void updateInterfacesWithUserConfiguration ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsForUpdate , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsByName ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicForUpdate : nicsForUpdate ) { if ( nicsByName.containsKey ( nicForUpdate.getName ( ) ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = nicsByName.get ( nicForUpdate.getName ( ) ) ; nicForUpdate.setLabels ( nic.getLabels ( ) ) ; nicForUpdate.setQosOverridden ( nic.isQosOverridden ( ) ) ; } } }

Target:
private static void updateInterfacesWithUserConfiguration ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsForUpdate , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsByName ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicForUpdate : nicsForUpdate ) { if ( nicsByName.containsKey ( nicForUpdate.getName ( ) ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = nicsByName.get ( nicForUpdate.getName ( ) ) ; nicForUpdate.setLabels ( nic.getLabels ( ) ) ; nicForUpdate.setQosOverridden ( nic.isQosOverridden ( ) ) ; nicForUpdate.setCustomProperties ( nic.getCustomProperties ( ) ) ; } } }
Source:
public boolean poll ( org.ovirt.engine.core.compat.Guid hostId ) { waitBetweenPolls ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.LOGGER.trace ( "Request to do poll for host {}." , hostId ) ; org.ovirt.engine.core.common.interfaces.FutureVDSCall < org.ovirt.engine.core.common.vdscommands.VDSReturnValue > task = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runFutureVdsCommand ( FutureVDSCommandType.Poll , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( hostId ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.LOGGER.trace ( "FutureVDSCommandType.Poll executed for host{}." , hostId ) ; boolean succeeded = getValue ( task ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.LOGGER.trace ( "Result of FutureVDSCommandType.Poll for host {}: {}" , hostId , succeeded ) ; timestampOfEndOfPreviousInvocation = currentTimestamp ( ) ; return succeeded ; }

Target:
public boolean poll ( ) { waitBetweenPolls ( ) ; org.ovirt.engine.core.bll.network.host.HostPoller.LOGGER.trace ( "Request to do poll for host {}." , parameters.getVdsId ( ) ) ; org.ovirt.engine.core.common.interfaces.FutureVDSCall < org.ovirt.engine.core.common.vdscommands.VDSReturnValue > task = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runFutureVdsCommand ( FutureVDSCommandType.Poll , parameters ) ; org.ovirt.engine.core.bll.network.host.HostPoller.LOGGER.trace ( "FutureVDSCommandType.Poll executed for host{}." , parameters.getVdsId ( ) ) ; boolean succeeded = getValue ( task ) ; org.ovirt.engine.core.bll.network.host.HostPoller.LOGGER.trace ( "Result of FutureVDSCommandType.Poll for host {}: {}" , parameters.getVdsId ( ) , succeeded ) ; timestampOfEndOfPreviousInvocation = currentTimestamp ( ) ; return succeeded ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.Provider > getBackendCollection ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , QueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , clusterId.toString ( ) , true ) ; org.ovirt.engine.core.compat.Guid defaultNetworkProviderId = cluster.getDefaultNetworkProviderId ( ) ; if ( defaultNetworkProviderId != null ) { providers.add ( getEntity ( org.ovirt.engine.core.common.businessentities.Provider.class , QueryType.GetProviderById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( defaultNetworkProviderId ) , defaultNetworkProviderId.toString ( ) ) ) ; } return providers ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.Provider > getBackendCollection ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , QueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , clusterId.toString ( ) , true ) ; org.ovirt.engine.core.compat.Guid defaultNetworkProviderId = cluster.getDefaultNetworkProviderId ( ) ; if ( cluster.isSetDefaultNetworkProviderId ( ) ) { providers.add ( getEntity ( org.ovirt.engine.core.common.businessentities.Provider.class , QueryType.GetProviderById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( defaultNetworkProviderId ) , defaultNetworkProviderId.toString ( ) ) ) ; } return providers ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private static int GetFirstImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( curr.getParentId ( ) . equals ( images.get ( i ) . getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
private static int getFirstImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( curr.getParentId ( ) . equals ( images.get ( i ) . getImageId ( ) ) ) { return i ; } } return - 1 ; }
Source:
public void testValidUpdateOfHotSetEditableFieldOnRunningVm ( ) { int srcNumOfSockets = 2 ; int destNumOfSockets = 4 ; org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setNumOfSockets ( srcNumOfSockets ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setNumOfSockets ( destNumOfSockets ) ; boolean updateIsValid = org.ovirt.engine.core.bll.VmHandler.isUpdateValid ( src , dest , VMStatus.Up , true ) ; org.junit.Assert.assertTrue ( "Update should be valid for different number of sockets on a running VM" , updateIsValid ) ; }

Target:
public void testValidUpdateOfHotSetEditableFieldOnRunningVm ( ) { int srcNumOfSockets = 2 ; int destNumOfSockets = 4 ; org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setNumOfSockets ( srcNumOfSockets ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setNumOfSockets ( destNumOfSockets ) ; boolean updateIsValid = vmHandler.isUpdateValid ( src , dest , VMStatus.Up , true ) ; org.junit.Assert.assertTrue ( "Update should be valid for different number of sockets on a running VM" , updateIsValid ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configGet" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configList" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.Provider provider = org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getDbFacade ( ) . getProviderDao ( ) . get ( org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . getProvidedBy ( ) . getProviderId ( ) ) ; org.ovirt.engine.core.bll.provider.network.NetworkProviderProxy proxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . getProvidedBy ( ) . setExternalId ( proxy.add ( org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) ) ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . setVlanId ( null ) ; super . executeCommand ( ) ; }

Target:
private void addNetwork ( ) { super . executeCommand ( ) ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }

Target:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else { getIsShareable ( ) . setIsChangable ( isEditEnabled ( ) ) ; } }
Source:
public void acquireSession ( java.lang.String userNameWithDomain , java.lang.String password ) { com.google.gwt.http.client.RequestBuilder requestBuilder = createRequest ( ) ; setPersistentAuthHeader ( requestBuilder ) ; requestBuilder.setUser ( userNameWithDomain ) ; requestBuilder.setPassword ( password ) ; sendRequest ( requestBuilder , new org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.RestApiRequestCallback ( ) { @ java.lang.Override protected void processResponse ( com.google.gwt.http.client.Response response ) { java.lang.String sessionIdFromHeader = response.getHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_HEADER ) ; if ( sessionIdFromHeader != null ) { setCurrentSessionId ( sessionIdFromHeader ) ; } reuseCurrentSession ( ) ; } } ) ; }

Target:
public void releaseSession ( ) { clearSessionId ( ) ; }
Source:
public void mapModel ( ) { for ( org.ovirt.engine.api.restapi.types.WatchdogModel model : org.ovirt.engine.api.restapi.types.WatchdogModel.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType backendModel = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model , null ) ; org.junit.Assert.assertNotNull ( backendModel ) ; org.junit.Assert.assertEquals ( backendModel.name ( ) . toLowerCase ( ) , model.name ( ) . toLowerCase ( ) ) ; } }

Target:
public void mapModel ( ) { for ( org.ovirt.engine.api.model.WatchdogModel model : org.ovirt.engine.api.model.WatchdogModel.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType backendModel = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model , null ) ; org.junit.Assert.assertNotNull ( backendModel ) ; org.junit.Assert.assertEquals ( backendModel.name ( ) . toLowerCase ( ) , model.name ( ) . toLowerCase ( ) ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( T value ) { setTitle ( value.getStopReason ( ) ) ; if ( ( ( value.getStopReason ( ) ) != null ) && ( ! ( value.getStopReason ( ) . trim ( ) . isEmpty ( ) ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.ReasonColumn.getApplicationResources ( ) . commentImage ( ) ; } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( T value ) { if ( ( ( getReason ( value ) ) != null ) && ( ! ( getReason ( value ) . trim ( ) . isEmpty ( ) ) ) ) { return templates.inlineImageWithTitle ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( resources.commentImage ( ) ) . getHTML ( ) ) , getReason ( value ) ) ; } return null ; }
Source:
public void testChangeClusterForbidden ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup newGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_0 ) ; vmStatic.setVdsGroupId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( command ) . getVdsGroupDao ( ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with can't change cluster." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup newGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_0 ) ; vmStatic.setVdsGroupId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( command ) . getVdsGroupDao ( ) ; org.junit.Assert.assertFalse ( "validate should have failed with can't change cluster." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }
Source:
protected void executeQueryCommand ( ) { java.lang.String [ ] names = new java.lang.String [ 0 ] ; org.ovirt.engine.core.common.vdscommands.GetLldpVDSCommandParameters lldpVDSCommandParameters = new org.ovirt.engine.core.common.vdscommands.GetLldpVDSCommandParameters ( org.ovirt.engine.core.bll.network.host.GetMultipleTlvsByHostIdQuery.getParameters ( ) . getId ( ) , names ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue command = runVdsCommand ( VDSCommandType.GetLldp , lldpVDSCommandParameters ) ; org.ovirt.engine.core.bll.network.host.GetMultipleTlvsByHostIdQuery.getQueryReturnValue ( ) . setReturnValue ( command.getReturnValue ( ) ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getHostId ( ) { return org.ovirt.engine.core.bll.network.host.GetMultipleTlvsByHostIdQuery.getParameters ( ) . getId ( ) ; }
Source:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
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.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }

Target:
protected void executeCommand ( ) { getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; poolPerDc.createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void qosOverCommitmentReportedNicSpeed ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmentNicSetup ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_OVERCOMMITMENT , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) ; }

Target:
private void mockCalculateBaseNicWhenBaseNicIsPassed ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( nic ) ) ) . thenReturn ( nic ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( nic ) , org.mockito.Matchers.any ( java.util.Map.class ) ) ) . thenReturn ( nic ) ; }
Source:
protected org.ovirt.engine.api.model.Groups mapDbGroupsCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.DbUser > entities ) { org.ovirt.engine.api.model.Groups collection = new org.ovirt.engine.api.model.Groups ( ) ; for ( org.ovirt.engine.core.common.businessentities.DbUser entity : entities ) { collection.getGroups ( ) . add ( addLinks ( modifyDomain ( mapDbUser ( entity ) ) ) ) ; } return collection ; }

Target:
protected org.ovirt.engine.api.model.Groups mapDbGroupsCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.DbUser > entities ) { org.ovirt.engine.api.model.Groups collection = new org.ovirt.engine.api.model.Groups ( ) ; for ( org.ovirt.engine.core.common.businessentities.DbUser entity : entities ) { collection.getGroups ( ) . add ( addLinks ( modifyDomain ( mapDbUser ( entity ) ) , org.ovirt.engine.api.model.BaseResource.class ) ) ; } return collection ; }
Source:
public void testUpdateFieldsQuotaEnforcementType ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.DISABLED ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; org.junit.Assert.assertTrue ( "Update should be valid for different quota enforcement types" , org.ovirt.engine.core.bll.VmTemplateHandler.isUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsQuotaEnforcementType ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.DISABLED ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; org.junit.Assert.assertTrue ( "Update should be valid for different quota enforcement types" , vmTemplateHandler.isUpdateValid ( src , dest ) ) ; }
Source:
private static int getFirstImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( curr.getParentId ( ) . equals ( images.get ( i ) . getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
private java.lang.String getMemoryVolumeForNewActiveSnapshot ( ) { return getParameters ( ) . isImportAsNewEntity ( ) ? org.apache.commons.lang.StringUtils.EMPTY : getMemoryVolumeFromActiveSnapshotInExportDomain ( ) ; }
Source:
protected void alertIfFencingDisabled ( ) { if ( ! ( getVdsGroup ( ) . getFencingPolicy ( ) . isFencingEnabled ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alb = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alb.setVdsGroupId ( getVdsGroup ( ) . getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( alb , AuditLogType.FENCING_DISABLED_IN_CLUSTER_POLICY ) ; } }

Target:
protected void alertIfFencingDisabled ( ) { if ( ! ( getVdsGroup ( ) . getFencingPolicy ( ) . isFencingEnabled ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alb = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alb.setVdsGroupId ( getVdsGroup ( ) . getId ( ) ) ; alb.setRepeatable ( true ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( alb , AuditLogType.FENCE_DISABLED_IN_CLUSTER_POLICY ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkView entity = super . mapRow ( rs , rowNum ) ; entity.setStoragePoolName ( rs.getString ( "storage_pool_name" ) ) ; entity.setCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; entity.setProviderName ( rs.getString ( "provider_name" ) ) ; entity.setQosName ( rs.getString ( "qos_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkView entity = super . mapRow ( rs , rowNum ) ; entity.setStoragePoolName ( rs.getString ( "storage_pool_name" ) ) ; entity.setCompatibilityVersion ( new org.ovirt.engine.core.dao.VersionRowMapper ( "compatibility_version" ) . mapRow ( rs , rowNum ) ) ; entity.setProviderName ( rs.getString ( "provider_name" ) ) ; entity.setQosName ( rs.getString ( "qos_name" ) ) ; return entity ; }
Source:
public void qosOnNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null , null , network.getName ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos = createQos ( ) ; org.mockito.Mockito.when ( qosDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( qos ) ; qos ( network , iface , qos , new org.ovirt.engine.core.compat.Version ( 3 , 4 ) ) ; }

Target:
public void qosOnNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null , null , network.getName ( ) ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos = createQos ( ) ; qos.setId ( qosId ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( qos ) ; qos ( network , iface , qos , true ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.NetworkCluster CloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.NetworkCluster ( ) ; obj.setstatus ( instance.getstatus ( ) ) ; obj.setis_display ( instance.getis_display ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; return obj ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster CloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setstatus ( instance.getstatus ( ) ) ; obj.setis_display ( instance.getis_display ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; return obj ; }