auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void StyleTextBoxEditor ( org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxOnlyEditor editor , org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { if ( ! ( model.getIsChangable ( ) ) ) { editor.setEnabled ( true ) ; com.google.gwt.user.client.ui.ValueBox < java.lang.String > valueBox = editor.asValueBox ( ) ; valueBox.setReadOnly ( true ) ; valueBox.getElement ( ) . getStyle ( ) . setBorderWidth ( 0 , Style.Unit.PX ) ; } editor.asValueBox ( ) . setTitle ( model.getTitle ( ) ) ; }

Target:
void addStyles ( ) { pathEditor.addContentWidgetContainerStyleName ( style.pathEditorContent ( ) ) ; vfsTypeEditor.addContentWidgetContainerStyleName ( style.vfsTypeTextBoxEditor ( ) ) ; mountOptionsEditor.addContentWidgetContainerStyleName ( style.mountOptionsTextBoxEditor ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createHibernationMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.bll.utils.VmOverheadCalculator vmOverheadCalculator ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryDisk ( vm , storageType , vmOverheadCalculator ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.generateHibernationMemoryDiskAlias ( vm.getName ( ) ) ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_HIBERNATION_MEMORY_DISK_DESCRIPTION ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createHibernationMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.scheduling.VmOverheadCalculator vmOverheadCalculator ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryDisk ( vm , storageType , vmOverheadCalculator , null ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.generateHibernationMemoryDiskAlias ( vm.getName ( ) ) ) ; image.setDiskDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_HIBERNATION_MEMORY_DISK_DESCRIPTION ) ; return image ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.permissions > getTreeForEntity ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.VdcObjectType type , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "object_type_id" , type.getValue ( ) ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsTreeByEntityId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.permissions > getTreeForEntity ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.VdcObjectType type , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered , int appMode ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "object_type_id" , type.getValue ( ) ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsTreeByEntityId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.NetworkInterface findInterfaceNetworkNameNotEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > items ) { for ( org.ovirt.engine.core.common.businessentities.network.NetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { return i ; } } return null ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.DbUser source ) { return ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( source.getDomain ( ) , target.getDomain ( ) ) ) && ( ( ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( target.getLoginName ( ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( target.getLoginName ( ) , "*" ) ) ) || ( source.getLoginName ( ) . toLowerCase ( ) . startsWith ( target.getLoginName ( ) ) ) ) ; }
Source:
protected void doNonBlockingAction ( final org.ovirt.engine.core.common.action.VdcActionType task , final org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.core.common.interfaces.BackendLocal backend = getBackend ( ) ; setCorrelationId ( params ) ; setJobOrStepId ( params ) ; backend.runAction ( VdcActionType.RunAsyncAction , sessionize ( new org.ovirt.engine.core.common.action.RunAsyncActionParameters ( task , sessionize ( params ) ) ) ) ; }

Target:
protected void doNonBlockingAction ( final org.ovirt.engine.core.common.action.ActionType task , final org.ovirt.engine.core.common.action.ActionParametersBase params ) { org.ovirt.engine.core.common.interfaces.BackendLocal backend = getBackend ( ) ; setCorrelationId ( params ) ; setJobOrStepId ( params ) ; backend.runAction ( ActionType.RunAsyncAction , sessionize ( new org.ovirt.engine.core.common.action.RunAsyncActionParameters ( task , sessionize ( params ) ) ) ) ; }
Source:
public void getClustersHavingHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getClustersHavingHosts ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.SortListByNameConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters getActionParameters ( org.ovirt.engine.api.model.Network network , org.ovirt.engine.api.model.Network entity ) { if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) . getValue ( ) , entity ) ; }

Target:
protected org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters getActionParameters ( org.ovirt.engine.api.model.Network network , org.ovirt.engine.api.model.Network entity ) { if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , entity ) ; if ( ( network != null ) && ( network.isSetProfileRequired ( ) ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return parameters ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.compat.Version > ( ) ; } else { java.util.ArrayList < org.ovirt.engine.core.compat.Version > list = ( ( java.util.ArrayList < org.ovirt.engine.core.compat.Version > ) ( source ) ) ; java.util.Collections.sort ( list ) ; return list ; } }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.compat.Version > ( ) ; } else { java.util.ArrayList < org.ovirt.engine.core.compat.Version > list = ( ( java.util.ArrayList < org.ovirt.engine.core.compat.Version > ) ( source ) ) ; java.util.Collections.sort ( list ) ; return list ; } }
Source:
private void loadVmPayload ( org.ovirt.engine.core.common.action.AddVmParameters addVmParams ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmTemplateId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) { addVmParams.setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ) ; return ; } } }

Target:
private boolean deviceExists ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType generalType ) { return ! ( vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmTemplateId ( ) , generalType ) . isEmpty ( ) ) ; }
Source:
private void doDrag ( com.google.gwt.event.dom.client.DragDropEventBase < ? > event , boolean isDrop ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel setupModel = nicModel.getSetupModel ( ) ; java.lang.String data = event.getData ( NetworkItemPanel.SETUP_NETWORKS_DATA ) ; if ( data != null ) { if ( setupModel.candidateOperation ( data , nicModel.getName ( ) , isDrop ) ) { table.getElement ( ) . addClassName ( style.networkGroupDragOver ( ) ) ; event.preventDefault ( ) ; } } }

Target:
private void doDrag ( com.google.gwt.event.dom.client.DragDropEventBase < ? > event , boolean isDrop ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel setupModel = nicModel.getSetupModel ( ) ; java.lang.String data = event.getData ( NetworkItemPanel.SETUP_NETWORKS_DATA ) ; java.lang.String type = event.getData ( NetworkItemPanel.SETUP_NETWORKS_TYPE ) ; if ( data != null ) { if ( setupModel.candidateOperation ( data , type , nicModel.getName ( ) , HostSetupNetworksModel.NIC , isDrop ) ) { table.getElement ( ) . addClassName ( style.networkGroupDragOver ( ) ) ; event.preventDefault ( ) ; } } }
Source:
public void setup ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.AddNetworkValidator ( network ) ) ; org.mockito.Mockito.doReturn ( dbFacade ) . when ( validator ) . getDbFacade ( ) ; org.mockito.Mockito.when ( dbFacade.getNetworkDao ( ) ) . thenReturn ( networkDao ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }

Target:
public void setup ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.AddNetworkValidator ( vmDao , network ) ) ; org.mockito.Mockito.doReturn ( dbFacade ) . when ( validator ) . getDbFacade ( ) ; org.mockito.Mockito.when ( dbFacade.getNetworkDao ( ) ) . thenReturn ( networkDao ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }
Source:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeDate ( this . history_datetime , dos ) ; dos.writeObject ( this . vm_id ) ; writeString ( this . disks_usage , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtodaily_3_5.AggregationToDaily.row15Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToDaily ) { try { int length = 0 ; this . history_datetime = readDate ( dis ) ; this . vm_id = ( ( java.lang.Object ) ( dis.readObject ( ) ) ) ; this . disks_usage = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } catch ( java.lang.ClassNotFoundException eCNFE ) { throw new java.lang.RuntimeException ( eCNFE ) ; } } }
Source:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) , org.hamcrest.CoreMatchers.hasItem ( UPGRADE_ERROR.VM_NUMA_PINNED ) ) ; }

Target:
public void shouldDetectCpuPinning ( ) { invalidVM.setCpuPinning ( "i am pinned" ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( UpgradeError.VM_CPUS_PINNED ) ; }
Source:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getstatus ( ) ; if ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( org.ovirt.engine.core.common.businessentities.VM.isGuestUp ( runningVm.getstatus ( ) ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setmigrating_to_vds ( null ) ; } }

Target:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; if ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( org.ovirt.engine.core.common.businessentities.VM.isGuestUp ( runningVm.getstatus ( ) ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; vmListModel1.Cancel ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.cancel ( ) ; } }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { return validateCoherentIdentification ( attachment.getId ( ) , attachment.getNicId ( ) , attachment.getNicName ( ) , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NICS_INCOHERENTLY , existingInterfacesMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( bond.getName ( ) , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
private boolean isQuotaValidationNeeded ( ) { return ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( oldDisk.getDiskStorageType ( ) ) ; }

Target:
private boolean isQuotaValidationNeeded ( ) { return ( ( ( ( ( oldDisk ) != null ) && ( ( newDisk ) != null ) ) && ( ( oldDisk ) instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) ) && ( ( newDisk ) instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) ) && ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( oldDisk.getDiskStorageType ( ) ) ) ; }
Source:
public void canDoActionFailsOnNullDiskInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setvolume_format ( VolumeFormat.COW ) ; image.setvolume_type ( VolumeType.Preallocated ) ; org.ovirt.engine.core.common.action.AddDiskParameters params = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , image ) ; initializeCommand ( storageId , params ) ; org.junit.Assert.assertFalse ( command.validateInputs ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( "VALIDATION.DISK_INTERFACE.NOT_NULL" ) ) ; }

Target:
public void canDoActionFailsOnNullDiskInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setVolumeType ( VolumeType.Preallocated ) ; org.ovirt.engine.core.common.action.AddDiskParameters params = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , image ) ; initializeCommand ( storageId , params ) ; org.junit.Assert.assertFalse ( command.validateInputs ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( "VALIDATION.DISK_INTERFACE.NOT_NULL" ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage_domains getNewMaster ( ) { if ( ( ( _newMaster ) == null ) && ( _newMasterStorageDomainId.equals ( Guid.Empty ) ) ) { _newMaster = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.electNewMaster ( ) ; } else if ( ( _newMaster ) == null ) { _newMaster = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getStorageDomainDAO ( ) . get ( _newMasterStorageDomainId ) ; } return _newMaster ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage_domains getNewMaster ( boolean duringReconstruct ) { if ( ( ( _newMaster ) == null ) && ( Guid.Empty.equals ( _newMasterStorageDomainId ) ) ) { _newMaster = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.electNewMaster ( duringReconstruct ) ; } else if ( ( _newMaster ) == null ) { _newMaster = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getStorageDomainDAO ( ) . get ( _newMasterStorageDomainId ) ; } return _newMaster ; }
Source:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected void testRange ( java.lang.String start , java.lang.String end , long expectedStart , long expectedEnd ) { final java.util.Collection < org.apache.commons.lang.math.LongRange > ranges = org.ovirt.engine.core.utils.MacAddressRangeUtils.parseRangeString ( ( ( start + '-' ) + end ) ) ; final org.apache.commons.lang.math.LongRange firstRange = ranges.iterator ( ) . next ( ) ; org.junit.Assert.assertThat ( firstRange.getMinimumLong ( ) , org.hamcrest.CoreMatchers.equalTo ( expectedStart ) ) ; org.junit.Assert.assertThat ( firstRange.getMaximumLong ( ) , org.hamcrest.CoreMatchers.equalTo ( expectedEnd ) ) ; }

Target:
protected void testRange ( java.lang.String start , java.lang.String end , long expectedStart , long expectedEnd ) { final java.util.Collection < org.apache.commons.lang.math.LongRange > ranges = org.ovirt.engine.core.utils.MacAddressRangeUtils.parseRangeString ( ( ( start + '-' ) + end ) ) ; final org.apache.commons.lang.math.LongRange firstRange = ranges.iterator ( ) . next ( ) ; org.hamcrest.MatcherAssert.assertThat ( firstRange.getMinimumLong ( ) , org.hamcrest.CoreMatchers.equalTo ( expectedStart ) ) ; org.hamcrest.MatcherAssert.assertThat ( firstRange.getMaximumLong ( ) , org.hamcrest.CoreMatchers.equalTo ( expectedEnd ) ) ; }
Source:
public void validateMultiDisksWithNotEnoughSpaceOnDomains ( ) { mcr.mockConfigValue ( ConfigValues.FreeSpaceCriticalLowInGB , 95 ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW.toString ( ) ) ) ; }

Target:
public void validateMultiDisksWithNotEnoughSpaceOnDomains ( ) { mcr.mockConfigValue ( ConfigValues.FreeSpaceCriticalLowInGB , 95 ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
protected void extractBond ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > bonds , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String name ) { if ( org.apache.commons.lang.StringUtils.isBlank ( iface.getNetworkName ( ) ) ) { violations.add ( VdcBllMessages.NETWROK_NOT_EXISTS ) ; } else { if ( bonds.containsKey ( name ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { bonds.put ( name , iface ) ; } } }

Target:
protected void extractBond ( java.util.Set < java.lang.String > bonds , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String name ) { if ( org.apache.commons.lang.StringUtils.isBlank ( iface.getNetworkName ( ) ) ) { violations.add ( VdcBllMessages.NETWROK_NOT_EXISTS ) ; } else { if ( bonds.contains ( name ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { bonds.add ( name ) ; modifiedBonds.put ( name , iface ) ; } } }
Source:
private void updateCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = commandsRepository.getCommandEntity ( command.getCommandId ( ) ) ; cmdEntity.setReturnValue ( result ) ; if ( ! ( result.isValid ( ) ) ) { cmdEntity.setCommandStatus ( CommandStatus.FAILED ) ; } commandsRepository.persistCommand ( cmdEntity ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( org.ovirt.engine.core.bll.tasks.CommandExecutor.log ) . runAction ( command , ( cmdContext != null ? cmdContext.getExecutionContext ( ) : null ) ) ; updateCommandResult ( command.getCommandId ( ) , result ) ; return result ; }
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.FENCING_DISABLED_IN_CLUSTER_POLICY ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String userName , java.lang.String remoteGroupName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepMountBrokerSetup" ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . withOptionalParameter ( "remoteGroupName" , remoteGroupName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String userName , java.lang.String remoteGroupName , java.lang.Boolean partial ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepMountBrokerSetup" ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withParameter ( "partial" , partial ) . withOptionalParameter ( "remoteUserName" , userName ) . withOptionalParameter ( "remoteGroupName" , remoteGroupName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public org.ovirt.engine.sdk.decorators.HostNICStatistics getStatistics ( ) { if ( ( this . hostNICStatistics ) == null ) { synchronized ( this . LOCK ) { if ( ( this . hostNICStatistics ) == null ) { this . hostNICStatistics = new org.ovirt.engine.sdk.decorators.HostNICStatistics ( proxy , this ) ; } } } return hostNICStatistics ; }

Target:
public org.ovirt.engine.sdk.decorators.HostHostNicStatistics getStatistics ( ) { if ( ( this . hostHostNicStatistics ) == null ) { synchronized ( this . LOCK ) { if ( ( this . hostHostNicStatistics ) == null ) { this . hostHostNicStatistics = new org.ovirt.engine.sdk.decorators.HostHostNicStatistics ( proxy , this ) ; } } } return hostHostNicStatistics ; }
Source:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.irsbroker.ExtendStorageDomainVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case DeviceNotFound : org.ovirt.engine.core.vdsbroker.irsbroker.ExtendStorageDomainVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.irsbroker.ExtendStorageDomainVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case DeviceNotFound : org.ovirt.engine.core.vdsbroker.irsbroker.ExtendStorageDomainVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskOfType ( glusterVolume , GlusterTaskType.REBALANCE ) ) ) || ( ! ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskStatus ( glusterVolume , JobExecutionStatus.STARTED ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( getGlusterTaskUtils ( ) . isTaskOfType ( glusterVolume , GlusterTaskType.REBALANCE ) ) ) || ( ! ( getGlusterTaskUtils ( ) . isTaskStatus ( glusterVolume , JobExecutionStatus.STARTED ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED ) ; } return true ; }
Source:
protected void updateActionAvailability ( ) { super . updateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ! ( getIsConnected ( ) ) ) && ( ( getEntity ( ) ) != null ) ) && ( ( getEntity ( ) . getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) && ( isVmConnectReady ( ) ) ) ) ; }

Target:
public boolean canBeSelected ( ) { org.ovirt.engine.core.common.businessentities.DisplayType displayType = ( ( getEntity ( ) . getDisplayType ( ) ) != null ) ? getEntity ( ) . getDisplayType ( ) : getEntity ( ) . getDefaultDisplayType ( ) ; boolean hasVmSpiceSupport = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.hasSpiceSupport ( getEntity ( ) . getOs ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ; return ( displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) && hasVmSpiceSupport ; }
Source:
private static void initStaticMocks ( ) { org.powermock.api.mockito.PowerMockito.mockStatic ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) ; org.powermock.api.mockito.PowerMockito.mockStatic ( org.ovirt.engine.core.common.config.Config.class ) ; org.powermock.api.mockito.PowerMockito.mockStatic ( org.ovirt.engine.core.utils.transaction.TransactionSupport.class ) ; org.powermock.api.mockito.PowerMockito.mockStatic ( org.ovirt.engine.core.utils.ejb.EjbUtils.class ) ; org.powermock.api.mockito.PowerMockito.mockStatic ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.class ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.MonitoringStrategy getMonitoringStrategyForVds ( org.ovirt.engine.core.common.businessentities.VDS param ) { return org.mockito.Mockito.mock ( org.ovirt.engine.core.vdsbroker.MonitoringStrategy.class ) ; }
Source:
public org.ovirt.engine.core.compat.Guid createAsyncTask ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return createAsyncTask ( parentCommand , null , org.ovirt.engine.core.bll.CommandBase.EMPTY_GUID_ARRAY ) ; }

Target:
private org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler getBackendCommandObjectsHandler ( ) { try { javax.naming.InitialContext ctx = new javax.naming.InitialContext ( ) ; return ( ( org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler ) ( ctx.lookup ( org.ovirt.engine.core.bll.CommandBase.BACKEND_COMMAND_OBJECTS_HANDLER_JNDI_NAME ) ) ) ; } catch ( javax.naming.NamingException e ) { log.error ( ( "Getting backend command objects handler failed" + ( e.getMessage ( ) ) ) ) ; log.debug ( "" , e ) ; return null ; } }
Source:
public void getGlusterHooks ( 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.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public 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 testGetByIdReturnsItemOfThatId ( ) { org.ovirt.engine.core.compat.Guid itemId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem testItem = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( itemId , null ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.singletonList ( testItem ) ) ; org.junit.Assert.assertThat ( map.get ( itemId ) , org.hamcrest.CoreMatchers.is ( testItem ) ) ; }

Target:
public void testGetByIdReturnsItemOfThatId ( ) { org.ovirt.engine.core.compat.Guid itemId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem testItem = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( itemId , null ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.singletonList ( testItem ) ) ; org.hamcrest.MatcherAssert.assertThat ( map.get ( itemId ) , org.hamcrest.CoreMatchers.is ( testItem ) ) ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE , result.getDnsResolverConfiguration ( ) . getId ( ) ) ; dao.remove ( result.getId ( ) ) ; org.junit.Assert.assertNull ( dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ) ; org.junit.Assert.assertNull ( dnsResolverConfigurationDao.get ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE , result.getDnsResolverConfiguration ( ) . getId ( ) ) ; dao.remove ( result.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ) ; org.junit.jupiter.api.Assertions.assertNull ( dnsResolverConfigurationDao.get ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ) ; }
Source:
public void qosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; validateAndAssertQosOverridden ( helper , iface ) ; }

Target:
public void customPropertiesNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }
Source:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.InitVdsOnUpCommand.getVds ( ) . getId ( ) , reason ) ; tempVar.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.InitVdsOnUpCommand.getVds ( ) . getId ( ) , reason , customLogValues ) ; tempVar.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public void testNotManagementNetworkNegative ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( DEFAULT_GUID ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotManagementNetworkPositive ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) . thenReturn ( true ) ; org.junit.Assert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.tags createTag ( java.lang.String name , java.lang.String desc ) { org.ovirt.engine.core.common.businessentities.tags tag = new org.ovirt.engine.core.common.businessentities.tags ( ) ; tag.setChildren ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.tags > ( ) ) ; tag.setdescription ( desc ) ; tag.settag_name ( name ) ; tag.setIsReadonly ( true ) ; tag.setparent_id ( Guid.Empty ) ; tag.settype ( TagsType.GeneralTag ) ; return tag ; }

Target:
private org.ovirt.engine.core.common.businessentities.Tags createTag ( java.lang.String name , java.lang.String desc ) { org.ovirt.engine.core.common.businessentities.Tags tag = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; tag.setChildren ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ( ) ) ; tag.setdescription ( desc ) ; tag.settag_name ( name ) ; tag.setIsReadonly ( true ) ; tag.setparent_id ( Guid.Empty ) ; tag.settype ( TagsType.GeneralTag ) ; return tag ; }
Source:
public static boolean IsVmRunning ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( vmId ) ; if ( vm != null ) { return ( org.ovirt.engine.core.common.businessentities.VM.isStatusUpOrPaused ( vm.getstatus ( ) ) ) || ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; } return false ; }

Target:
public static boolean IsVmRunning ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { return ( org.ovirt.engine.core.common.businessentities.VM.isStatusUpOrPaused ( vm.getstatus ( ) ) ) || ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; } return false ; }
Source:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getStorageDomainList ( 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 ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }