auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getGlusterBricksForServer ( 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public 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 ) ; }
Source:
public synchronized org.ovirt.engine.api.model.Rsdl getRSDL ( ) throws java.io.IOException , java.lang.ClassNotFoundException { java.lang.String apiVersion = getCurrent ( ) . getApiVersion ( ) ; org.ovirt.engine.api.model.Rsdl rsdl = rsdlByApiVersion.get ( apiVersion ) ; if ( rsdl == null ) { rsdl = org.ovirt.engine.api.rsdl.RsdlManager.loadRsdl ( apiVersion , getCurrent ( ) . getApplicationMode ( ) , getUriInfo ( ) . getBaseUri ( ) . getPath ( ) ) ; rsdlByApiVersion.put ( apiVersion , rsdl ) ; } return rsdl ; }

Target:
public synchronized org.ovirt.engine.api.model.Rsdl getRSDL ( ) throws java.io.IOException , java.lang.ClassNotFoundException { java.lang.String version = getCurrent ( ) . getVersion ( ) ; org.ovirt.engine.api.model.Rsdl rsdl = rsdlByApiVersion.get ( version ) ; if ( rsdl == null ) { rsdl = org.ovirt.engine.api.rsdl.RsdlManager.loadRsdl ( version , getCurrent ( ) . getApplicationMode ( ) , getUriInfo ( ) . getBaseUri ( ) . getPath ( ) ) ; rsdlByApiVersion.put ( version , rsdl ) ; } return rsdl ; }
Source:
public void search ( ) { if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmsRunningOnOrMigratingToVds ( new org.ovirt.engine.ui.uicommonweb.models.hosts.SetRawItemsAsyncQuery ( ) , getEntity ( ) . getId ( ) ) ; } else { setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ) ; } startGridTimer ( ) ; }

Target:
public void search ( ) { if ( ( getEntity ( ) ) != null ) { viewFilterType.executeQuery ( getEntity ( ) . getId ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.SetRawItemsAsyncQuery ( ) ) ; } else { setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ) ; } startGridTimer ( ) ; }
Source:
public void testCanDoActionNonExistingStorageDomain ( ) { org.junit.Assert.assertFalse ( "canDoActtion shouldn't be possible for a non-existant storage domain" , command.canDoAction ( ) ) ; java.util.List < java.lang.String > messages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertEquals ( "Wrong number of messages" , 2 , messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Wrong message" , VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN.name ( ) , messages.get ( 0 ) ) ; org.junit.Assert.assertEquals ( "Wrong message" , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.name ( ) , messages.get ( 1 ) ) ; }

Target:
public void testCanDoActionNonExistingStorageDomain ( ) { org.junit.Assert.assertFalse ( "canDoActtion shouldn't be possible for a non-existant storage domain" , command.canDoAction ( ) ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkMessages ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }
Source:
private void networkNameAvailableTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { this . networks.addAll ( networks ) ; org.mockito.Mockito.when ( network.getName ( ) ) . thenReturn ( DEFAULT_NETWORK_NAME ) ; org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( DEFAULT_GUID ) ; org.junit.Assert.assertThat ( validator.networkNameNotUsed ( ) , matcher ) ; }

Target:
private void networkNameAvailableTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { this . networks.addAll ( networks ) ; org.mockito.Mockito.when ( network.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_NETWORK_NAME ) ; org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.junit.Assert.assertThat ( validator.networkNameNotUsed ( ) , matcher ) ; }
Source:
public void computeVmStartSequence ( java.lang.String cluster , java.lang.String uuid ) { org.ovirt.optimizer.service.ClusterOptimizer clusterOptimizer ; synchronized ( clusterOptimizers ) { clusterOptimizer = clusterOptimizers.get ( cluster ) ; } if ( clusterOptimizer == null ) { log.error ( java.lang.String.format ( "Cluster %s does not exist" , cluster ) ) ; return ; } }

Target:
public void computeVmStart ( java.lang.String cluster , java.lang.String uuid ) { org.ovirt.optimizer.service.ClusterOptimizer clusterOptimizer ; synchronized ( clusterOptimizers ) { clusterOptimizer = clusterOptimizers.get ( cluster ) ; } if ( clusterOptimizer == null ) { log.error ( java.lang.String.format ( "Cluster %s does not exist" , cluster ) ) ; return ; } clusterOptimizer.ensureVmIsRunning ( uuid ) ; }
Source:
private void updateLabelOnNicInstances ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel.LabelOnNic addedLabel : addedLabels ) { if ( ( addedLabel.getNicId ( ) ) == null ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : allNics ) { if ( nic.getName ( ) . equals ( addedLabel.getNicName ( ) ) ) { addedLabel.setNicId ( nic.getId ( ) ) ; break ; } } if ( ( addedLabel.getNicId ( ) ) == null ) { throw new java.lang.IllegalStateException ( "Unable to find requested nic." ) ; } } } }

Target:
private void updateLabelOnNicInstances ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics ) { for ( org.ovirt.engine.core.common.businessentities.network.NicLabel addedLabel : addedLabels ) { if ( ( addedLabel.getNicId ( ) ) == null ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : allNics ) { if ( nic.getName ( ) . equals ( addedLabel.getNicName ( ) ) ) { addedLabel.setNicId ( nic.getId ( ) ) ; break ; } } if ( ( addedLabel.getNicId ( ) ) == null ) { throw new java.lang.IllegalStateException ( "Unable to find requested nic." ) ; } } } }
Source:
protected boolean validateStorageDomains ( ) { org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator storageDomainsValidator = getStorageDomainsValidator ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getStoragePoolId ( ) , getStorageDomainsIds ( ) ) ; return ( ( validate ( storageDomainsValidator.allDomainsExistAndActive ( ) ) ) && ( validate ( storageDomainsValidator.allDomainsWithinThresholds ( ) ) ) ) && ( validate ( storageDomainsValidator.allDomainsHaveSpaceForClonedDisks ( getSourceImages ( ) ) ) ) ; }

Target:
protected boolean validateStorageDomains ( ) { org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator storageDomainsValidator = getStorageDomainsValidator ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getStoragePoolId ( ) , getStorageDomainsIds ( ) ) ; return ( ( validate ( storageDomainsValidator.allDomainsExistAndActive ( ) ) ) && ( validate ( storageDomainsValidator.allDomainsWithinThresholds ( ) ) ) ) && ( validate ( storageDomainsValidator.allDomainsHaveSpaceForClonedDisks ( getSourceImages ( ) ) ) ) ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; if ( callback != null ) { callback.executed ( f ) ; } org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; }

Target:
private void fireAsyncActionFailedEvent ( java.lang.Object target ) { org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , target , true , false ) ; }
Source:
public static java.lang.String getHostByIp ( org.ovirt.engine.core.common.businessentities.VDS host ) { try { final java.net.InetAddress address = java.net.InetAddress.getByName ( host.getHostName ( ) ) ; return address.getHostAddress ( ) . trim ( ) ; } catch ( java.net.UnknownHostException ex ) { final java.lang.String msg = "Failed to resolve host ip by name '{}'" ; org.ovirt.engine.core.utils.NetworkUtils.log.warn ( msg , " Details: '{}' " , host.getHostName ( ) , ex.getCause ( ) ) ; org.ovirt.engine.core.utils.NetworkUtils.log.debug ( msg , host.getHostName ( ) , ex ) ; return null ; } }

Target:
public static java.lang.String getHostIp ( org.ovirt.engine.core.common.businessentities.VDS host ) { try { final java.net.InetAddress address = java.net.InetAddress.getByName ( host.getHostName ( ) ) ; return address.getHostAddress ( ) . trim ( ) ; } catch ( java.net.UnknownHostException ex ) { final java.lang.String msg = "Failed to resolve host ip by name '{}'" ; org.ovirt.engine.core.utils.NetworkUtils.log.warn ( msg , " Details: '{}' " , host.getHostName ( ) , ex.getCause ( ) ) ; org.ovirt.engine.core.utils.NetworkUtils.log.debug ( msg , host.getHostName ( ) , ex ) ; return null ; } }
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:
protected java.lang.String transform ( java.util.ArrayList < java.lang.String > fileNameList , org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return repoImage.getRepoImageId ( ) ; }
Source:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.VmTemplate > aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public void onSucceeded ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; log.debug ( "Removing ImageUpload id {}" , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; getImageTransferDao ( ) . remove ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.endSuccessfully ( ) ; log.info ( "Successfully uploaded (command id '{}')" , getUploadDescription ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; }

Target:
public void onSucceeded ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; log.debug ( "Removing ImageUpload id {}" , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.endSuccessfully ( ) ; log.info ( "Successfully uploaded (command id '{}')" , getUploadDescription ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; }
Source:
public static void getMaximalVmMemSize32OS ( 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 ( ) : 20480 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
private static void initSuspendSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.suspendSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetSuspendSupport ) , callback ) ; }
Source:
public void canUpdateNumaPinning ( ) { paramNumaNodes.clear ( ) ; paramNumaNodes.add ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; mockCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massUpdateNumaNode ( org.mockito.Matchers.eq ( paramNumaNodes ) ) ; }

Target:
public void canUpdateNumaPinning ( ) { paramNumaNodes.clear ( ) ; paramNumaNodes.add ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; mockCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massUpdateNumaNode ( org.mockito.ArgumentMatchers.eq ( paramNumaNodes ) ) ; }
Source:
private void saveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( storageModel.getSelectedItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { OnSaveSanStorage ( ) ; } else { forceCreationWarning ( usedLunsMessages ) ; } }

Target:
private void onSaveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; if ( ( confirmationModel != null ) && ( ! ( confirmationModel.validate ( ) ) ) ) { return ; } cancelConfirm ( ) ; getWindow ( ) . startProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveSan" } ) ) ) . Run ( ) ; }
Source:
public void passDiscardNotSupportedForDestSd ( ) { diskToDiskVmElements.put ( diskWithTwoVmElements , java.util.Arrays.asList ( diskVmElement2 , diskVmElement3 ) ) ; initMultipleDiskVmElementValidator ( ) ; mockDiskVmElementValidatorPassDiscardValidation ( diskWithTwoVmElements , diskVmElement2 , ValidationResult.VALID ) ; mockDiskVmElementValidatorPassDiscardValidation ( diskWithTwoVmElements , diskVmElement3 , getPassDiscardNotSupportedByDiskInterfaceValResult ( diskWithTwoVmElements ) ) ; org.junit.Assert.assertThat ( multipleDiskVmElementValidator.isPassDiscardSupportedForDestSd ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( getPassDiscardNotSupportedByDiskInterfaceValResult ( diskWithTwoVmElements ) ) ) ; }

Target:
public void passDiscardNotSupportedForDestSd ( ) { diskToDiskVmElements.put ( diskWithTwoVmElements , java.util.Arrays.asList ( diskVmElement2 , diskVmElement3 ) ) ; initMultipleDiskVmElementValidator ( ) ; mockDiskVmElementValidatorPassDiscardValidation ( diskWithTwoVmElements , diskVmElement2 , ValidationResult.VALID ) ; mockDiskVmElementValidatorPassDiscardValidation ( diskWithTwoVmElements , diskVmElement3 , getPassDiscardNotSupportedByDiskInterfaceValResult ( diskWithTwoVmElements ) ) ; org.hamcrest.MatcherAssert.assertThat ( multipleDiskVmElementValidator.isPassDiscardSupportedForDestSd ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( getPassDiscardNotSupportedByDiskInterfaceValResult ( diskWithTwoVmElements ) ) ) ; }
Source:
static org.ovirt.engine.core.common.businessentities.network.BondMode getBondMode ( java.lang.String bondOptions ) { if ( bondOptions == null ) { return null ; } java.lang.String bondModeValue = org.ovirt.engine.core.common.businessentities.network.BondMode.findMode ( bondOptions ) ; if ( bondModeValue == null ) { return null ; } for ( org.ovirt.engine.core.common.businessentities.network.BondMode bondMode : org.ovirt.engine.core.common.businessentities.network.BondMode.values ( ) ) { if ( bondMode.getValue ( ) . equals ( bondModeValue ) ) { return bondMode ; } } return null ; }

Target:
static org.ovirt.engine.core.common.businessentities.network.BondMode parseBondMode ( java.lang.String bondOptions ) { return bondOptions == null ? null : org.ovirt.engine.core.common.businessentities.network.BondMode.getBondMode ( org.ovirt.engine.core.common.businessentities.network.BondMode.findMode ( bondOptions ) ) ; }
Source:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( org.ovirt.engine.core.bll.BaseImagesCommand.getParameters ( ) . isImportEntity ( ) ) ? getDestinationDiskImage ( ) : getDiskImage ( ) ; diskImage.setimageStatus ( imageStatus ) ; getImageDao ( ) . update ( diskImage.getImage ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DiskImage getRelevantDiskImage ( ) { return org.ovirt.engine.core.bll.BaseImagesCommand.getParameters ( ) . isImportEntity ( ) ? getDestinationDiskImage ( ) : getDiskImage ( ) ; }
Source:
public void testAddVmsForExistingAffinityGroup ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup existing = dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.AffinityGroupDaoTest.NUM_OF_VMS_IN_EXISTING_AFFINITY_GROUP , existing.getEntityNames ( ) . size ( ) ) ; existing.getEntityIds ( ) . add ( FixturesTool.VM_RHEL5_POOL_51 ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.scheduling.AffinityGroup fetched = dao.get ( existing.getId ( ) ) ; org.junit.Assert.assertEquals ( ( ( org.ovirt.engine.core.dao.AffinityGroupDaoTest.NUM_OF_VMS_IN_EXISTING_AFFINITY_GROUP ) + 1 ) , fetched.getEntityNames ( ) . size ( ) ) ; }

Target:
public void testAddVmsForExistingAffinityGroup ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup existing = dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.AffinityGroupDaoTest.NUM_OF_VMS_IN_EXISTING_AFFINITY_GROUP , existing.getVmEntityNames ( ) . size ( ) ) ; existing.getVmIds ( ) . add ( FixturesTool.VM_RHEL5_POOL_51 ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.scheduling.AffinityGroup fetched = dao.get ( existing.getId ( ) ) ; org.junit.Assert.assertEquals ( ( ( org.ovirt.engine.core.dao.AffinityGroupDaoTest.NUM_OF_VMS_IN_EXISTING_AFFINITY_GROUP ) + 1 ) , fetched.getVmEntityNames ( ) . size ( ) ) ; }
Source:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( 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.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( vm.getImages ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( vm.getImages ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.compat.Guid networkId = entity.getId ( ) ; org.ovirt.engine.core.common.businessentities.IscsiBond bond = getBond ( ) ; bond.getNetworkIds ( ) . add ( networkId ) ; return performCreate ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( bond ) , new org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworksResource.AddedNetworkResolver ( networkId ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.IscsiBond getIscsiBond ( ) { return getEntity ( org.ovirt.engine.core.common.businessentities.IscsiBond.class , VdcQueryType.GetIscsiBondById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( iscsiBondId ) , iscsiBondId.toString ( ) ) ; }
Source:
public void testAddTag ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNull ( tagFromDirector ) ; tagsDirector.addTag ( tag ) ; tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( tag , tagFromDirector ) ; }

Target:
public void testAddTag ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tagFromDirector = tagsDirector.getTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNull ( tagFromDirector ) ; tagsDirector.addTag ( tag ) ; tagFromDirector = tagsDirector.getTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( tag , tagFromDirector ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.core.bll.GetHostArchitectureQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetHostArchitectureQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.common.businessentities.ServerCpu sc = cpuFlagsManagerHandler.findMaxServerCpuByFlags ( host.getCpuFlags ( ) , host.getClusterCompatibilityVersion ( ) ) ; org.ovirt.engine.core.bll.GetHostArchitectureQuery.getQueryReturnValue ( ) . setReturnValue ( ( sc == null ? org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined : sc.getArchitecture ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS host = vdsDao.get ( org.ovirt.engine.core.bll.GetHostArchitectureQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.common.businessentities.ServerCpu sc = cpuFlagsManagerHandler.findMaxServerCpuByFlags ( host.getCpuFlags ( ) , host.getClusterCompatibilityVersion ( ) ) ; org.ovirt.engine.core.bll.GetHostArchitectureQuery.getQueryReturnValue ( ) . setReturnValue ( ( sc == null ? org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined : sc.getArchitecture ( ) ) ) ; }
Source:
private void UnsubscribeList ( java.lang.Iterable list ) { if ( list == null ) { return ; } for ( java.lang.Object a : list ) { org.ovirt.engine.core.compat.IProvidePropertyChangedEvent notifier = ( ( org.ovirt.engine.core.compat.IProvidePropertyChangedEvent ) ( ( a instanceof org.ovirt.engine.core.compat.IProvidePropertyChangedEvent ) ? a : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . removeListener ( this ) ; } } }

Target:
private void UnsubscribeList ( java.lang.Iterable list ) { if ( list == null ) { return ; } for ( java.lang.Object a : list ) { org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent notifier = ( ( org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ( ( a instanceof org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ? a : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . removeListener ( this ) ; } } }
Source:
public void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.StringBuilder configBuilder = new java.lang.StringBuilder ( ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; writeOVirtSection ( configBuilder ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , configBuilder.toString ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.StringBuilder configBuilder = new java.lang.StringBuilder ( ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; writeOVirtSection ( configBuilder , getOptions ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , configBuilder.toString ( ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ( ( result.getReturnValue ( ) ) == null ) || ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) ) { return ; } sourceListModel.getSearchCommand ( ) . execute ( ) ; cancel ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getPreviousHost ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { org.ovirt.engine.core.compat.Guid previousProxyHostId = getVmwarePropertiesModel ( ) . getLastProxyHostId ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( host.getId ( ) . equals ( previousProxyHostId ) ) { return host ; } } return null ; }
Source:
private org.ovirt.engine.api.model.Disk map ( org.ovirt.engine.core.common.businessentities.storage.DiskImage entity , org.ovirt.engine.api.model.Disk template ) { return getMapper ( org.ovirt.engine.api.model.Disk.class , org.ovirt.engine.api.model.Disk.class ) . map ( entity , template ) ; }

Target:
private org.ovirt.engine.api.model.DiskAttachment map ( org.ovirt.engine.core.common.businessentities.storage.DiskImage entity , org.ovirt.engine.api.model.DiskAttachment template ) { org.ovirt.engine.api.model.Disk disk = getMapper ( org.ovirt.engine.api.model.Disk.class , org.ovirt.engine.api.model.Disk.class ) . map ( entity , null ) ; org.ovirt.engine.api.model.DiskAttachment diskAttachment = new org.ovirt.engine.api.model.DiskAttachment ( ) ; diskAttachment.setDisk ( disk ) ; return diskAttachment ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( getId ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getGlusterServerUuid ( ) ) == null ? 0 : getGlusterServerUuid ( ) . hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( getId ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getGlusterServerUuid ( ) ) == null ? 0 : getGlusterServerUuid ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getKnownAddresses ( ) ) == null ? 0 : getKnownAddresses ( ) . hashCode ( ) ) ; return result ; }
Source:
public void testSelectionRestoredOnNewSetItems ( ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel < java.lang.Void , java.lang.Integer > listModel = org.mockito.Mockito.mock ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.class , org.mockito.Mockito.withSettings ( ) . useConstructor ( ) . defaultAnswer ( Answers.CALLS_REAL_METHODS ) ) ; listModel.setItems ( java.util.Arrays.asList ( 1 , 2 , 3 ) ) ; listModel.setSelectedItem ( 2 ) ; listModel.setItems ( java.util.Arrays.asList ( 1 , 2 ) ) ; org.junit.Assert.assertEquals ( ( ( java.lang.Integer ) ( 2 ) ) , listModel.getSelectedItem ( ) ) ; }

Target:
public void testSelectionRestoredOnNewSetItems ( ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel < java.lang.Void , java.lang.Integer > listModel = org.mockito.Mockito.mock ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.class , org.mockito.Mockito.withSettings ( ) . useConstructor ( ) . defaultAnswer ( Answers.CALLS_REAL_METHODS ) ) ; listModel.setItems ( java.util.Arrays.asList ( 1 , 2 , 3 ) ) ; listModel.setSelectedItem ( 2 ) ; listModel.setItems ( java.util.Arrays.asList ( 1 , 2 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( ( ( java.lang.Integer ) ( 2 ) ) , listModel.getSelectedItem ( ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.DISK_ID } , getEntity ( 1 , true ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskAndSnapshotsByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.DISK_ID } , getEntity ( 1 , true ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void beforeCommandExecuted ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . beforeCommandExecuted ( command ) ; if ( command == ( model.getDefaultCommand ( ) ) ) { removeListeners ( model ) ; getView ( ) . flushToPrivateModel ( ) ; org.ovirt.engine.ui.userportal.section.main.presenter.popup.console.ConsoleModelChangedEvent.fire ( getEventBus ( ) , ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( model.getModel ( ) . getSelectedItem ( ) ) ) ) ; } }

Target:
protected void beforeCommandExecuted ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . beforeCommandExecuted ( command ) ; if ( command == ( model.getDefaultCommand ( ) ) ) { removeListeners ( model ) ; getView ( ) . flushToPrivateModel ( ) ; org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.fire ( getEventBus ( ) , model.getModel ( ) ) ; } }
Source:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( templateEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( instanceTypesEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( resourceAllocationTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( instanceTypesEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( templateWithVersionEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( resourceAllocationTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }
Source:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > getExistingIfaces ( ) { if ( ( existingIfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = getDbFacade ( ) . getInterfaceDAO ( ) . getAllInterfacesForVds ( params.getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : ifaces ) { iface.setNetworkImplementationDetails ( org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( getExistingClusterNetworks ( ) , iface ) ) ; } existingIfaces = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( ifaces ) ; } return existingIfaces ; }

Target:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > getExistingIfaces ( ) { if ( ( existingIfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( params.getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : ifaces ) { iface.setNetworkImplementationDetails ( org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( getExistingClusterNetworks ( ) , iface ) ) ; } existingIfaces = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( ifaces ) ; } return existingIfaces ; }
Source:
protected void update ( boolean valid , boolean executeCommandResult , int getConnectionExecTimes ) throws java.lang.Exception { for ( int i = 0 ; i < getConnectionExecTimes ; i ++ ) { setUpGetEntityExpectations ( ) ; } setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateStorageServerConnection , org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , executeCommandResult ) ) ; verifyModel ( resource.update ( getModel ( 3 ) ) , 3 ) ; }

Target:
protected void update ( boolean valid , boolean executeCommandResult , int getConnectionExecTimes ) throws java.lang.Exception { for ( int i = 0 ; i < getConnectionExecTimes ; i ++ ) { setUpGetEntityExpectations ( ) ; } setUriInfo ( setUpActionExpectations ( ActionType.UpdateStorageServerConnection , org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , executeCommandResult ) ) ; verifyModel ( resource.update ( getModel ( 3 ) ) , 3 ) ; }
Source:
private static java.util.Map < java.lang.String , java.lang.Object > getMemExpr ( int numOfMonitors , boolean singleQxlPci ) { int heads = ( singleQxlPci ) ? numOfMonitors : 1 ; java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.HEADS , java.lang.String.valueOf ( heads ) ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.VRAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciVRamByHeads ( heads ) ) ; if ( singleQxlPci ) { specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.RAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciRamByHeads ( heads ) ) ; } return specParams ; }

Target:
private static java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( int numOfMonitors , boolean singleQxlPci ) { int heads = ( singleQxlPci ) ? numOfMonitors : 1 ; java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.HEADS , java.lang.String.valueOf ( heads ) ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.VRAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciVRamByHeads ( heads ) ) ; if ( singleQxlPci ) { specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.RAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciRamByHeads ( heads ) ) ; } return specParams ; }
Source:
public void testIsNetworkInSyncWhenStaticBootProtocolAddressDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
private void initIpv4ConfigurationBootProtocolNetmask ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol networkBootProtocol , boolean syncNetmask ) { initIpv4ConfigurationStaticBootProtocol ( networkBootProtocol ) ; ipv4Address.setNetmask ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_NETMASK ) ; iface.setIpv4Subnet ( ( syncNetmask ? org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_NETMASK : null ) ) ; }
Source:
public void doParse_unhandledFieldTypeRecursion ( ) throws com.google.gwt.core.ext.UnableToCompleteException { java.util.Set < ? extends com.google.gwt.core.ext.typeinfo.JClassType > ownerTypeParentFieldTypeSubField1TypeFlattenedSupertypeHierarchy = new java.util.HashSet ( java.util.Arrays.asList ( ownerTypeParentFieldTypeSubField1Type ) ) ; org.mockito.Mockito.doReturn ( ownerTypeParentFieldTypeSubField1TypeFlattenedSupertypeHierarchy ) . when ( ownerTypeParentFieldTypeSubField1Type ) . getFlattenedSupertypeHierarchy ( ) ; org.mockito.Mockito.when ( ownerTypeParentFieldTypeSubField1Type.getFields ( ) ) . thenReturn ( new com.google.gwt.core.ext.typeinfo.JField [ ] { ownerTypeParentField } ) ; tested.doParse ( ownerType , new java.util.ArrayList < com.google.gwt.core.ext.typeinfo.JClassType > ( ) , "." , "IdPrefix" ) ; }

Target:
public void doParse_unhandledFieldTypeRecursion ( ) throws com.google.gwt.core.ext.UnableToCompleteException { java.util.Set < ? extends com.google.gwt.core.ext.typeinfo.JClassType > ownerTypeParentFieldTypeSubField1TypeFlattenedSupertypeHierarchy = java.util.Collections.singleton ( ownerTypeParentFieldTypeSubField1Type ) ; org.mockito.Mockito.doReturn ( ownerTypeParentFieldTypeSubField1TypeFlattenedSupertypeHierarchy ) . when ( ownerTypeParentFieldTypeSubField1Type ) . getFlattenedSupertypeHierarchy ( ) ; org.mockito.Mockito.when ( ownerTypeParentFieldTypeSubField1Type.getFields ( ) ) . thenReturn ( new com.google.gwt.core.ext.typeinfo.JField [ ] { ownerTypeParentField } ) ; tested.doParse ( ownerType , new java.util.ArrayList < com.google.gwt.core.ext.typeinfo.JClassType > ( ) , "." , "IdPrefix" ) ; }
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.AddVmFromSnapshotCommand.getVdsGroupId ( ) , getStoragePoolId ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.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 : vmFromConfiguration.getInterfaces ( ) ) { vnicProfileHelper.updateNicWithVnicProfileForUser ( iface , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getCurrentUser ( ) ) ; } vnicProfileHelper.auditInvalidInterfaces ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVmName ( ) ) ; super . addVmNetwork ( ) ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getSnapshot ( ) ) ; getSnapshotDao ( ) . updateStatus ( sourceSnapshotId , SnapshotStatus.LOCKED ) ; lockVmWithCompensationIfNeeded ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private void processHeartbeat ( ) { if ( ( ( ! ( this . isInInit ( ) ) ) && ( this . policy.isHeartbeat ( ) ) ) && ( ( ( this . lastHeartbeat ) + ( this . policy.getHeartbeat ( ) ) ) < ( java.lang.System.currentTimeMillis ( ) ) ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.debug ( "Heartbeat exeeded. Closing channel" ) ; this . disconnect ( ) ; } }

Target:
private void processHeartbeat ( ) { if ( ( ( ! ( this . isInInit ( ) ) ) && ( this . policy.isHeartbeat ( ) ) ) && ( ( ( this . lastHeartbeat ) + ( this . policy.getHeartbeat ( ) ) ) < ( java.lang.System.currentTimeMillis ( ) ) ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.debug ( "Heartbeat exeeded. Closing channel" ) ; this . disconnect ( "Heartbeat exeeded" ) ; } }