auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void IsLiveStorageMigrationEnabled ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LiveStorageMigrationEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , aQuery ) ; }
Source:
public void testWithNoLists ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails volDetailsEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ( ) ; volDetailsEntity.setBrickDetails ( getBrickDetails ( 0 , 0 , 0 ) ) ; org.ovirt.engine.api.model.GlusterBrickAdvancedDetails model = org.ovirt.engine.api.restapi.types.GlusterBrickDetailMapper.map ( volDetailsEntity , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertNull ( model.getGlusterClients ( ) ) ; org.junit.Assert.assertNull ( model.getMntOptions ( ) ) ; }

Target:
public void testWithNoLists ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails volDetailsEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ( ) ; volDetailsEntity.setBrickDetails ( getBrickDetails ( 0 , 0 , 0 ) ) ; org.ovirt.engine.api.model.GlusterBrickAdvancedDetails model = org.ovirt.engine.api.restapi.types.GlusterBrickDetailMapper.map ( volDetailsEntity , null ) ; org.junit.jupiter.api.Assertions.assertNotNull ( model ) ; org.junit.jupiter.api.Assertions.assertNull ( model.getGlusterClients ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( model.getMntOptions ( ) ) ; }
Source:
protected void addVmNetwork ( ) { org.ovirt.engine.core.bll.network.vm.VnicProfileHelper vnicProfileHelper = new org.ovirt.engine.core.bll.network.vm.VnicProfileHelper ( org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVdsGroupId ( ) , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getStoragePoolId ( ) , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVdsGroup ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.common.AuditLogType.ADD_VM_FROM_SNAPSHOT_INVALID_INTERFACES ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : getVmFromConfiguration ( ) . getInterfaces ( ) ) { vnicProfileHelper.updateNicWithVnicProfileForUser ( iface , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getCurrentUser ( ) ) ; } vnicProfileHelper.auditInvalidInterfaces ( org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVmName ( ) ) ; super . addVmNetwork ( ) ; }

Target:
protected void addVmNetwork ( ) { org.ovirt.engine.core.bll.network.vm.VnicProfileHelper vnicProfileHelper = new org.ovirt.engine.core.bll.network.vm.VnicProfileHelper ( org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVdsGroupId ( ) , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getStoragePoolId ( ) , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.common.AuditLogType.ADD_VM_FROM_SNAPSHOT_INVALID_INTERFACES ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : getVmFromConfiguration ( ) . getInterfaces ( ) ) { vnicProfileHelper.updateNicWithVnicProfileForUser ( iface , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getCurrentUser ( ) ) ; } vnicProfileHelper.auditInvalidInterfaces ( org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVmName ( ) ) ; super . addVmNetwork ( ) ; }
Source:
private void handleTaskOfCommandWithEmptyVdsmId ( final boolean isPartiallySubmittedCommand , final org.ovirt.engine.core.common.businessentities.AsyncTask task ) { if ( isPartiallySubmittedCommand ) { if ( org.ovirt.engine.core.bll.tasks.AsyncTaskManager.hasEmptyVdsmId ( task ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; return ; } partiallyCompletedCommandTasks.put ( task.getVdsmTaskId ( ) , task ) ; return ; } org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { logAndFailTaskOfCommandWithEmptyVdsmId ( task , "Engine was restarted before all tasks of the command could be submitted to vdsm." ) ; return null ; } } ) ; }

Target:
private void handlePartiallyExecutedTaskOfCommand ( final org.ovirt.engine.core.common.businessentities.AsyncTask task ) { if ( org.ovirt.engine.core.bll.tasks.AsyncTaskManager.hasEmptyVdsmId ( task ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; return ; } partiallyCompletedCommandTasks.put ( task.getVdsmTaskId ( ) , task ) ; }
Source:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getStorageDoaminsByDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks , boolean isFillStorageTodDiskMap ) { java.util.Set < org.ovirt.engine.core.compat.Guid > domainsList = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; if ( disks != null ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { domainsList.addAll ( disk.getStorageIds ( ) ) ; if ( isFillStorageTodDiskMap ) { for ( org.ovirt.engine.core.compat.Guid storageDomainId : disk.getStorageIds ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( storageDomainId , disk , storageToDisksMap ) ; } } } } return domainsList ; }

Target:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getStorageDomainsByDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks , boolean isFillStorageTodDiskMap ) { java.util.Set < org.ovirt.engine.core.compat.Guid > domainsList = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; if ( disks != null ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { domainsList.addAll ( disk.getStorageIds ( ) ) ; if ( isFillStorageTodDiskMap ) { for ( org.ovirt.engine.core.compat.Guid storageDomainId : disk.getStorageIds ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( storageDomainId , disk , storageToDisksMap ) ; } } } } return domainsList ; }
Source:
public void validateSlaveHasNoLabelsHasOldLabel ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( new java.util.HashSet < > ( java.util.Arrays.asList ( "lbl1" ) ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . setExistingInterfaces ( java.util.Arrays.asList ( slave ) ) . setHost ( host ) . build ( ) ; assertValidateSlaveHasNoLabelsFailed ( validator , slave.getName ( ) ) ; }

Target:
public void validateSlaveHasNoLabelsHasOldLabel ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( java.util.Collections.singleton ( "lbl1" ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . setExistingInterfaces ( java.util.Arrays.asList ( slave ) ) . setHost ( host ) . build ( ) ; assertValidateSlaveHasNoLabelsFailed ( validator , slave.getName ( ) ) ; }
Source:
public void testFindMappingEntryEmptyInput ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( java.util.Collections.emptyList ( ) ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.Assert.assertEquals ( 1 , ctx.getMatched ( ) . size ( ) ) ; org.junit.Assert.assertEquals ( null , ctx.getMatched ( ) . get ( vnic ) ) ; }

Target:
public void testFindMappingEntryEmptyInput ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( java.util.Collections.emptyList ( ) ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.Assert.assertEquals ( 1 , ctx.getMatched ( ) . size ( ) ) ; org.junit.Assert.assertNull ( ctx.getMatched ( ) . get ( vnic ) ) ; }
Source:
public void showForm ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { this . model = model ; formPanel.clear ( ) ; for ( org.ovirt.engine.ui.common.widget.form.FormItem item : formItems ) { if ( item.isVisible ( ) ) { formPanel.addFormItem ( item ) ; } } model.getPropertyChangedEvent ( ) . removeListener ( propertyChangedEventListener ) ; model.getPropertyChangedEvent ( ) . addListener ( propertyChangedEventListener ) ; }

Target:
public void showForm ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { this . model = model ; formPanel.clear ( ) ; for ( org.ovirt.engine.ui.common.widget.form.FormItem item : formItems ) { if ( ( item.getIsAvailable ( ) ) && ( item.isVisible ( ) ) ) { formPanel.addFormItem ( item ) ; } } model.getPropertyChangedEvent ( ) . removeListener ( propertyChangedEventListener ) ; model.getPropertyChangedEvent ( ) . addListener ( propertyChangedEventListener ) ; }
Source:
public void testSaveIsInitialized ( ) { org.ovirt.engine.core.compat.Guid vmId = existingVm.getId ( ) ; boolean origInitialized = existingVm.isInitialized ( ) ; dao.saveIsInitialized ( vmId , ( ! origInitialized ) ) ; org.ovirt.engine.core.common.businessentities.VM updatedVm = dao.get ( vmId ) ; org.junit.Assert.assertEquals ( "VM's is_initiazlied was not updated" , ( ! origInitialized ) , updatedVm.isInitialized ( ) ) ; dao.saveIsInitialized ( vmId , origInitialized ) ; updatedVm = dao.get ( vmId ) ; org.junit.Assert.assertEquals ( "VM's is_initiazlied was not updated" , origInitialized , updatedVm.isInitialized ( ) ) ; }

Target:
public void testSaveIsInitialized ( ) { org.ovirt.engine.core.compat.Guid vmId = existingVm.getId ( ) ; boolean origInitialized = existingVm.isInitialized ( ) ; dao.saveIsInitialized ( vmId , ( ! origInitialized ) ) ; org.ovirt.engine.core.common.businessentities.VM updatedVm = dao.get ( vmId ) ; org.junit.jupiter.api.Assertions.assertEquals ( ( ! origInitialized ) , updatedVm.isInitialized ( ) , "VM's is_initiazlied was not updated" ) ; dao.saveIsInitialized ( vmId , origInitialized ) ; updatedVm = dao.get ( vmId ) ; org.junit.jupiter.api.Assertions.assertEquals ( origInitialized , updatedVm.isInitialized ( ) , "VM's is_initiazlied was not updated" ) ; }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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 ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > getVmImagesFromDb ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > allVmImages = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > filteredDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( vm.getDiskList ( ) , false , true , true ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : filteredDisks ) { allVmImages.addAll ( getAllImageSnapshots ( diskImage ) ) ; } return allVmImages ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmImagesFromDb ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allVmImages = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > filteredDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( vm.getDiskList ( ) , false , true , true ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : filteredDisks ) { allVmImages.addAll ( getAllImageSnapshots ( diskImage ) ) ; } return allVmImages ; }
Source:
protected void setSoundcard ( org.ovirt.engine.api.model.Vm model ) { model.setSoundcardEnabled ( ( ! ( org.ovirt.engine.api.restapi.util.VmHelper.getSoundDevicesForEntity ( this , new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) . isEmpty ( ) ) ) ) ; }

Target:
protected org.ovirt.engine.api.model.Vm doPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setPayload ( this , model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setConsoleDevice ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setVirtioScsiController ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setSoundcard ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setCertificateInfo ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setRngDevice ( this , model ) ; setVmOvfConfiguration ( model , entity ) ; return model ; }
Source:
public void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.common.errors.VdcFault fault ) { org.ovirt.engine.ui.uicompat.Translator vdcActionTypeTranslator = org.ovirt.engine.ui.uicompat.EnumTranslator.Create ( org.ovirt.engine.core.common.action.VdcActionType.class ) ; errorPopupManager.show ( messages.uiCommonRunActionExecutionFailed ( ( vdcActionTypeTranslator.containsKey ( action ) ? vdcActionTypeTranslator.get ( action ) : action.toString ( ) ) , fault.getMessage ( ) ) ) ; }

Target:
public void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.common.errors.VdcFault fault ) { errorPopupManager.show ( messages.uiCommonRunActionExecutionFailed ( org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( action ) , fault.getMessage ( ) ) ) ; }
Source:
private void initManagement ( ) { final org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { management = ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isManagementNetwork ( callback , getNetwork ( ) . getId ( ) ) ; }

Target:
private void initManagement ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isManagementNetwork ( new org.ovirt.engine.ui.uicommonweb.models.datacenters.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Boolean > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Boolean returnValue ) { management = returnValue ; } } ) , getNetwork ( ) . getId ( ) ) ; }
Source:
public void getNetworkList ( 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 ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getDataCenterMaxNameLength ( 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 ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void executeCommandWhenFailed ( ) { setVolumeId ( volumeWithRemoveBricksTask ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStopFailed ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . endStepJobAborted ( org.mockito.Matchers.any ( java.lang.String.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_STOP_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setVolumeId ( volumeWithRemoveBricksTask ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStopFailed ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . endStepJobAborted ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_STOP_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > > ) ( value ) ) , new java.util.Comparator < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > > ( ) { @ java.lang.Override public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > arg0 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > arg1 ) { return arg0.getFirst ( ) . getName ( ) . compareTo ( arg1.getFirst ( ) . getName ( ) ) ; } } ) ; super . setItems ( value ) ; }

Target:
public void setItems ( java.util.Collection value ) { java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > > ) ( value ) ) , new java.util.Comparator < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > > ( ) { @ java.lang.Override public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > arg0 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > arg1 ) { return arg0.getFirst ( ) . getName ( ) . compareTo ( arg1.getFirst ( ) . getName ( ) ) ; } } ) ; super . setItems ( value ) ; }
Source:
public void testGetAllMultiVmSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( "VMs:" , org.ovirt.engine.core.common.interfaces.SearchType.VM ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vmResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllVMSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "VM" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vmResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }
Source:
protected void updateCustomPropertySheet ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; updateCustomPropertySheet ( cluster.getCompatibilityVersion ( ) ) ; }

Target:
public void postUpdateNumOfSockets3 ( ) { java.lang.String version = getCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfThreadsPerCpu ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxThreadsPerCore = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; } } ) , version ) ; }
Source:
protected void AsyncSearch ( ) { super . AsyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vm.getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
private void setScanAlignmentCommand ( org.ovirt.engine.ui.uicommonweb.UICommand value ) { privateScanAlignmentCommand = value ; }
Source:
public void onSuccessDontTryNextAgent ( ) { mockExecutor ( agent1 , true ) ; mockCheckStatus ( "on" ) ; org.mockito.Mockito.when ( executor.fence ( org.mockito.Matchers.eq ( FenceActionType.START ) , org.mockito.Matchers.eq ( agent2 ) ) ) . thenThrow ( new java.lang.IllegalStateException ( ) ) ; command.executeCommand ( ) ; }

Target:
public void onSuccessAudit ( ) { mockExecutor ( true ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 2 ) ) . log ( org.mockito.Matchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; }
Source:
public void setUpDefaultEntities ( ) { defaultCluster = clusterBuilder.persist ( ) ; defaultHost = vdsBuilder.cluster ( defaultCluster ) . persist ( ) ; defaultVM = vmBuilder.host ( defaultHost ) . up ( ) . persist ( ) ; }

Target:
public void setUpDefaultEnvironment ( ) { java.lang.System.setProperty ( "ovirt-engine.config.defaults" , "src/test/resources/engine.conf.defaults" ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( new org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils ( ) ) ; org.ovirt.engine.core.common.config.Config.getConfigUtils ( ) . setStringValue ( ConfigValues.EnableVdsLoadBalancing.name ( ) , "false" ) ; defaultCluster = clusterBuilder.persist ( ) ; defaultHost = vdsBuilder.cluster ( defaultCluster ) . persist ( ) ; defaultVM = vmBuilder.host ( defaultHost ) . up ( ) . persist ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsDiskPluggedTo ( ) { if ( ( vmsDiskPluggedTo ) == null ) { vmsDiskPluggedTo = org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVmDAO ( ) . getForDisk ( getOldDisk ( ) . getId ( ) ) . get ( java.lang.Boolean.TRUE ) ; if ( ( vmsDiskPluggedTo ) == null ) { vmsDiskPluggedTo = java.util.Collections.emptyList ( ) ; } } return vmsDiskPluggedTo ; }

Target:
private boolean shouldUpdateReadOnly ( ) { return ! ( vmDeviceForVm.getIsReadOnly ( ) . equals ( getNewDisk ( ) . getReadOnly ( ) ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { false , false } , getUsers ( ) ) ; setUpGetEntityExpectations ( 1 ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { false , false } , getUsers ( ) ) ; setUpGetEntityExpectations ( 1 ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( "%s, force=%s, checkConnectivity=%s, conectivityTimeout=%s,%n\tnetworks=%s,%n\tbonds=%s,%n\tinterfaces=%s,%n\tremovedNetworks=%s,%n\tremovedBonds=%s" , super . toString ( ) , isForce ( ) , isCheckConnectivity ( ) , getConectivityTimeout ( ) , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getBonds ( ) , "\t\t" ) , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getInterfaces ( ) , "\t\t" ) , getRemovedNetworks ( ) , getRemovedBonds ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "force" , isForce ( ) ) . append ( "checkConnectivity" , isCheckConnectivity ( ) ) . append ( "connectivityTimeout" , getConectivityTimeout ( ) ) . append ( "networks" , getNetworks ( ) ) . append ( "bonds" , getBonds ( ) ) . append ( "interfaces" , getInterfaces ( ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "removedBonds" , getRemovedBonds ( ) ) ; }
Source:
private void assertGetAllForVdsGroupCorrectResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) , existingVds ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( vds.getVdsGroupId ( ) , existingVds.getVdsGroupId ( ) ) ; } }

Target:
private void assertGetAllForClusterCorrectResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) , existingVds ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( vds.getClusterId ( ) , existingVds.getClusterId ( ) ) ; } }
Source:
< T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < ? extends org.ovirt.engine.core.compat.NGuid > > void updateActionButtonCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command , org.ovirt.engine.ui.webadmin.plugin.api.ActionButtonInterface actionButtonInterface , java.util.List < T > selectedItems ) { boolean isEnabled = true ; isEnabled = org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.invokeAndGetResultAsBoolean ( actionButtonInterface.isEnabled ( ) , org.ovirt.engine.ui.webadmin.plugin.entity.EntityObject.arrayFrom ( selectedItems ) , null , isEnabled ) ; command.setIsExecutionAllowed ( isEnabled ) ; boolean isAccessible = true ; isAccessible = org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.invokeAndGetResultAsBoolean ( actionButtonInterface.isAccessible ( ) , org.ovirt.engine.ui.webadmin.plugin.entity.EntityObject.arrayFrom ( selectedItems ) , null , isAccessible ) ; command.setIsAvailable ( isAccessible ) ; }

Target:
public void addSubTabActionButton ( org.ovirt.engine.ui.webadmin.plugin.entity.EntityType mainTabEntityType , org.ovirt.engine.ui.webadmin.plugin.entity.EntityType subTabEntityType , java.lang.String label , org.ovirt.engine.ui.webadmin.plugin.api.ActionButtonInterface actionButtonInterface ) { java.lang.String historyToken = mainTabEntityType.getSubTabHistoryToken ( subTabEntityType ) ; if ( historyToken != null ) { org.ovirt.engine.ui.common.presenter.AddTabActionButtonEvent.fire ( this , historyToken , createButtonDefinition ( label , actionButtonInterface ) ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.core.common.businessentities.StoragePool dc = model.getSelectedDc ( ) ; getView ( ) . editProfiles ( model.getProfiles ( ) , dc.getcompatibility_version ( ) , dc.getId ( ) , model.getDefaultProfile ( ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.core.common.businessentities.StoragePool dc = model.getSelectedDc ( ) ; getView ( ) . updateDc ( dc.getcompatibility_version ( ) , dc.getId ( ) ) ; }
Source:
public boolean validate ( ) { getInbound ( ) . validate ( ) ; getOutbound ( ) . validate ( ) ; setIsValid ( ( ( getInbound ( ) . getIsValid ( ) ) && ( getOutbound ( ) . getIsValid ( ) ) ) ) ; return getIsValid ( ) ; }

Target:
public boolean validate ( ) { if ( ! ( getIsAvailable ( ) ) ) { return true ; } getInbound ( ) . validate ( ) ; getOutbound ( ) . validate ( ) ; setIsValid ( ( ( getInbound ( ) . getIsValid ( ) ) && ( getOutbound ( ) . getIsValid ( ) ) ) ) ; return getIsValid ( ) ; }
Source:
public void bondWithNoSlaves ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; mockExistingIfaces ( bond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( bond ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }

Target:
public void fakeVlanNicWithVmNetworkDenied ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; mockExistingNetworks ( net1 , net2 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface fakeVlanNic = createVlan ( nic.getName ( ) , 100 , net2.getName ( ) ) ; fakeVlanNic.setVlanId ( null ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , fakeVlanNic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }
Source:
private void backupCheck ( ) { if ( lock.tryLock ( ) ) { try { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Backup check started." ) ; doBackupCheck ( ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Backup check completed." ) ; } finally { lock.unlock ( ) ; } } }

Target:
private void backupCheck ( ) { try { if ( lock.tryLock ( ) ) { try { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Backup check started." ) ; doBackupCheck ( ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Backup check completed." ) ; } finally { lock.unlock ( ) ; } } } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.error ( "Exception in backupCheck: {}" , org.apache.commons.lang.exception.ExceptionUtils.getRootCauseMessage ( t ) ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.debug ( "Exception" , t ) ; } }
Source:
public static void GetNetworkConnectivityCheckTimeoutInSeconds ( 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 ( ) : 120 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.NetworkConnectivityCheckTimeoutInSeconds , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetDefaultPmProxyPreferences ( org.ovirt.engine.ui.frontend.AsyncQuery query ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.FenceProxyDefaultPreferences , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , query ) ; }
Source:
protected void unlockEntities ( ) { org.ovirt.engine.core.bll.CloneVmCommand.getVmDynamicDao ( ) . updateStatus ( oldVmId , VMStatus.Down ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( ( ( getSourceVmFromDb ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( getSourceVmFromDb ( ) . isDown ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return super . canDoAction ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > searchVmsFromDb ( ) { org.ovirt.engine.core.bll.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmDao ( ) . getAllUsingQuery ( data.getQuery ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; } return vms ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > searchVmsFromDb ( ) { org.ovirt.engine.core.bll.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmDao ( ) . getAllUsingQuery ( data.getQuery ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmLock ( vm ) ; } return vms ; }
Source:
private java.lang.String getPublicCollection ( java.lang.String collectionName , boolean throwError ) { try { return getPublicCollection ( collectionName ) ; } catch ( java.lang.RuntimeException rte ) { if ( ! throwError ) return null ; throw rte ; } }

Target:
private java.lang.String getPublicCollection ( java.lang.String collectionName , java.lang.String [ ] periods , int i , boolean throwError ) { try { return getPublicCollection ( collectionName , periods , i ) ; } catch ( java.lang.RuntimeException rte ) { if ( ! throwError ) return null ; throw rte ; } }
Source:
public void testIsNetworkInSyncWhenBootProtocolNotStaticAddressDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocolAddress ( NetworkBootProtocol.NONE , false ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4GatewayBothBlank ( ) { java.util.List < java.lang.String > blankValues = java.util.Arrays.asList ( null , "" ) ; initIpv4ConfigurationStaticBootProtocol ( Ipv4BootProtocol.STATIC_IP ) ; int blankIndex = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 2 ) ; ipv4Address.setGateway ( blankValues.get ( blankIndex ) ) ; iface.setIpv4Gateway ( blankValues.get ( ( blankIndex ^ 1 ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public void testIsNetworkInSyncWhenVlanIdDifferent ( ) { iface.setMtu ( 1 ) ; network.setMtu ( 1 ) ; iface.setVlanId ( 1 ) ; network.setVlanId ( 2 ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenVlanIdDifferent ( ) { iface.setMtu ( 1 ) ; network.setMtu ( 1 ) ; iface.setVlanId ( 1 ) ; network.setVlanId ( 2 ) ; org.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( true , false ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( dbFacadeMock ) . getStoragePoolDao ( ) ; setupCpu ( ) ; validateFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }

Target:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; initAndAssertValidation ( true ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface findInterfaceNetworkNameNotEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { return i ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface findInterfaceNetworkNameNotEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { return org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( items , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i ) { return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ; } } ) ; }
Source:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { 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 ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

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.common.businessentities.VmTemplate > ( ) ; } return source ; }
Source:
private java.util.Set < java.lang.String > getRemovedNetworks ( ) { if ( ( removedNetworks ) == null ) { removedNetworks = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedNetworkAttachments ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedNetworkAttachments ( ) ) { removedNetworks.add ( getNetworkBusinessEntityMap ( ) . get ( attachment.getNetworkId ( ) ) . getName ( ) ) ; } } return removedNetworks ; }

Target:
private java.util.Set < java.lang.String > getRemovedUnmanagedNetworks ( ) { if ( ( removedUnmanagedNetworks ) == null ) { this . removedUnmanagedNetworks = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedUnmanagedNetworks ( ) ) ; } return removedUnmanagedNetworks ; }
Source:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) ) ; UpdateVmTemplate ( ) ; updateWatchdog ( ) ; org.ovirt.engine.core.bll.UpdateVmTemplateCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) ) ; UpdateVmTemplate ( ) ; updateWatchdog ( ) ; checkTrustedService ( ) ; org.ovirt.engine.core.bll.UpdateVmTemplateCommand.setSucceeded ( true ) ; } }
Source:
public org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue fence ( org.ovirt.engine.core.common.businessentities.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent ) { boolean withRetries = action != ( org.ovirt.engine.core.common.businessentities.FenceActionType.Status ) ; org.ovirt.engine.core.common.businessentities.VDS proxyHost = new org.ovirt.engine.core.bll.FenceProxyLocator ( _vds , fencingPolicy ) . findProxyHost ( withRetries ) ; if ( proxyHost == null ) { return proxyNotFound ( ) ; } else { return fence ( action , agent , proxyHost ) ; } }

Target:
public org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue fence ( org.ovirt.engine.core.common.businessentities.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent ) { boolean withRetries = action != ( org.ovirt.engine.core.common.businessentities.FenceActionType.Status ) ; org.ovirt.engine.core.common.businessentities.VDS proxyHost = proxyLocator.findProxyHost ( withRetries ) ; if ( proxyHost == null ) { return proxyNotFound ( ) ; } else { return fence ( action , agent , proxyHost ) ; } }