auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.AllowDuplicateMacAddresses ) ; org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getMacPool ( ) ) ; if ( allowDupMacs || ( ! ( vmInterfaceManager.existsPluggedInterfaceWithSameMac ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_MAC_ADDRESS_IN_USE ) ; } }

Target:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.AllowDuplicateMacAddresses ) ; org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getMacPool ( ) ) ; if ( allowDupMacs || ( ! ( vmInterfaceManager.existsPluggedInterfaceWithSameMac ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_MAC_ADDRESS_IN_USE ) ; } }
Source:
public void testGetVolumesByStatusAndTypes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByStatusAndTypes ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , java.util.Collections.singletonList ( GlusterVolumeType.DISTRIBUTE ) ) ; org.junit.Assert.assertTrue ( ( volumes != null ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingDistVol ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : volumes ) { org.junit.Assert.assertTrue ( ( ( volume.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTE ) ) ) ; } }

Target:
public void testGetVolumesByStatusAndTypes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByStatusAndTypes ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , java.util.Collections.singletonList ( GlusterVolumeType.DISTRIBUTE ) ) ; org.junit.Assert.assertNotNull ( volumes ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingDistVol ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : volumes ) { org.junit.Assert.assertEquals ( GlusterVolumeType.DISTRIBUTE , volume.getVolumeType ( ) ) ; } }
Source:
void mockGetVdsCertificateSubjectByVmId ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue hostSubjectReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; hostSubjectReturnValue.setReturnValue ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.HOST_SUBJECT ) ; org.mockito.Mockito.doReturn ( hostSubjectReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetVdsCertificateSubjectByVmId ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
void mockGetVdsCertificateSubjectByVmId ( ) { org.ovirt.engine.core.common.queries.QueryReturnValue hostSubjectReturnValue = new org.ovirt.engine.core.common.queries.QueryReturnValue ( ) ; hostSubjectReturnValue.setReturnValue ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.HOST_SUBJECT ) ; org.mockito.Mockito.doReturn ( hostSubjectReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetVdsCertificateSubjectByVmId ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.Iterable listEnumerable = ( ( java.lang.Iterable ) ( source ) ) ; java.util.Iterator listIterator = listEnumerable.iterator ( ) ; while ( listIterator.hasNext ( ) ) { list.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.Disk ) ( listIterator.next ( ) ) ) ) ; } } return list ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.Iterable listEnumerable = ( ( java.lang.Iterable ) ( source ) ) ; java.util.Iterator listIterator = listEnumerable.iterator ( ) ; while ( listIterator.hasNext ( ) ) { list.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.Disk ) ( listIterator.next ( ) ) ) ) ; } } return list ; }
Source:
public static void getGlusterSwiftServerServices ( 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( 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 ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void initTable ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . enableColumnResizing ( ) ; addTypeColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addUserColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAuthzColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addNameSpaceColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRoleColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addCreationDateColum ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAddPermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRemovePermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; }

Target:
private void addTypeColumn ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( new org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn ( ) , org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants.empty ( ) , "30px" ) ; }
Source:
public void testValidModifiedBondsFailsWhenInsufficientNumberOfSlaves ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_BONDS_INVALID_SLAVE_COUNT_LIST , bond.getName ( ) ) ) , ValidationResult.VALID ) ; }

Target:
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 , ValidationResult.VALID , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }
Source:
public void testAddGroupUsingDomainFromGroupName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ( ( "ADGROUP@" + ( DOMAIN ) ) + ": name=*" ) , SearchType.AdGroup , getAdGroupWithDomain ( 0 ) ) ; setUpCreationExpectations ( VdcActionType.AddUser , org.ovirt.engine.core.common.action.AddUserParameters.class , new java.lang.String [ ] { "AdGroup.id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true , null , VdcQueryType.GetAdGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.Group model = new org.ovirt.engine.api.model.Group ( ) ; model.setName ( ( ( ( DOMAIN ) + "/" ) + ( NAMES [ 0 ] ) ) ) ; javax.ws.rs.core.Response response = collection.add ( model ) ; assertEquals ( 201 , response.getStatus ( ) ) ; assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.Group ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.Group ) ( response.getEntity ( ) ) ) , 0 ) ; }

Target:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveGroup , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static void GetClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }

Target:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.Map < java.lang.String , java.lang.String > > aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
protected void endExecutionMonitoring ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean runAndPausedSucceeded = ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAndPause ( ) ) ) && ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; executionHandler.endJob ( executionContext , runAndPausedSucceeded ) ; }

Target:
protected void endExecutionMonitoring ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean runAndPausedSucceeded = ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAndPause ( ) ) ) && ( ( vmDynamicDao.get ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; executionHandler.endJob ( executionContext , runAndPausedSucceeded ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void connect ( ) { boolean sslTarget = ( ( securePort ) == ( - 1 ) ) ? false : true ; org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.SpiceHtml5Impl.CLIENT_PAGE , config , getHost ( ) , java.lang.String.valueOf ( ( sslTarget ? securePort : port ) ) , getPassword ( ) , sslTarget ) ; invoker.invokeClient ( ) ; }

Target:
public void connect ( ) { boolean sslTarget = ( ( consoleOptions.getSecurePort ( ) ) == ( - 1 ) ) ? false : true ; org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.SpiceHtml5Impl.CLIENT_PAGE , config , getHost ( ) , java.lang.String.valueOf ( ( sslTarget ? consoleOptions.getSecurePort ( ) : consoleOptions.getPort ( ) ) ) , getPassword ( ) , sslTarget ) ; invoker.invokeClient ( ) ; }
Source:
protected void build ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VmBase vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > defaultHosts = model.getDefaultHost ( ) . getSelectedItems ( ) ; if ( model.getIsAutoAssign ( ) . getEntity ( ) ) { vm.setDedicatedVmForVdsList ( java.util.Collections.emptyList ( ) ) ; } else { java.util.List < org.ovirt.engine.core.compat.Guid > defaultHostsGuids = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : defaultHosts ) { defaultHostsGuids.add ( host.getId ( ) ) ; } vm.setDedicatedVmForVdsList ( defaultHostsGuids ) ; } }

Target:
protected void build ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VmBase vm ) { if ( model.getIsAutoAssign ( ) . getEntity ( ) ) { vm.setDedicatedVmForVdsList ( java.util.Collections.emptyList ( ) ) ; } else { java.util.List < org.ovirt.engine.core.compat.Guid > defaultHostsGuids = model.getDefaultHost ( ) . getSelectedItems ( ) . stream ( ) . map ( VDS :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ; vm.setDedicatedVmForVdsList ( defaultHostsGuids ) ; } }
Source:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( java.lang.Boolean.TRUE ) ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ! ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_FAILURE ; } if ( ( isFirstTaskHandler ( ) ) && ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK ; } break ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ! ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK_FINISHED_FAILURE ; } if ( ( isFirstTaskHandler ( ) ) && ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK ; } break ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }
Source:
public void testCanEditARunningVM ( ) { prepareVmToPassCanDoAction ( ) ; vm.setStatus ( VMStatus.Up ) ; mockDiskDaoGetAllForVm ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.storage.Disk > emptyList ( ) , true ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areUpdatedFieldsLegal ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testCanEditARunningVM ( ) { prepareVmToPassValidate ( ) ; vm.setStatus ( VMStatus.Up ) ; mockDiskDaoGetAllForVm ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.storage.Disk > emptyList ( ) , true ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areUpdatedFieldsLegal ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public boolean isVisible ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getDetailModel ( ) . getEntity ( ) ) ) . getstorage_domain_type ( ) ; return ( ! ( storageDomainType.equals ( StorageDomainType.ISO ) ) ) && ( ! ( storageDomainType.equals ( StorageDomainType.ImportExport ) ) ) ; }

Target:
public boolean isVisible ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getDetailModel ( ) . getEntity ( ) ) ) . getStorageDomainType ( ) ; return ( ! ( storageDomainType.equals ( StorageDomainType.ISO ) ) ) && ( ! ( storageDomainType.equals ( StorageDomainType.ImportExport ) ) ) ; }
Source:
public void bondWithNoNetowrkAttached ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifacesToBond = createBondSlaves ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; validateAndExpectNoViolations ( helper ) ; assertBondModified ( helper , bond ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }

Target:
public void bondWithNetworkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , "net" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = createNics ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , ifaces ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; ifaces.add ( bond ) ; parameters.setInterfaces ( ifaces ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }
Source:
public java.lang.Void runInTransaction ( ) { map.setstatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; if ( ( getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { map.setstatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; if ( ( getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } return null ; }
Source:
public void testNonSecuredEventMailSender ( ) { org.ovirt.engine.core.common.businessentities.event_audit_log_subscriber eventData = new org.ovirt.engine.core.common.businessentities.event_audit_log_subscriber ( ) ; eventData.setlog_time ( new java.util.Date ( ) ) ; eventData.setevent_type ( 0 ) ; eventData.setuser_name ( "a test user name" ) ; eventData.setvm_name ( "a fine test VM" ) ; eventData.setvds_name ( "a fine test host" ) ; eventData.setmethod_address ( "mailtest.redhat@gmail.com" ) ; eventData.setvm_template_name ( "a test template" ) ; eventData.setstorage_pool_name ( "a test storage pool name" ) ; eventData.setstorage_domain_name ( "a test storage pool domain" ) ; eventData.setseverity ( 3 ) ; org.ovirt.engine.core.notifier.utils.sender.mail.EventSenderMailImpl mailSender = new org.ovirt.engine.core.notifier.utils.sender.mail.EventSenderMailImpl ( org.ovirt.engine.core.notifier.utils.mail.MailSenderTest.getMailProperties ( ) ) ; eventData.setmessage ( "a test message to be sent via non-secured mode" ) ; org.ovirt.engine.core.notifier.utils.sender.EventSenderResult sentResult = null ; try { sentResult = mailSender.send ( eventData , null ) ; } catch ( java.lang.Exception e ) { sentResult = new org.ovirt.engine.core.notifier.utils.sender.EventSenderResult ( ) ; sentResult.setSent ( false ) ; } org.junit.Assert.assertTrue ( sentResult.isSent ( ) ) ; }

Target:
public void testNonSecuredEventMailSender ( ) { org.ovirt.engine.core.common.businessentities.EventAuditLogSubscriber eventData = new org.ovirt.engine.core.common.businessentities.EventAuditLogSubscriber ( ) ; eventData.setlog_time ( new java.util.Date ( ) ) ; eventData.setevent_type ( 0 ) ; eventData.setuser_name ( "a test user name" ) ; eventData.setvm_name ( "a fine test VM" ) ; eventData.setvds_name ( "a fine test host" ) ; eventData.setmethod_address ( "mailtest.redhat@gmail.com" ) ; eventData.setvm_template_name ( "a test template" ) ; eventData.setstorage_pool_name ( "a test storage pool name" ) ; eventData.setstorage_domain_name ( "a test storage pool domain" ) ; eventData.setseverity ( 3 ) ; org.ovirt.engine.core.notifier.utils.sender.mail.EventSenderMailImpl mailSender = new org.ovirt.engine.core.notifier.utils.sender.mail.EventSenderMailImpl ( org.ovirt.engine.core.notifier.utils.mail.MailSenderTest.getMailProperties ( ) ) ; eventData.setmessage ( "a test message to be sent via non-secured mode" ) ; org.ovirt.engine.core.notifier.utils.sender.EventSenderResult sentResult = null ; try { sentResult = mailSender.send ( eventData , null ) ; } catch ( java.lang.Exception e ) { sentResult = new org.ovirt.engine.core.notifier.utils.sender.EventSenderResult ( ) ; sentResult.setSent ( false ) ; } org.junit.Assert.assertTrue ( sentResult.isSent ( ) ) ; }
Source:
public void runFailedAutoStartVM ( org.ovirt.engine.core.compat.Guid vmId ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVmId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_FAILED ) ; org.ovirt.engine.core.bll.VdsEventListener.log.infoFormat ( "Highly Available VM went down. Attempting to restart. VM Name: {0}, VM Id:{1}" , event.getVmName ( ) , vmId ) ; final org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RunVm , new org.ovirt.engine.core.common.action.RunVmParams ( vmId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_RESTART_FAILED ) ; } }

Target:
public void runFailedAutoStartVM ( org.ovirt.engine.core.compat.Guid vmId ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVmId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_FAILED ) ; org.ovirt.engine.core.bll.VdsEventListener.log.infoFormat ( "Highly Available VM went down. Attempting to restart. VM Name: {0}, VM Id:{1}" , event.getVmName ( ) , vmId ) ; org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmToRun ( vmId ) ; }
Source:
private void initializeOsRepository ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface ) { java.util.ArrayList < java.lang.String > supportedDiskInterfaces = new java.util.ArrayList < > ( ) ; supportedDiskInterfaces.add ( diskInterface.name ( ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidatorTest.OS_WITH_SUPPORTED_INTERFACES , null ) ) . thenReturn ( supportedDiskInterfaces ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }

Target:
public void diskImageWithSgio ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidatorTest.createVM ( org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidatorTest.OS_WITH_NO_SUPPORTED_INTERFACES ) ; dve.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setSgio ( ScsiGenericIO.UNFILTERED ) ; org.junit.Assert.assertThat ( validator.isVirtIoScsiValid ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.SCSI_GENERIC_IO_IS_NOT_SUPPORTED_FOR_IMAGE_DISK ) ) ; }
Source:
public void shouldDetectSufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 2000 ) ; assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 0 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }
Source:
private void Spice_Disconnected ( java.lang.Object sender , org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs e ) { getspice ( ) . getDisconnectedEvent ( ) . removeListener ( this ) ; getspice ( ) . getMenuItemSelectedEvent ( ) . removeListener ( this ) ; setIsConnected ( false ) ; UpdateActionAvailability ( ) ; if ( ( e.getErrorCode ( ) ) > 100 ) { getErrorEvent ( ) . raise ( this , e ) ; } }

Target:
protected void updateActionAvailability ( ) { super . updateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ! ( getIsConnected ( ) ) ) && ( ( getEntity ( ) ) != null ) ) && ( ( getEntity ( ) . getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) && ( isVmConnectReady ( ) ) ) ) ; }
Source:
public void appendCustomValueAppend ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = "_" ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }

Target:
public void appendCustomValueAppend ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = "_" ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.jupiter.api.Assertions.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }
Source:
public static void IsTemplateNameUnique ( 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.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmTemlateWithSameNameExistParameters ( name ) , aQuery ) ; }

Target:
public static void GetSANWipeAfterDelete ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbUser > searchDbUsers ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getDbUserDao ( ) , true ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > searchVDSsByDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data = genericSearch ( vdsDao , true ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( cpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } return data ; }
Source:
private void generateMethodInterface ( org.ovirt.api.metamodel.concepts.Method method ) { org.ovirt.api.metamodel.concepts.Name name = method.getName ( ) ; generateRequestInterface ( method ) ; generateResponseInterface ( method ) ; generateDoc ( method ) ; java.lang.String request = getRequestName ( method ) ; java.lang.String member = javaNames.getJavaMemberStyleName ( name ) ; javaBuffer.addLine ( "%1$s %2$s();" , request , member ) ; javaBuffer.addLine ( ) ; }

Target:
private void generateMethodInterface ( org.ovirt.api.metamodel.concepts.Method method ) { if ( ( method.getBase ( ) ) != null ) { return ; } org.ovirt.api.metamodel.concepts.Name name = method.getName ( ) ; generateRequestInterface ( method ) ; generateResponseInterface ( method ) ; generateDoc ( method ) ; java.lang.String request = getRequestName ( method ) ; java.lang.String member = javaNames.getJavaMemberStyleName ( name ) ; javaBuffer.addLine ( "%1$s %2$s();" , request , member ) ; javaBuffer.addLine ( ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getQuotaId ( ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) ) != null ) && ( isQuotaValidationNeeded ( ) ) ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getQuotaId ( ) ; } return null ; }

Target:
private org.ovirt.engine.core.compat.Guid getQuotaId ( ) { if ( ( ( newDisk ) != null ) && ( isQuotaValidationNeeded ( ) ) ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( newDisk ) ) . getQuotaId ( ) ; } return null ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getStorageTypeList ( ) ) ) ) { storageType_SelectedItemChanged ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getStoragePoolType ( ) ) ) ) { storagePoolType_SelectedItemChanged ( ) ; } }
Source:
public static void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static java.lang.Boolean isMigrationSupported ( org.ovirt.engine.core.common.businessentities.ArchitectureType architecture , org.ovirt.engine.core.compat.Version version ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.migrationSupport.get ( architecture ) . get ( version ) ; }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }
Source:
public void externalNetworkVmNetworkChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = mockExternalNetwork ( ) ; boolean vmNetwork = true ; org.mockito.Mockito.when ( externalNetwork.isVmNetwork ( ) ) . thenReturn ( vmNetwork ) ; org.mockito.Mockito.when ( network.isVmNetwork ( ) ) . thenReturn ( ( ! vmNetwork ) ) ; assertThatExternalNetworkDetailsUnchangedFails ( externalNetwork ) ; }

Target:
public void internalNetworkProvidedByChanged ( ) { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = createExternalNetwork ( ) ; network.setProvidedBy ( null ) ; assertThatExternalNetworkDetailsUnchangedFails ( externalNetwork ) ; }
Source:
public void InitCdImage ( ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( vm.getIsoPath ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getIsoPath ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; UpdateCdImage ( ) ; }

Target:
public void defaultHost_SelectedItemChanged ( ) { updateCdImage ( ) ; }
Source:
public static boolean getHugepagesShared ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.common.utils.customprop.SimpleCustomPropertiesUtil util = org.ovirt.engine.core.common.utils.customprop.SimpleCustomPropertiesUtil.getInstance ( ) ; java.util.Map < java.lang.String , java.lang.String > customProperties = util.convertProperties ( vm.getCustomProperties ( ) ) ; return java.lang.Boolean.parseBoolean ( customProperties.get ( "hugepages_shared" ) ) ; }

Target:
public static boolean isHugepagesShared ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.common.utils.customprop.SimpleCustomPropertiesUtil util = org.ovirt.engine.core.common.utils.customprop.SimpleCustomPropertiesUtil.getInstance ( ) ; java.util.Map < java.lang.String , java.lang.String > customProperties = util.convertProperties ( vm.getCustomProperties ( ) ) ; return java.lang.Boolean.parseBoolean ( customProperties.get ( "hugepages_shared" ) ) ; }
Source:
public void setup ( ) { map = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainCommand ( params , org.ovirt.engine.core.bll.context.CommandContext.createContext ( params.getSessionId ( ) ) ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( eventQueue ) . when ( cmd ) . getEventQueue ( ) ; }

Target:
public void setup ( ) { map = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainCommand ( params , org.ovirt.engine.core.bll.context.CommandContext.createContext ( params.getSessionId ( ) ) ) ) ; cmd.init ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( eventQueue ) . when ( cmd ) . getEventQueue ( ) ; }
Source:
protected void OnSelectedItemChanged ( ) { super . OnSelectedItemChanged ( ) ; UpdateActionAvailability ( ) ; if ( ( getSelectedItem ( ) ) != null ) { getNavigatedEvent ( ) . raise ( this , new org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkEventArgs ( ( ( org.ovirt.engine.core.common.businessentities.Bookmark ) ( getSelectedItem ( ) ) ) ) ) ; } }

Target:
protected void OnSelectedItemChanged ( ) { super . OnSelectedItemChanged ( ) ; UpdateActionAvailability ( ) ; if ( ( ( getSelectedItem ( ) ) != null ) && ( ! ( getIsBookmarkInitiated ( ) ) ) ) { setIsBookmarkInitiated ( true ) ; getNavigatedEvent ( ) . raise ( this , new org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkEventArgs ( ( ( org.ovirt.engine.core.common.businessentities.Bookmark ) ( getSelectedItem ( ) ) ) ) ) ; setIsBookmarkInitiated ( false ) ; } }
Source:
public static void GetDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void IsUSBEnabledByDefault ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Network incoming , org.ovirt.engine.api.model.Network entity ) { org.ovirt.engine.api.model.Network updated = this . map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , updated ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Network incoming , org.ovirt.engine.api.model.Network entity ) { org.ovirt.engine.api.model.Network updated = getMapper ( modelType , org.ovirt.engine.api.model.Network.class ) . map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , updated ) ; }
Source:
private void updateDisplayProtocols ( ) { boolean isVncSelected = ( vm.getDefaultDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.vga ) ; getDisplayConsole_Vnc_IsSelected ( ) . setEntity ( isVncSelected ) ; getDisplayConsole_Spice_IsSelected ( ) . setEntity ( ( ! isVncSelected ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { java.util.Set < java.lang.String > emulatedSet = new java.util.TreeSet < java.lang.String > ( ( ( java.util.HashSet < java.lang.String > ) ( returnValue ) ) ) ; java.lang.String oldVal = getEmulatedMachine ( ) . getSelectedItem ( ) ; getEmulatedMachine ( ) . setItems ( emulatedSet ) ; getEmulatedMachine ( ) . setSelectedItem ( oldVal ) ; convertEmulatedMachineField ( ) ; } }