auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void terminateActionAvailability ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.EngineSession > selectedSession = getSelectedItems ( ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.EngineSession > selectedItems = ( selectedSession != null ) ? selectedSession : new java.util.ArrayList ( ) ; getTerminateCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) > 0 ) ) ; }

Target:
private void terminateActionAvailability ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.UserSession > selectedSession = getSelectedItems ( ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.UserSession > selectedItems = ( selectedSession != null ) ? selectedSession : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.UserSession > ( ) ; getTerminateCommand ( ) . setIsExecutionAllowed ( ( ! ( selectedItems.isEmpty ( ) ) ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , ( ( getVmName ( ) ) == null ? "" : getVmName ( ) ) ) ; jobProperties.put ( VdcObjectType.VdsGroups.name ( ) . toLowerCase ( ) , getVdsGroupName ( ) ) ; } return jobProperties ; }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . EndAction ( org.ovirt.engine.core.bll.ImportVmCommand.getImagesActionType ( ) , p ) ; } }
Source:
public static void getUnknownImageList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < java.lang.String > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean forceRefresh ) { org.ovirt.engine.ui.uicommonweb.dataprovider.ImagesDataProvider.getIrsImageList ( aQuery , storagePoolId , forceRefresh , ImageFileType.All , new org.ovirt.engine.ui.uicommonweb.dataprovider.ImagesDataProvider.RepoImageToImageFileNameAsyncConverter ( ) { @ java.lang.Override protected java.lang.String transform ( java.util.ArrayList < java.lang.String > fileNameList , org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return ( org.ovirt.engine.ui.uicommonweb.dataprovider.ImagesDataProvider.ISO_PREFIX ) + ( super . transform ( repoImage ) ) ; } @ java.lang.Override protected boolean desiredImage ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return ( org.ovirt.engine.core.common.businessentities.storage.ImageFileType.Unknown ) == ( repoImage.getFileType ( ) ) ; } } ) ; }

Target:
public static void getUnknownImageList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < java.lang.String > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean forceRefresh ) { org.ovirt.engine.ui.uicommonweb.dataprovider.ImagesDataProvider.getIrsImageList ( aQuery , storagePoolId , forceRefresh , ImageFileType.All , new org.ovirt.engine.ui.uicommonweb.dataprovider.ImagesDataProvider.RepoImageToImageFileNameAsyncConverter ( ( image ) -> ( org.ovirt.engine.ui.uicommonweb.dataprovider.ImagesDataProvider.ISO_PREFIX ) + ( image.getRepoImageId ( ) ) , ( image ) -> ( org.ovirt.engine.core.common.businessentities.storage.ImageFileType.Unknown ) == ( image.getFileType ( ) ) ) ) ; }
Source:
public void diskImagesOnAnyApplicableDomainsValidDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Set < org.ovirt.engine.core.compat.Guid > > validDomainsForDisk = createDiskValidDomainsMap ( disk1 , disk2 ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomainMap = createStorageDomainsMap ( disk1 , disk2 ) ; org.junit.Assert.assertThat ( validator.diskImagesOnAnyApplicableDomains ( validDomainsForDisk , storageDomainMap , VdcBllMessages.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , java.util.EnumSet.of ( StorageDomainStatus.Active ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void diskImagesOnAnyApplicableDomainsValidDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Set < org.ovirt.engine.core.compat.Guid > > validDomainsForDisk = createDiskValidDomainsMap ( disk1 , disk2 ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomainMap = createStorageDomainsMap ( disk1 , disk2 ) ; org.junit.Assert.assertThat ( validator.diskImagesOnAnyApplicableDomains ( validDomainsForDisk , storageDomainMap , EngineMessage.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , java.util.EnumSet.of ( StorageDomainStatus.Active ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void updateOvfs ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = getSelectedItem ( ) ; if ( storage != null ) { org.ovirt.engine.core.common.action.ProcessOvfUpdateForStorageDomainCommandParameters params = new org.ovirt.engine.core.common.action.ProcessOvfUpdateForStorageDomainCommandParameters ( ) ; params.setStorageDomainId ( storage.getId ( ) ) ; params.setStoragePoolId ( storage.getStoragePoolId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.ProcessOvfUpdateForStorageDomain , params , null , this ) ; } cancel ( ) ; }

Target:
private void updateOvfs ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = getSelectedItem ( ) ; if ( storage != null ) { org.ovirt.engine.core.common.action.StorageDomainParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainParametersBase ( storage.getId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateOvfStoreForStorageDomain , params , null , this ) ; } cancel ( ) ; }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
public void testAllDomainsHaveSpaceForAllDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForAllDisks ( org.mockito.Matchers.eq ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.DiskImage > emptyList ( ) ) , org.mockito.Matchers.anyList ( ) ) ; }

Target:
public void testAllDomainsWithinThreshold ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.name ( ) ) ) ; }
Source:
public void testGetAllOfType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllOfType ( VDSType.VDS ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( VDSType.VDS , vds.getvds_type ( ) ) ; } }

Target:
public void testGetAllOfType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllOfType ( VDSType.VDS ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( VDSType.VDS , vds.getVdsType ( ) ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.setDataCenter ( model , list ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }
Source:
protected org.ovirt.engine.core.common.AuditLogType getAuditLogTypeForInvalidInterfaces ( ) { return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }

Target:
protected org.ovirt.engine.core.compat.Guid generateNewDiskId ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.compat.Guid newGuidForDisk = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; newDiskIdForDisk.put ( newGuidForDisk , org.ovirt.engine.core.common.businessentities.DiskImage.copyOf ( disk ) ) ; disk.setId ( newGuidForDisk ) ; disk.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return newGuidForDisk ; }
Source:
public void setMtuEnabled ( boolean flag ) { mtuEditor.setEnabled ( flag ) ; }

Target:
public boolean isEnabled ( ) { for ( java.lang.Object model : clustersTable.flush ( ) . getItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ) ( model ) ) ; if ( networkClusterModel.getIsChangable ( ) ) { return true ; } } return false ; }
Source:
com.google.gwt.user.cellview.client.Header < ? > wrapHeader ( com.google.gwt.user.cellview.client.Header < ? > header , com.google.gwt.user.cellview.client.Column < T , ? > column ) { return ( columnResizingEnabled ) && ( header instanceof org.ovirt.engine.ui.common.widget.table.header.CheckboxHeader ) ? new org.ovirt.engine.ui.common.widget.table.header.ResizeableCheckboxHeader < T > ( ( ( org.ovirt.engine.ui.common.widget.table.header.CheckboxHeader ) ( header ) ) , column , this ) : header ; }

Target:
protected com.google.gwt.user.cellview.client.Header < ? > createResizableCheckboxHeader ( com.google.gwt.user.cellview.client.Header < ? > header , com.google.gwt.user.cellview.client.Column < T , ? > column ) { if ( header instanceof org.ovirt.engine.ui.common.widget.table.header.AbstractCheckboxHeader ) { return new org.ovirt.engine.ui.common.widget.table.header.ResizeableCheckboxHeader < T > ( ( ( org.ovirt.engine.ui.common.widget.table.header.AbstractCheckboxHeader ) ( header ) ) , column , this ) ; } return header ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }
Source:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) . getUserId ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) . getId ( ) ) ) ) ) { return false ; } return true ; }
Source:
private void writeModel ( ) { writeStartElement ( "model" ) ; writeStartElement ( "types" ) ; model.types ( ) . forEach ( this :: writeType ) ; writeEndElement ( ) ; writeStartElement ( "services" ) ; model.services ( ) . forEach ( this :: writeService ) ; writeEndElement ( ) ; writeEndElement ( ) ; }

Target:
private void writeModel ( ) { writer.writeStartElement ( "model" ) ; writer.writeStartElement ( "types" ) ; model.types ( ) . forEach ( this :: writeType ) ; writer.writeEndElement ( ) ; writer.writeStartElement ( "services" ) ; model.services ( ) . forEach ( this :: writeService ) ; writer.writeEndElement ( ) ; writer.writeEndElement ( ) ; }
Source:
private static void addSoundCard ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Version vdsGroupCompatibilityVersion ) { java.lang.String soundDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.getSoundDevice ( vmBase.getOsId ( ) , vdsGroupCompatibilityVersion ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) , VmDeviceGeneralType.SOUND , org.ovirt.engine.core.common.utils.VmDeviceType.getSoundDeviceType ( soundDevice ) , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , true , null ) ; }

Target:
public static void addVideoDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , int numberOfVideoDevices ) { for ( int i = 0 ; i < numberOfVideoDevices ; i ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) , VmDeviceGeneralType.VIDEO , vmBase.getDefaultDisplayType ( ) . getDefaultVmDeviceType ( ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getVideoDeviceSpecParams ( vmBase ) , true , false ) ; } }
Source:
private static java.lang.Double computeInterfaceUsage ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { java.lang.Double receiveRate = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.truncatePercentage ( iface.getStatistics ( ) . getReceiveRate ( ) ) ; java.lang.Double transmitRate = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.truncatePercentage ( iface.getStatistics ( ) . getTransmitRate ( ) ) ; if ( receiveRate == null ) { return transmitRate ; } else if ( transmitRate == null ) { return receiveRate ; } else { return java.lang.Math.max ( receiveRate , transmitRate ) ; } }

Target:
private static java.lang.Double computeInterfaceUsage ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean totalStatsReported ) { java.lang.Double receiveRate = iface.getStatistics ( ) . getReceiveRate ( ) ; java.lang.Double transmitRate = iface.getStatistics ( ) . getTransmitRate ( ) ; if ( ! totalStatsReported ) { receiveRate = org.ovirt.engine.core.vdsbroker.NetworkStatisticsBuilder.truncatePercentage ( receiveRate ) ; transmitRate = org.ovirt.engine.core.vdsbroker.NetworkStatisticsBuilder.truncatePercentage ( transmitRate ) ; } if ( receiveRate == null ) { return transmitRate ; } else if ( transmitRate == null ) { return receiveRate ; } else { return java.lang.Math.max ( receiveRate , transmitRate ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; dataCenterGuideModel.attachedStorageDomains = storageDomains ; dataCenterGuideModel.UpdateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; dataCenterGuideModel.attachedStorageDomains = storageDomains ; dataCenterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { nic = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; nic.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; nic.setName ( "existingNic" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Arrays.asList ( nic ) ; completer = new org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter ( nics ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { nic = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; nic.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; nic.setName ( "existingNic" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Collections.singletonList ( nic ) ; completer = new org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter ( nics ) ; }
Source:
public int getColumnSize ( java.lang.String table , java.lang.String column ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "table" , table ) . addValue ( "column" , column ) ; java.util.Map < java.lang.String , java.lang.Object > dbResults = new org.springframework.jdbc.core.simple.SimpleJdbcCall ( jdbcTemplate ) . withFunctionName ( "fn_get_column_size" ) . execute ( parameterSource ) ; java.lang.String resultKey = dbEngineDialect.getFunctionReturnKey ( ) ; return ( dbResults.get ( resultKey ) ) != null ? ( ( java.lang.Integer ) ( dbResults.get ( resultKey ) ) ) . intValue ( ) : - 1 ; }

Target:
public org.ovirt.engine.core.dao.network.VnicProfileDao getVnicProfileDao ( ) { return getDao ( org.ovirt.engine.core.dao.network.VnicProfileDao.class ) ; }
Source:
private void persistTopology ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( interfaceDao , host.getInterfaces ( ) , dbNics , userConfiguredData ) ; networkInterfacesPersister.persistTopology ( ) ; final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister networkAttachmentPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister ( networkAttachmentDao , host.getId ( ) , host.getInterfaces ( ) , userConfiguredData.getCustomProperties ( ) , userConfiguredData.getNetworkAttachments ( ) , clusterNetworks ) ; networkAttachmentPersister.persistNetworkAttachments ( ) ; }

Target:
private void persistTopology ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( interfaceDao , host.getInterfaces ( ) , dbNics , userConfiguredData ) ; networkInterfacesPersister.persistTopology ( ) ; createHostNetworkAttachmentsPersister ( host , clusterNetworks , userConfiguredData ) . persistNetworkAttachments ( ) ; }
Source:
public void hasNoStorageDomains ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createDefaultStoragePool ( ) ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void lowerVersionNoHostsNoNetwork ( ) { cmd.getStoragePool ( ) . setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.VERSION_1_0 ) ; addNonDefaultClusterToPool ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
protected void ExecuteVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityId ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getstatus ( ) ) == ( VMStatus.Suspended ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . gethibernation_vol_handle ( ) ) ) ) ) { setSuspendedVm ( true ) ; setSucceeded ( StopSuspendedVm ( ) ) ; } else { super . ExecuteVmCommand ( ) ; } removeStatelessVmUnmanagedDevices ( ) ; }

Target:
protected void ExecuteVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityId ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . gethibernation_vol_handle ( ) ) ) ) ) { setSuspendedVm ( true ) ; setSucceeded ( StopSuspendedVm ( ) ) ; } else { super . ExecuteVmCommand ( ) ; } removeStatelessVmUnmanagedDevices ( ) ; }
Source:
private void unplug ( ) { final org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; model.startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.HotUnPlugDiskFromVm , createHotPlugDiskToVmParameters ( false ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { model.stopProgress ( ) ; setWindow ( null ) ; } } , this ) ; }

Target:
private void unplug ( ) { final org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; model.startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.HotUnPlugDiskFromVm , createPlugOrUnplugParams ( false ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { model.stopProgress ( ) ; setWindow ( null ) ; } } , this ) ; }
Source:
public final void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { onBrowserEvent ( context , parent , value , null , event , valueUpdater ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { org.ovirt.engine.ui.common.utils.ElementTooltipUtils.handleCellEvent ( event , parent , getTooltip ( value ) ) ; super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( VmOsType.RHEL6 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; mockVMDAO ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( VmOsType.RHEL6 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockVMDAO ( vm ) ; return vm ; }
Source:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.UserPortalSimpleActionTable ( modelProvider , getTableResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) , new org.ovirt.engine.ui.userportal.widget.refresh.UserPortalRefreshManager ( modelProvider , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.UserPortalSimpleActionTable ( modelProvider , getTableResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) , new org.ovirt.engine.ui.common.widget.refresh.SimpleRefreshManager ( modelProvider , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) ) ) ; }
Source:
public void search ( ) { if ( ( getSearchPageSize ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.UnknownInteger ) ) { asyncCallback.RequestSearch ( ) ; } else { stopRefresh ( ) ; if ( getIsQueryFirstTime ( ) ) { setSelectedItem ( null ) ; setSelectedItems ( null ) ; } if ( ( getIsTimerDisabled ( ) ) == false ) { setIsQueryFirstTime ( true ) ; syncSearch ( ) ; setIsQueryFirstTime ( false ) ; getTimer ( ) . start ( ) ; } else { syncSearch ( ) ; } } }

Target:
public void search ( ) { if ( ( getSearchPageSize ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.UnknownInteger ) ) { asyncCallback.RequestSearch ( ) ; } else { stopRefresh ( ) ; if ( getIsQueryFirstTime ( ) ) { setSelectedItem ( null ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setSelectedItems ( null ) ; } if ( ( getIsTimerDisabled ( ) ) == false ) { setIsQueryFirstTime ( true ) ; syncSearch ( ) ; setIsQueryFirstTime ( false ) ; getTimer ( ) . start ( ) ; } else { syncSearch ( ) ; } } }
Source:
public void canDoActionFailsOnNoConflictServers ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; setUpMocksForAdd ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }

Target:
public void validateFailsOnNoConflictServers ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; setUpMocksForAdd ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }
Source:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void PostOnSaveNew ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { Cancel ( ) ; getSearchCommand ( ) . Execute ( ) ; } }

Target:
protected void selectedItemsChanged ( ) { super . selectedItemsChanged ( ) ; updateActionAvailability ( ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase NotAutorizedError ( ) { return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case AutoLogin : case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }
Source:
protected void postConstruct ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; setStoragePoolId ( parameters.getStoragePoolId ( ) ) ; imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap ( ) ; }

Target:
protected void postConstruct ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setStoragePoolId ( parameters.getStoragePoolId ( ) ) ; imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap ( ) ; }
Source:
protected void endWithFailure ( ) { if ( isVmRunningStateless ( ) ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters createSnapshotParameters = buildCreateSnapshotParameters ( ) ; createSnapshotParameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , createSnapshotParameters , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }

Target:
private void removeMemoryFromActiveSnapshot ( ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( cachedMemoryVolumeFromSnapshot ) ) { return ; } if ( ( getSnapshotDao ( ) . getNumOfSnapshotsByMemory ( cachedMemoryVolumeFromSnapshot ) ) == 1 ) { removeMemoryVolumes ( cachedMemoryVolumeFromSnapshot , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; }
Source:
public void onBootstrap ( ) { user.setLogoutHandler ( this ) ; initUiCommon ( ) ; initFrontend ( ) ; initLoginModel ( ) ; org.ovirt.engine.ui.common.auth.AutoLoginData autoLoginData = org.ovirt.engine.ui.common.auth.AutoLoginData.instance ( ) ; if ( autoLoginData != null ) { handleAutoLogin ( autoLoginData ) ; } }

Target:
protected void performBootstrap ( ) { user.setLogoutHandler ( this ) ; initUiCommon ( ) ; initFrontend ( ) ; initLoginModel ( ) ; org.ovirt.engine.ui.common.auth.AutoLoginData autoLoginData = org.ovirt.engine.ui.common.auth.AutoLoginData.instance ( ) ; if ( autoLoginData != null ) { handleAutoLogin ( autoLoginData ) ; } org.ovirt.engine.ui.common.restapi.EngineSessionTimeoutData engineSessionTimeoutData = org.ovirt.engine.ui.common.restapi.EngineSessionTimeoutData.instance ( ) ; if ( engineSessionTimeoutData != null ) { restApiSessionManager.setSessionTimeout ( engineSessionTimeoutData.getSessionTimeout ( ) ) ; restApiSessionManager.setHardLimit ( engineSessionTimeoutData.getSessionHardLimit ( ) ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain mockGetExistingDomain ( boolean answerWithDomain ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; if ( answerWithDomain ) { sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.getStorageStaticData ( ) . setConnection ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ) ; domains = java.util.Collections.singletonList ( sd ) ; } org.mockito.Mockito.doReturn ( createQueryReturnValueWith ( domains ) ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; return sd ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain mockGetExistingDomain ( boolean answerWithDomain ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; if ( answerWithDomain ) { sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.getStorageStaticData ( ) . setConnection ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ) ; domains = java.util.Collections.singletonList ( sd ) ; } org.mockito.Mockito.doReturn ( createQueryReturnValueWith ( domains ) ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.QueryParametersBase.class ) ) ; return sd ; }
Source:
private boolean validateNicsLinkedCorrectly ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { org.ovirt.engine.core.bll.validator.VmNicValidator nicValidator = new org.ovirt.engine.core.bll.validator.VmNicValidator ( iface , clusterCompatibilityVersion ) ; if ( ! ( validate ( nicValidator.linkedCorrectly ( ) ) ) ) { return false ; } } return true ; }

Target:
private boolean validateNics ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { org.ovirt.engine.core.bll.validator.VmNicValidator nicValidator = new org.ovirt.engine.core.bll.validator.VmNicValidator ( iface , clusterCompatibilityVersion ) ; if ( ( ! ( validate ( nicValidator.networkNameValid ( ) ) ) ) || ( ! ( validate ( nicValidator.linkedCorrectly ( ) ) ) ) ) { return false ; } } return true ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }
Source:
private void datacenter_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StoragePool datacenter = getDataCenter ( ) . getSelectedItem ( ) ; boolean isInVm = ( getVm ( ) ) != null ; if ( datacenter == null ) { return ; } updateShareableDiskEnabled ( datacenter ) ; updateDirectLunDiskEnabled ( datacenter ) ; updateInterface ( ( isInVm ? getVm ( ) . getVdsGroupCompatibilityVersion ( ) : null ) ) ; if ( ( getDiskStorageType ( ) . getEntity ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { updateStorageDomains ( datacenter ) ; } else { updateHosts ( datacenter ) ; } }

Target:
protected void datacenter_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StoragePool datacenter = getDataCenter ( ) . getSelectedItem ( ) ; boolean isInVm = ( getVm ( ) ) != null ; if ( datacenter == null ) { return ; } updateShareableDiskEnabled ( datacenter ) ; updateDirectLunDiskEnabled ( datacenter ) ; updateInterface ( ( isInVm ? getVm ( ) . getVdsGroupCompatibilityVersion ( ) : null ) ) ; switch ( getDiskStorageType ( ) . getEntity ( ) ) { case IMAGE : case CINDER : updateStorageDomains ( datacenter ) ; break ; default : updateHosts ( datacenter ) ; break ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.StorageServerConnections findConnectionWithSameDetails ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getAllForConnection ( connection ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections dbConnection : connections ) { if ( java.util.Objects.equals ( dbConnection.getpassword ( ) , connection.getpassword ( ) ) ) { return dbConnection ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.StorageServerConnections findConnectionWithSameDetails ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getAllForConnection ( connection ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections dbConnection : connections ) { if ( java.util.Objects.equals ( dbConnection.getPassword ( ) , connection.getPassword ( ) ) ) { return dbConnection ; } } return null ; }
Source:
public void testGetEntityNameByIdAndTypeForCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = dbFacade.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( vdsGroup ) ; java.lang.String name = vdsGroup.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.CLUSTER_ID , VdcObjectType.VdsGroups ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = dbFacade.getClusterDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( cluster ) ; java.lang.String name = cluster.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.CLUSTER_ID , VdcObjectType.Cluster ) ) ) ; }
Source:
public static void GetStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void GetClusterNetworkList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
private void removeUnreportedInterfaces ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface dbNic : dbNics ) { if ( ! ( reportedNicsByNames.containsKey ( dbNic.getName ( ) ) ) ) { interfaceDao.removeInterfaceFromVds ( dbNic.getId ( ) ) ; interfaceDao.removeStatisticsForVds ( dbNic.getId ( ) ) ; } } }

Target:
private boolean nicShouldBeRemoved ( java.lang.String nicName ) { return ! ( reportedNicsByNames.containsKey ( nicName ) ) ; }