auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private void releaseUsedHostDevices ( ) { if ( hostDeviceManager.checkVmNeedsHostDevices ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) ) ) { try { hostDeviceManager.acquireHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ; hostDeviceManager.freeVmHostDevices ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; } finally { hostDeviceManager.releaseHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ; } } }

Target:
private boolean releaseUsedHostDevices ( ) { if ( hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) ) ) { try { hostDeviceManager.acquireHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ; hostDeviceManager.freeVmHostDevices ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; } finally { hostDeviceManager.releaseHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ; } return true ; } return false ; }
Source:
public void canDoActionFailedVMHasNotDisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionFailedVMHasNotDisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.Cancel ( ) ; } }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; vmListModel1.Cancel ( ) ; }
Source:
private void verifyModel ( org.ovirt.engine.api.model.Cdrom model ) { org.junit.Assert.assertEquals ( Guid.Empty.toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertTrue ( model.isSetTemplate ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendTemplateCdromsResourceTest.TEMPLATE_ID.toString ( ) , model.getTemplate ( ) . getId ( ) ) ; org.junit.Assert.assertTrue ( model.isSetFile ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendTemplateCdromsResourceTest.ISO_PATH , model.getFile ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
private void verifyModel ( org.ovirt.engine.api.model.Cdrom model ) { org.junit.jupiter.api.Assertions.assertEquals ( Guid.Empty.toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( model.isSetTemplate ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendTemplateCdromsResourceTest.TEMPLATE_ID.toString ( ) , model.getTemplate ( ) . getId ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( model.isSetFile ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendTemplateCdromsResourceTest.ISO_PATH , model.getFile ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public void getRpmVersion ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { soundDeviceSupportMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }

Target:
public void onSuccess ( java.lang.Integer returnValue ) { defaultSpmPriority = returnValue ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResourceTest.TEMPLATE_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private static void setDiskList ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageList ( ) ) { vmTemplate.getDiskList ( ) . add ( diskImage ) ; } java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > diskImageTemplate = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageTempalteList ( ) ; vmTemplate.getDiskTemplateMap ( ) . putAll ( diskImageTemplate ) ; }

Target:
private static void setDiskList ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageList ( ) ) { vmTemplate.getDiskList ( ) . add ( diskImage ) ; } java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageTemplate = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageTempalteList ( ) ; vmTemplate.getDiskTemplateMap ( ) . putAll ( diskImageTemplate ) ; }
Source:
public void getAllErrata ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForEngine , new org.ovirt.engine.core.common.queries.GetErrataCountsParameters ( ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
protected boolean acquireLock ( ) { org.ovirt.engine.core.bll.LockIdNameAttribute annotation = getClass ( ) . getAnnotation ( org.ovirt.engine.core.bll.LockIdNameAttribute.class ) ; boolean returnValue = true ; if ( annotation != null ) { if ( ! ( annotation.isWait ( ) ) ) { returnValue = acquireLockInternal ( ) ; } else { acquireLockAndWait ( ) ; } } return returnValue ; }

Target:
protected boolean acquireLock ( ) { org.ovirt.engine.core.bll.LockIdNameAttribute annotation = getClass ( ) . getAnnotation ( org.ovirt.engine.core.bll.LockIdNameAttribute.class ) ; boolean returnValue = true ; if ( annotation != null ) { isReleaseExecute = annotation.isReleaseAtEndOfExecute ( ) ; if ( ! ( annotation.isWait ( ) ) ) { returnValue = acquireLockInternal ( ) ; } else { acquireLockAndWait ( ) ; } } return returnValue ; }
Source:
public static long convert ( long size , org.ovirt.engine.ui.uicommonweb.models.gluster.SizeConverter.SizeUnit fromUnit , org.ovirt.engine.ui.uicommonweb.models.gluster.SizeConverter.SizeUnit toUnit ) { long fromType = fromUnit.getUnitWeight ( ) ; long toType = toUnit.getUnitWeight ( ) ; return ( ( long ) ( size * ( ( java.lang.Math.pow ( org.ovirt.engine.ui.uicommonweb.models.gluster.SizeConverter.CONVERT_FACTOR , fromType ) ) / ( java.lang.Math.pow ( org.ovirt.engine.ui.uicommonweb.models.gluster.SizeConverter.CONVERT_FACTOR , toType ) ) ) ) ) ; }

Target:
public static long convert ( long size , org.ovirt.engine.ui.uicommonweb.models.SizeConverter.SizeUnit fromUnit , org.ovirt.engine.ui.uicommonweb.models.SizeConverter.SizeUnit toUnit ) { long fromType = fromUnit.getUnitWeight ( ) ; long toType = toUnit.getUnitWeight ( ) ; return ( ( long ) ( size * ( ( java.lang.Math.pow ( org.ovirt.engine.ui.uicommonweb.models.SizeConverter.CONVERT_FACTOR , fromType ) ) / ( java.lang.Math.pow ( org.ovirt.engine.ui.uicommonweb.models.SizeConverter.CONVERT_FACTOR , toType ) ) ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmPayload getVmPayloadByDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.RunVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK , deviceType.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) { return new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ; } } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmPayload getVmPayloadByDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.RunVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK , deviceType.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( ( vmDevice.getIsManaged ( ) ) && ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) ) { return new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ; } } return null ; }
Source:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsSpmIdMap > result = dao.getAll ( org.ovirt.engine.core.dao.VdsSpmIdMapDaoTest.EXISTING_STORAGE_POOL_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsSpmIdMap mapping : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VdsSpmIdMapDaoTest.EXISTING_STORAGE_POOL_ID , mapping.getStoragePoolId ( ) ) ; } }

Target:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsSpmIdMap > result = dao.getAll ( FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsSpmIdMap mapping : result ) { org.junit.Assert.assertEquals ( FixturesTool.DATA_CENTER , mapping.getStoragePoolId ( ) ) ; } }
Source:
public void removeAllIllegalDisks ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ) { if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , vmId ) ; } } }

Target:
public void removeAllIllegalDisks ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ) { if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL ) ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , vmId ) ; } } }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }

Target:
public void 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 testCannotDisableVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; command.getParameters ( ) . setVirtioScsiEnabled ( false ) ; org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setPlugged ( true ) ; mockDiskDaoGetAllForVm ( java.util.Collections.singletonList ( disk ) , true ) ; mockVmValidator ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newGroup = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_6 ) ; vmStatic.setClusterId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( command ) . getClusterDao ( ) ; org.junit.Assert.assertFalse ( "validate should have failed with can't change cluster." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }
Source:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.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 ) ; } }

Target:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.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 ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( userProfileDao.getByUserId ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getUserId ( ) ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_PROFILE_NOT_EXIST ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getUserProfile ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_PROFILE_NOT_EXIST ) ; } return true ; }
Source:
public void lunDiskValid ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createVds ( ) ; setupForLun ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > luns = java.util.Collections.singletonList ( lunDisk.getLun ( ) ) ; org.mockito.Mockito.doReturn ( luns ) . when ( lunValidator ) . executeGetDeviceList ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ) ; org.junit.Assert.assertThat ( lunValidator.isLunDiskVisible ( lunDisk.getLun ( ) , vds ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void lunDiskValid ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createVds ( ) ; setupForLun ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = java.util.Collections.singletonList ( lunDisk.getLun ( ) ) ; org.mockito.Mockito.doReturn ( luns ) . when ( lunValidator ) . executeGetDeviceList ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ) ; org.junit.Assert.assertThat ( lunValidator.isLunDiskVisible ( lunDisk.getLun ( ) , vds ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( key ) == null ? 0 : key.hashCode ( ) ) ; result = ( prime * result ) + ( ( value ) == null ? 0 : value.hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.compat.KeyValuePairCompat ) ) { return false ; } org.ovirt.engine.core.compat.KeyValuePairCompat other = ( ( org.ovirt.engine.core.compat.KeyValuePairCompat ) ( obj ) ) ; return ( java.util.Objects.equals ( key , other.key ) ) && ( java.util.Objects.equals ( value , other.value ) ) ; }
Source:
public void postOnSetupNetworks ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters hostSetupNetworksParameters = createHostSetupNetworksParameters ( ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction setupNetworksAction = new org.ovirt.engine.ui.uicommonweb.action.UiVdcAction ( org.ovirt.engine.core.common.action.VdcActionType.HostSetupNetworks , hostSetupNetworksParameters , this , true ) ; setupNetworksAction.then ( getVfsConfigAction ( ) ) . then ( getCommitNetworkChangesAction ( ) ) . onAllExecutionsFinish ( getCloseAction ( ) ) ; setupNetworksAction.runAction ( ) ; }

Target:
private org.ovirt.engine.ui.uicommonweb.action.UiAction createSetupNetworksAction ( ) { final org.ovirt.engine.core.common.action.HostSetupNetworksParameters hostSetupNetworksParameters = createHostSetupNetworksParameters ( ) ; return new org.ovirt.engine.ui.uicommonweb.action.UiVdcAction ( org.ovirt.engine.core.common.action.VdcActionType.HostSetupNetworks , hostSetupNetworksParameters , this , true ) { @ java.lang.Override protected boolean shouldExecute ( ) { return ! ( hostSetupNetworksParameters.isEmptyRequest ( ) ) ; } } ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isISCSIConnectionAndDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.bll.ValidationResult validationResult = isSameStorageType ( storageDomain ) ; if ( ! ( validationResult.isValid ( ) ) ) { return validationResult ; } org.ovirt.engine.core.common.businessentities.storage.StorageType connectionStorageType = connection.getstorage_type ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageDomainType = storageDomain.getStorageType ( ) ; if ( ( ! ( connectionStorageType.equals ( StorageType.ISCSI ) ) ) || ( ! ( storageDomainType.equals ( StorageType.ISCSI ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_ACTION_IS_SUPPORTED_ONLY_FOR_ISCSI_DOMAINS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isISCSIConnectionAndDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.bll.ValidationResult validationResult = isSameStorageType ( storageDomain ) ; if ( ! ( validationResult.isValid ( ) ) ) { return validationResult ; } org.ovirt.engine.core.common.businessentities.storage.StorageType connectionStorageType = connection.getstorage_type ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageDomainType = storageDomain.getStorageType ( ) ; if ( ( ! ( connectionStorageType.equals ( StorageType.ISCSI ) ) ) || ( ! ( storageDomainType.equals ( StorageType.ISCSI ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_ACTION_IS_SUPPORTED_ONLY_FOR_ISCSI_DOMAINS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected boolean checkIsConnectionFieldEmpty ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( connection.getconnection ( ) ) ) { java.lang.String fieldName = org.ovirt.engine.core.bll.storage.StorageServerConnectionCommandBase.getFieldName ( connection ) ; org.ovirt.engine.core.bll.storage.StorageServerConnectionCommandBase.addCanDoActionMessage ( java.lang.String.format ( "$fieldName %1$s" , fieldName ) ) ; addCanDoActionMessage ( VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_CONNECTION ) ; return true ; } return false ; }

Target:
protected boolean checkIsConnectionFieldEmpty ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( connection.getconnection ( ) ) ) { java.lang.String fieldName = org.ovirt.engine.core.bll.storage.StorageServerConnectionCommandBase.getFieldName ( connection ) ; org.ovirt.engine.core.bll.storage.StorageServerConnectionCommandBase.addCanDoActionMessageVariable ( "fieldName" , fieldName ) ; addCanDoActionMessage ( VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_CONNECTION ) ; return true ; } return false ; }
Source:
private void saveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( storageModel.getSelectedItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { OnSaveSanStorage ( ) ; } else { forceCreationWarning ( usedLunsMessages ) ; } }

Target:
private void saveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( storageModel.getSelectedItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { onSaveSanStorage ( ) ; } else { forceCreationWarning ( usedLunsMessages ) ; } }
Source:
public void getAllByVmWithConfiguration ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots = dao.getAllWithConfiguration ( FixturesTool.VM_RHEL5_POOL_50 ) ; org.junit.Assert.assertEquals ( "VM should have a snapshot" , 1 , snapshots.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : snapshots ) { org.junit.Assert.assertEquals ( "Snapshot should have configuration" , "test!" , snapshot.getVmConfiguration ( ) ) ; org.junit.Assert.assertTrue ( "Snapshot should have configuration available" , snapshot.isVmConfigurationAvailable ( ) ) ; } }

Target:
public void getAllByVmWithConfiguration ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots = dao.getAllWithConfiguration ( FixturesTool.VM_RHEL5_POOL_50 ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , snapshots.size ( ) , "VM should have a snapshot" ) ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : snapshots ) { org.junit.jupiter.api.Assertions.assertEquals ( "test!" , snapshot.getVmConfiguration ( ) , "Snapshot should have configuration" ) ; org.junit.jupiter.api.Assertions.assertTrue ( snapshot.isVmConfigurationAvailable ( ) , "Snapshot should have configuration available" ) ; } }
Source:
private static int getNextImage ( 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 ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
public org.ovirt.engine.core.compat.Guid persistAsyncTaskPlaceHolder ( ) { return super . persistAsyncTaskPlaceHolder ( getActionType ( ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; 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 { setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { collection.deprecatedRemove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private java.lang.String getValueValues ( org.ovirt.api.metamodel.concepts.EnumType enumType ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( org.ovirt.api.metamodel.concepts.EnumValue enumValue : enumType.getValues ( ) ) { builder.append ( "'" ) . append ( enumValue.getName ( ) . toString ( ) . toLowerCase ( ) ) . append ( "', " ) ; } builder.deleteCharAt ( ( ( builder.length ( ) ) - 1 ) ) ; builder.deleteCharAt ( ( ( builder.length ( ) ) - 1 ) ) ; return builder.toString ( ) ; }

Target:
private java.lang.String getValueValues ( org.ovirt.api.metamodel.concepts.EnumType enumType ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( org.ovirt.api.metamodel.concepts.EnumValue enumValue : enumType.getValues ( ) ) { builder.append ( "'" ) . append ( getValueText ( enumValue ) ) . append ( "', " ) ; } builder.deleteCharAt ( ( ( builder.length ( ) ) - 1 ) ) ; builder.deleteCharAt ( ( ( builder.length ( ) ) - 1 ) ) ; return builder.toString ( ) ; }
Source:
public boolean isCurrentlyVisible ( boolean advancedMode ) { if ( isAlwaysHidden ( ) ) { return false ; } if ( ! ( isApplicationLevelVisible ( ) ) ) { return false ; } if ( ( ! advancedMode ) && ( isVisibleOnlyInAdvanced ( ) ) ) { return false ; } return true ; }

Target:
public boolean isCurrentlyVisible ( boolean advancedMode , boolean createInstanceMode ) { if ( isAlwaysHidden ( ) ) { return false ; } if ( ! ( isApplicationLevelVisible ( ) ) ) { return false ; } if ( ( ! advancedMode ) && ( isVisibleOnlyInAdvanced ( ) ) ) { return false ; } if ( createInstanceMode && ( isAdminOnly ( ) ) ) { return false ; } return true ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( ( ipConfiguration != null ) && ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) && ( ( ( ipConfiguration.getAddress ( ) ) == null ) || ( ( ipConfiguration.getNetmask ( ) ) == null ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . when ( failWhen ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( ( ipConfiguration != null ) && ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) && ( unsetAddress ( ipConfiguration ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . when ( failWhen ) ; }
Source:
public void getUserMessageOfTheDayViaPublic ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.storage.RepoImage a , org.ovirt.engine.core.common.businessentities.storage.RepoImage b ) { return a.getRepoImageId ( ) . compareToIgnoreCase ( b.getRepoImageId ( ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { stopProgress ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > repoImageList = new java.util.ArrayList < > ( ) ; if ( ( ( returnValue != null ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) && ( returnValue.getSucceeded ( ) ) ) { repoImageList = returnValue.getReturnValue ( ) ; java.util.Collections.sort ( repoImageList , java.util.Comparator.comparing ( RepoImage :: getRepoImageId ) ) ; } setItems ( repoImageList ) ; setIsEmpty ( repoImageList.isEmpty ( ) ) ; }
Source:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . get ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.serverId ) ; org.mockito.Mockito.doReturn ( getCluster ( true , Version.v4_1 ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . get ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.serverId ) ; org.mockito.Mockito.doReturn ( getCluster ( true , Version.v4_1 ) ) . when ( clusterDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
protected void saveDiskImageDynamic ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic diskDynamic = new org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic ( ) ; diskDynamic.setId ( disk.getImageId ( ) ) ; diskDynamic.setactual_size ( disk.getActualSizeInBytes ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getDiskImageDynamicDAO ( ) . save ( diskDynamic ) ; }

Target:
protected void saveDiskImageDynamic ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic diskDynamic = new org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic ( ) ; diskDynamic.setId ( disk.getImageId ( ) ) ; diskDynamic.setactual_size ( disk.getActualSizeInBytes ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getDiskImageDynamicDao ( ) . save ( diskDynamic ) ; }
Source:
public java.lang.String getHostNameOrIP ( org.ovirt.engine.core.compat.Guid glusterHostUuid ) { java.lang.String hostName = null ; if ( glusterHostUuid != null ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServer glusterServer = getGlusterServerDao ( ) . getByGlusterServerUuid ( glusterHostUuid ) ; if ( glusterServer != null ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = getVdsStaticDao ( ) . get ( glusterServer.getId ( ) ) ; if ( vds != null ) { hostName = vds.getHostName ( ) ; } } } return hostName ; }

Target:
public java.lang.String getHostNameOrIP ( org.ovirt.engine.core.compat.Guid glusterHostUuid ) { java.lang.String hostName = null ; if ( glusterHostUuid != null ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServer glusterServer = glusterServerDao.getByGlusterServerUuid ( glusterHostUuid ) ; if ( glusterServer != null ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = vdsStaticDao.get ( glusterServer.getId ( ) ) ; if ( vds != null ) { hostName = vds.getHostName ( ) ; } } } return hostName ; }
Source:
private org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage createMacsStorage ( java.util.Collection < org.apache.commons.lang.math.LongRange > rangesBoundaries ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage ( allowDuplicates ) ; for ( org.apache.commons.lang.math.LongRange range : rangesBoundaries ) { macsStorage.addRange ( range.getMinimumLong ( ) , range.getMaximumLong ( ) ) ; } if ( macsStorage.availableMacExist ( ) ) { return macsStorage ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_INITIALIZATION_FAILED ) ; } }

Target:
private org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage createMacsStorage ( java.util.Collection < org.apache.commons.lang.math.LongRange > rangesBoundaries ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage ( allowDuplicates ) ; for ( org.apache.commons.lang.math.LongRange range : rangesBoundaries ) { macsStorage.addRange ( range.getMinimumLong ( ) , range.getMaximumLong ( ) ) ; } if ( macsStorage.availableMacExist ( ) ) { return macsStorage ; } else { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.MAC_POOL_INITIALIZATION_FAILED ) ; } }
Source:
public static void enableHaReservationCheck ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start HA Reservation check" ) ; java.lang.Integer interval = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsHaReservationIntervalInMinutes ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "performHaResevationCheck" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , interval , interval , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished HA Reservation check" ) ; } }

Target:
public void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( this , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }
Source:
protected void verifyRemoveAllDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.mockito.Mockito.verify ( macPoolManager , org.mockito.Mockito.times ( 1 ) ) . freeMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNicDao ) . remove ( iface.getId ( ) ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . remove ( iface.getId ( ) ) ; }

Target:
protected void verifyAddDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.network.VmNic iface , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.verify ( macPoolManager , addMacVerification ) . forceAddMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNicDao ) . save ( iface ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . save ( iface.getStatistics ( ) ) ; }
Source:
static org.ovirt.engine.api.model.Event getModel ( int index ) { org.ovirt.engine.api.restapi.resource.Event model = new org.ovirt.engine.api.restapi.resource.Event ( ) ; model.setId ( java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; model.setSeverity ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.SEVERITIES [ index ] . name ( ) ) ; model.setDescription ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; model.setOrigin ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; model.setCustomId ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; return model ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Event model , int index ) { assertNotNull ( model ) ; assertEquals ( model.getId ( ) , java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; assertEquals ( model.getSeverity ( ) , LogSeverity.ALERT.value ( ) ) ; assertEquals ( model.getDescription ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; assertEquals ( model.getOrigin ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; assertEquals ( model.getCustomId ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel object ) { disksAllocationView.edit ( object ) ; disksAllocationModel = object ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel ownerModel = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "IsAvailable" . equals ( propName ) ) { warningPanel.setVisible ( ownerModel.getIsAvailable ( ) ) ; } }