auphong2707/dl4se-code-review-dataset huggingface dataset:
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.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . 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 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" ) ; } }
Source:
public void testVmDiskWithPassDiscardAndWadExistsSucceeds ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; createVmDiskOnSd ( false , true ) ; org.ovirt.engine.core.compat.Guid diskId = createVmDiskOnSd ( true , true ) ; storageDomainVmDisks.add ( createVmDisk ( diskId , false ) ) ; org.junit.Assert.assertTrue ( discardHelper.vmDiskWithPassDiscardAndWadExists ( storageDomainDisks , storageDomainVmDisks ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }

Target:
public static void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void freeMacs ( java.util.List < java.lang.String > macs ) { for ( java.lang.String mac : macs ) { freeMac ( mac ) ; } }

Target:
public void freeMacs ( java.util.List < java.lang.String > macs ) { org.ovirt.engine.core.bll.MacPoolManager.log.info ( "MacPoolManager::freeMacs - entered" ) ; mLocObj.writeLock ( ) . lock ( ) ; try { if ( ! ( mInitialized ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } for ( java.lang.String mac : macs ) { internalFreeMac ( mac ) ; } } finally { mLocObj.writeLock ( ) . unlock ( ) ; } }
Source:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
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 hasMtuEntity = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; java.lang.Boolean hasMtuValue = ( ( java.lang.Boolean ) ( hasMtuEntity.getEntity ( ) ) ) ; getView ( ) . setMtuEnabled ( hasMtuValue ) ; if ( ! hasMtuValue ) { model.getMtu ( ) . setEntity ( null ) ; } }

Target:
public void init ( final T model ) { super . init ( model ) ; model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override 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.datacenters.NetworkModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "Message" . equals ( propertyName ) ) { getView ( ) . setMessageLabel ( model.getMessage ( ) ) ; } } } ) ; }
Source:
public boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }

Target:
public boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }
Source:
public void vdsGroupWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }

Target:
public void vdsGroupWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( EngineMessage.VDS_GROUP_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getGlusterVolumeProfilingStatistics ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , boolean nfs ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeProfileParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeProfileParameters ( clusterId , volumeId , nfs ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeProfileInfo , parameters , aQuery ) ; }
Source:
public void testListCrashClientLocale ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpHooksQueryExpectations ( t ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } }

Target:
public void testListFailure ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpHooksQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) ) ; }
Source:
public void testInterfaceByNameExistsWhenInterfaceIsNull ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( null ) . interfaceByNameExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }

Target:
public void testInterfaceExistsWhenInterfaceIsNull ( ) throws java.lang.Exception { java.lang.String failingSlaveName = "slaveName" ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_HAVING_NAME_DOES_NOT_EXIST ; java.lang.String nicNameReplacement = org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , failingSlaveName ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( null ) . interfaceExists ( failingSlaveName ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , nicNameReplacement ) ) ; }
Source:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.Permission > > aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public java.lang.String convertFieldEnumValueToActualValue ( java.lang.String fieldValue ) { for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > e : map.entrySet ( ) ) { if ( fieldValue.startsWith ( e.getValue ( ) ) ) { return e.getKey ( ) . toString ( ) ; } } return "" ; }

Target:
public java.lang.String convertFieldEnumValueToActualValue ( java.lang.String fieldValue ) { for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > e : map.entrySet ( ) ) { if ( fieldValue.toLowerCase ( ) . startsWith ( e.getValue ( ) ) ) { return e.getKey ( ) . toString ( ) ; } } return "" ; }
Source:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , bond.getName ( ) ) ) ; doTestValidModifiedBonds ( bond , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }

Target:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.CreateOrUpdateBond createOrUpdateBond = createNewCreateOrUpdateBondWithNameAndId ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , createOrUpdateBond.getName ( ) ) ) ; doTestValidModifiedBonds ( createOrUpdateBond , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }
Source:
public void testInvalidUpdateOfStatusRestrictedEditableFieldOnRunningHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic src = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; src.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatic dest = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; dest.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vdsHandler.isUpdateValid ( src , dest , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( "Update should not be valid for different cluster IDs on a running host" , updateIsValid ) ; }

Target:
public void testInvalidUpdateOfStatusRestrictedEditableFieldOnRunningHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic src = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; src.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatic dest = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; dest.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vdsHandler.isUpdateValid ( src , dest , VDSStatus.Up ) ; org.junit.jupiter.api.Assertions.assertFalse ( updateIsValid , "Update should not be valid for different cluster IDs on a running host" ) ; }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( getImagesActionType ( ) , buildModeOrCopyImageGroupParameters ( containerID , disk ) ) ; getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.CopyImageGroup , buildModeOrCopyImageGroupParameters ( containerID , disk ) ) ; getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return null ; }
Source:
public static < T extends org.ovirt.engine.core.common.businessentities.VmBase > void updateVmDevices ( T entity , org.ovirt.engine.core.compat.Guid newId ) { if ( entity != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateCdInVmDevice ( entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateBootOrderInVmDeviceAndStoreToDB ( entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateNumOfMonitorsInVmDevice ( null , entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateUSBSlots ( null , entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateMemoryBalloon ( null , entity , true ) ; } }

Target:
public static void addSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vmId ) , VmDeviceType.SMARTCARD , VmDeviceType.SMARTCARD , new org.ovirt.engine.core.bll.smartcard.SmartcardSpecParams ( ) , true , false ) ; }
Source:
void initialize ( ) { try { java.util.List < org.ovirt.engine.core.common.businessentities.MacPool > macPools = macPoolDao.getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : macPools ) { initializeMacPool ( macPool ) ; } org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.info ( "Successfully initialized" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.error ( "Error initializing: {}" , e.getMessage ( ) ) ; throw e ; } }

Target:
void initialize ( ) { try { java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPool > macPools = macPoolDao.getAll ( ) ; for ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool : macPools ) { initializeMacPool ( macPool ) ; } org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.log.info ( "Successfully initialized" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.log.error ( "Error initializing: {}" , e.getMessage ( ) ) ; throw e ; } }
Source:
private void updateVnicsFromParams ( final org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters ) { if ( ( parameters.size ( ) ) == 0 ) { callback.vnicCreated ( vmId ) ; return ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.UpdateVmInterface , parameters , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { callback.vnicCreated ( vmId ) ; } } , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RemoveVmInterface , removeVnicParameters , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { callback.vnicCreated ( vmId ) ; } } , this ) ; }
Source:
private void addInlineDisks ( org.ovirt.engine.api.model.VM vm ) { org.ovirt.engine.api.restapi.resource.BackendVmDisksResource disksResource = inject ( new org.ovirt.engine.api.restapi.resource.BackendVmDisksResource ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( vm.getId ( ) ) , org.ovirt.engine.core.common.queries.VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( vm.getId ( ) ) ) ) ) ; org.ovirt.engine.api.model.Disks disks = disksResource.list ( ) ; vm.setDisks ( disks ) ; }

Target:
private void addInlineDisks ( org.ovirt.engine.api.model.VM vm ) { org.ovirt.engine.api.restapi.resource.BackendVmDisksResource disksResource = inject ( new org.ovirt.engine.api.restapi.resource.BackendVmDisksResource ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( vm.getId ( ) ) , org.ovirt.engine.core.common.queries.VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( vm.getId ( ) ) ) ) ) ; org.ovirt.engine.api.model.Disks disks = disksResource.list ( ) ; vm.setDisks ( disks ) ; }
Source:
public void Provisioning_SelectedItemChanged ( ) { boolean provisioning = ( ( java.lang.Boolean ) ( getModel ( ) . getProvisioning ( ) . getEntity ( ) ) ) ; getModel ( ) . getProvisioningThin_IsSelected ( ) . setEntity ( ( ! provisioning ) ) ; getModel ( ) . getProvisioningClone_IsSelected ( ) . setEntity ( provisioning ) ; }

Target:
public void provisioning_SelectedItemChanged ( ) { boolean provisioning = ( ( java.lang.Boolean ) ( getModel ( ) . getProvisioning ( ) . getEntity ( ) ) ) ; getModel ( ) . getProvisioningThin_IsSelected ( ) . setEntity ( ( ! provisioning ) ) ; getModel ( ) . getProvisioningClone_IsSelected ( ) . setEntity ( provisioning ) ; }
Source:
private static int setCDBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( ( device.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK ) ) && ( device.getDevice ( ) . equals ( VmDeviceType.CDROM.getName ( ) ) ) ) { if ( device.getIsPlugged ( ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } break ; } } return bootOrder ; }

Target:
public static boolean isSound ( org.ovirt.engine.core.common.businessentities.VmDevice device ) { return ( device.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.SOUND ) ; }
Source:
private void handlePasswordGrantType ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.lang.String scope ) throws java.lang.Exception { if ( org.ovirt.engine.core.sso.utils.SSOUtils.scopeAsList ( scope ) . contains ( "ovirt-ext=token:login-on-behalf" ) ) { issueTokenForLoginOnBehalf ( request , response , scope ) ; } else { issueTokenForPasswd ( request , response , scope ) ; } }

Target:
private void handlePasswordGrantType ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.lang.String scope ) throws java.lang.Exception { if ( org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( scope ) . contains ( "ovirt-ext=token:login-on-behalf" ) ) { issueTokenForLoginOnBehalf ( request , response , scope ) ; } else { issueTokenForPasswd ( request , response , scope ) ; } }
Source:
public static void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableMACAntiSpoofingFilterRules ) ) { struct.put ( VdsProperties.NW_FILTER , NetworkFilters.NO_MAC_SPOOFING.getFilterName ( ) ) ; } }

Target:
public static void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.common.businessentities.network.VmNic vmNic ) { final org.ovirt.engine.core.common.businessentities.network.NetworkFilter networkFilter = org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.fetchVnicProfileNetworkFilter ( vmNic ) ; if ( networkFilter != null ) { final java.lang.String networkFilterName = networkFilter.getName ( ) ; struct.put ( VdsProperties.NW_FILTER , networkFilterName ) ; } }
Source:
protected void removeQuotaCommandLeftOver ( ) { if ( ! ( org.ovirt.engine.core.bll.AddVmCommand.isInternalExecution ( ) ) ) { org.ovirt.engine.core.bll.QuotaManager.removeMultiStorageDeltaQuotaCommand ( getQuotaConsumeMap ( diskInfoDestinationMap.values ( ) ) , org.ovirt.engine.core.bll.AddVmCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getCommandId ( ) ) ; } }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , ( ( org.ovirt.engine.core.bll.AddVmCommand.getVmName ( ) ) == null ? "" : org.ovirt.engine.core.bll.AddVmCommand.getVmName ( ) ) ) ; } return jobProperties ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Step model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; assertTrue ( model.isExternal ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Step model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.junit.Assert.assertTrue ( model.isExternal ( ) ) ; verifyLinks ( model ) ; }
Source:
public void qosCommitmentMissingBondSpeedMode6 ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmendMissingBondSpeed ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_MODE_6 ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
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.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void canDoActionCanNotFindTemplet ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionCanNotFindTemplate ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }

Target:
public void getClusterFeaturesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.network.macpoolmanager.Range getRangeWithAvailableMac ( ) { for ( org.ovirt.engine.core.bll.network.macpoolmanager.Range range : ranges ) { if ( ( range.getAvailableCount ( ) ) > 0 ) { return range ; } } return null ; }

Target:
private org.ovirt.engine.core.bll.network.macpoolmanager.Range findRangeWithAvailableMac ( int startIndex , int endIndex , int numberOfRanges ) { for ( int i = startIndex ; i < endIndex ; i ++ ) { org.ovirt.engine.core.bll.network.macpoolmanager.Range range = ranges.get ( i ) ; boolean hasAvailableMacs = ( range.getAvailableCount ( ) ) > 0 ; if ( hasAvailableMacs ) { startIndexForEmptyRangeSearch = ( i + 1 ) % numberOfRanges ; return range ; } } return null ; }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetTagsExpectations ( true ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachVmFromTag , org.ovirt.engine.core.common.action.AttachEntityToTagParameters.class , new java.lang.String [ ] { "TagId" , "EntitiesId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmTagResourceTest.TAG_ID , asList ( org.ovirt.engine.api.restapi.resource.BackendVmTagResourceTest.VM_ID ) } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetTagsExpectations ( true ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachVmFromTag , org.ovirt.engine.core.common.action.AttachEntityToTagParameters.class , new java.lang.String [ ] { "TagId" , "EntitiesId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmTagResourceTest.TAG_ID , asList ( org.ovirt.engine.api.restapi.resource.BackendVmTagResourceTest.VM_ID ) } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { copyVmDevices ( ) ; addDiskPermissions ( ) ; addVmPayload ( ) ; updateSmartCardDevices ( ) ; addVmWatchdog ( ) ; setActionReturnValue ( getVm ( ) . getId ( ) ) ; setSucceeded ( true ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { copyVmDevices ( ) ; addDiskPermissions ( ) ; if ( ( getInstanceType ( ) ) == null ) { addVmPayload ( ) ; updateSmartCardDevices ( ) ; addVmWatchdog ( ) ; } setActionReturnValue ( getVm ( ) . getId ( ) ) ; setSucceeded ( true ) ; return null ; }
Source:
protected void executeQueryCommand ( ) { final java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getParameters ( ) . getDomain ( ) ; final org.ovirt.engine.core.common.utils.ExternalId id = org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getParameters ( ) . getId ( ) ; final org.ovirt.engine.core.authentication.Directory directory = org.ovirt.engine.core.authentication.DirectoryManager.getInstance ( ) . getDirectory ( directoryName ) ; final org.ovirt.engine.core.authentication.DirectoryGroup group = directory.findGroup ( id ) ; org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getQueryReturnValue ( ) . setReturnValue ( group ) ; }

Target:
protected void executeQueryCommand ( ) { final java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getParameters ( ) . getDomain ( ) ; final org.ovirt.engine.core.common.utils.ExternalId id = org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getParameters ( ) . getId ( ) ; final org.ovirt.engine.core.authentication.Directory directory = org.ovirt.engine.core.authentication.DirectoryManager.getInstance ( ) . getDirectory ( directoryName ) ; if ( directory == null ) { org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; } else { final org.ovirt.engine.core.authentication.DirectoryGroup group = directory.findGroup ( id ) ; org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getQueryReturnValue ( ) . setReturnValue ( group ) ; } }
Source:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource onImport ( ) { return ImportSource.EXPORT_DOMAIN ; }

Target:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.storage_pool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }
Source:
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.hosts.HostSetupNetworksModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel ) ( sender ) ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networks = model.getNetworks ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel > nics = model.getNics ( ) ; updateNetworks ( networks ) ; updateNics ( nics ) ; rendered = true ; }

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.hosts.HostSetupNetworksModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel ) ( sender ) ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networks = model.getNetworks ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel > nics = model.getNics ( ) ; if ( ! ( keepStatusText ) ) { initStatusPanel ( ) ; } keepStatusText = false ; updateNetworks ( networks ) ; updateNics ( nics ) ; rendered = true ; }
Source:
public static < TSource > boolean All ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < TSource > predicate ) { for ( TSource item : source ) { if ( ! ( predicate.Match ( item ) ) ) { return false ; } } return true ; }

Target:
public static < TSource > boolean all ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < TSource > predicate ) { for ( TSource item : source ) { if ( ! ( predicate.match ( item ) ) ) { return false ; } } return true ; }
Source:
protected org.ovirt.engine.api.model.Disk getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DiskImage entity = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setvolume_format ( VolumeFormat.RAW ) ; entity.setDiskInterface ( DiskInterface.VirtIO ) ; entity.setimageStatus ( ImageStatus.OK ) ; entity.setvolume_type ( VolumeType.Sparse ) ; entity.setBoot ( false ) ; entity.setShareable ( false ) ; entity.setPropagateErrors ( PropagateErrors.On ) ; return org.ovirt.engine.api.restapi.resource.BackendStorageDomainDisksResourceTest.setUpStatisticalEntityExpectations ( entity ) ; }

Target:
protected org.ovirt.engine.api.model.Disk getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DiskImage entity = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setvolumeFormat ( VolumeFormat.RAW ) ; entity.setDiskInterface ( DiskInterface.VirtIO ) ; entity.setImageStatus ( ImageStatus.OK ) ; entity.setVolumeType ( VolumeType.Sparse ) ; entity.setBoot ( false ) ; entity.setShareable ( false ) ; entity.setPropagateErrors ( PropagateErrors.On ) ; return org.ovirt.engine.api.restapi.resource.BackendStorageDomainDisksResourceTest.setUpStatisticalEntityExpectations ( entity ) ; }
Source:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic , null ) ) ) ; }

Target:
public void getFreeVfNotSriovNic ( ) { commonIsSriovDevice ( false ) ; hostNicVfsConfigHelper.getFreeVf ( nic ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) 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.BackendNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
private boolean propertiesRequiringUnplugPlugWereUpdated ( ) { return ( ( ! ( oldIface.getType ( ) . equals ( getInterface ( ) . getType ( ) ) ) ) || ( ! ( oldIface.getMacAddress ( ) . equals ( getInterface ( ) . getMacAddress ( ) ) ) ) ) || ( ( oldIface.isPortMirroring ( ) ) != ( getInterface ( ) . isPortMirroring ( ) ) ) ; }

Target:
private boolean propertiesRequiringUnplugPlugWereUpdated ( ) { return ( ( ! ( oldIface.getType ( ) . equals ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.getInterface ( ) . getType ( ) ) ) ) || ( ! ( oldIface.getMacAddress ( ) . equals ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.getMacAddress ( ) ) ) ) ) || ( ( oldIface.isPortMirroring ( ) ) != ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.getInterface ( ) . isPortMirroring ( ) ) ) ; }
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 ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( alb , AuditLogType.FENCE_DISABLED_IN_CLUSTER_POLICY ) ; } }
Source:
protected org.ovirt.engine.core.compat.Guid removeConfImage ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { org.ovirt.engine.core.compat.Guid taskId2 = enclosingCommand.persistAsyncTaskPlaceHolder ( VmCommand.DELETE_SECONDARY_IMAGES_TASK_KEY ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DeleteImageGroup , buildDeleteMemoryConfParams ( guids ) ) ; if ( ! ( vdsRetValue.getSucceeded ( ) ) ) { return null ; } org.ovirt.engine.core.compat.Guid guid2 = enclosingCommand.createTask ( taskId2 , vdsRetValue.getCreationInfo ( ) , enclosingCommand.getActionType ( ) ) ; enclosingCommand.getTaskIdList ( ) . add ( guid2 ) ; return guid2 ; }

Target:
protected org.ovirt.engine.core.compat.Guid removeImage ( java.lang.String taskKey , org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters parameters ) { org.ovirt.engine.core.compat.Guid taskId2 = enclosingCommand.persistAsyncTaskPlaceHolder ( taskKey ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = removeImage ( parameters ) ; if ( vdsRetValue.getSucceeded ( ) ) { org.ovirt.engine.core.compat.Guid guid2 = enclosingCommand.createTask ( taskId2 , vdsRetValue.getCreationInfo ( ) , enclosingCommand.getActionType ( ) ) ; enclosingCommand.getTaskIdList ( ) . add ( guid2 ) ; return guid2 ; } return ( vdsRetValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.ImageDoesNotExistInDomainError ) ? org.ovirt.engine.core.compat.Guid.Empty : null ; }