auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getParameters ( ) . getMacPoolId ( ) ) ; final org.ovirt.engine.core.bll.MacPoolValidator validator = new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool , null ) ; return ( ( validate ( validator.macPoolExists ( ) ) ) && ( validate ( validator.isNotUsed ( ) ) ) ) && ( validate ( validator.oldMacPoolIsNotDefault ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getParameters ( ) . getMacPoolId ( ) ) ; final org.ovirt.engine.core.bll.MacPoolValidator validator = new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool ) ; return ( ( validate ( validator.macPoolExists ( ) ) ) && ( validate ( validator.notRemovingUsedPool ( ) ) ) ) && ( validate ( validator.notRemovingDefaultPool ( ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean entity = getOptimizeForSpeed ( ) . getEntity ( ) ; if ( entity ) { getGuarantyResources ( ) . setEntity ( true ) ; } getAllowOverbooking ( ) . setIsChangable ( ( ! entity ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( getEnableTrustedService ( ) . getEntity ( ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangable ( true ) ; } }
Source:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
public void getVmTemplatesByBaseTemplateId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid baseTemplate ) { asyncQuery.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.VmTemplate > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesByBaseTemplateId , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( baseTemplate ) , asyncQuery ) ; }
Source:
public void revealPlace ( final java.lang.String placeToken ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { placeManager.revealPlace ( new com.gwtplatform.mvp.shared.proxy.PlaceRequest.Builder ( ) . nameToken ( placeToken ) . build ( ) ) ; } } ) ; }

Target:
public void revealPlace ( final java.lang.String historyToken ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { placeManager.revealPlace ( new com.gwtplatform.mvp.shared.proxy.PlaceRequest.Builder ( ) . nameToken ( historyToken ) . build ( ) ) ; } } ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateSingleHostAttachedToLocalStorage ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = storagePoolDao.getForVdsGroup ( host.getVdsGroupId ( ) ) ; if ( ( storagePool == null ) || ( ! ( storagePool.isLocal ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE ) . unless ( hostStaticDao.getAllForVdsGroup ( host.getVdsGroupId ( ) ) . isEmpty ( ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateSingleHostAttachedToLocalStorage ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = storagePoolDao.getForCluster ( host.getClusterId ( ) ) ; if ( ( storagePool == null ) || ( ! ( storagePool.isLocal ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE ) . unless ( hostStaticDao.getAllForCluster ( host.getClusterId ( ) ) . isEmpty ( ) ) ; }
Source:
public void convertValidPropertiesToString ( ) { org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > propMap = new java.util.LinkedHashMap < > ( ) ; propMap.put ( "speed" , "1024" ) ; propMap.put ( "duplex" , "half" ) ; java.lang.String propStr = utils.convertProperties ( propMap ) ; org.junit.Assert.assertEquals ( "speed=1024;duplex=half" , propStr ) ; }

Target:
public void convertValidPropertiesToString ( ) { org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > propMap = new java.util.LinkedHashMap < > ( ) ; propMap.put ( "speed" , "1024" ) ; propMap.put ( "duplex" , "half" ) ; propMap.put ( "debug" , null ) ; propMap.put ( "verbose" , "" ) ; java.lang.String propStr = utils.convertProperties ( propMap ) ; org.junit.Assert.assertEquals ( "speed=1024;duplex=half;debug=;verbose=" , propStr ) ; }
Source:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { cmd.getParameters ( ) . getVm ( ) . setClusterId ( cluster.getId ( ) ) ; cmd.initEffectiveCompatibilityVersion ( ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Collections.singletonList ( "VirtIO_SCSI" ) ) ) ; org.junit.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }

Target:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { cmd.getParameters ( ) . getVm ( ) . setClusterId ( cluster.getId ( ) ) ; cmd.initEffectiveCompatibilityVersion ( ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.ArgumentMatchers.any ( java.lang.Integer.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Collections.singletonList ( "VirtIO_SCSI" ) ) ) ; org.junit.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.TYPE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.WIPE_AFTER_DELETE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.TYPE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.EXTERNAL_STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ExternalStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.WIPE_AFTER_DELETE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return retval ; }
Source:
private org.ovirt.engine.core.compat.Guid mockSourceImage ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setImageId ( imageId ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > list = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; list.add ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; image.setStorageIds ( list ) ; image.setActualSize ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; image.setSize ( 40 ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( image ) ) . when ( cmd ) . getSourceImages ( ) ; return imageId ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > sdIds = new java.util.ArrayList ( java.util.Arrays.asList ( storageDomainId ) ) ; image.setStorageIds ( sdIds ) ; return image ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { getVmTemplate ( ) . setVdsGroupId ( getVdsGroupId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVmTemplate ( ) , getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVmTemplate ( ) . setVdsGroupId ( getVdsGroupId ( ) ) ; getVmTemplate ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVmTemplate ( ) , getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }
Source:
public org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > getTable ( ) { org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > result = super . getTable ( ) ; if ( ( ( result.getOuterWidget ( ) ) instanceof com.google.gwt.user.client.ui.FlowPanel ) && ( ! ( tableInitialized ) ) ) { com.google.gwt.user.client.ui.FlowPanel tableContainer = ( ( com.google.gwt.user.client.ui.FlowPanel ) ( result.getOuterWidget ( ) ) ) ; addBreadCrumbs ( tableContainer ) ; addActionPanel ( tableContainer ) ; addResultPanel ( ) ; tableInitialized = true ; } return result ; }

Target:
public org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > getTable ( ) { org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > result = super . getTable ( ) ; if ( ( ! ( tableInitialized ) ) && ( ( result.getOuterWidget ( ) ) instanceof com.google.gwt.user.client.ui.FlowPanel ) ) { com.google.gwt.user.client.ui.FlowPanel tableContainer = ( ( com.google.gwt.user.client.ui.FlowPanel ) ( result.getOuterWidget ( ) ) ) ; addBreadCrumbs ( tableContainer ) ; addActionPanel ( tableContainer ) ; result.addStyleName ( org.ovirt.engine.ui.webadmin.section.main.view.AbstractMainTabWithDetailsTableView.OBRAND_MAIN_TAB ) ; addResultPanel ( ) ; tableInitialized = true ; } return result ; }
Source:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public static void GetAllProviders ( 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }
Source:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; log.info ( "Disk has been successfully deleted from Cinder. ID: {}" , getDiskId ( ) ) ; if ( getCommand ( ) . getParameters ( ) . getShouldBeLogged ( ) ) { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( getCommand ( ) , AuditLogType.USER_FINISHED_REMOVE_DISK ) ; } getCommand ( ) . removeDiskFromDb ( ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
private boolean checkIfVolumeExists ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk removedVolume ) { if ( ( removedVolume.getVolumeClassification ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Volume ) ) { return getCinderBroker ( ) . isDiskExist ( removedVolume.getImageId ( ) ) ; } else if ( ( removedVolume.getVolumeClassification ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Snapshot ) ) { return getCinderBroker ( ) . isSnapshotExist ( removedVolume.getImageId ( ) ) ; } else { log.error ( "No valid cinder volume type enum has been initialized in the Cinder disk business entity." ) ; return true ; } }
Source:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void testGetVdsCapabilities ( ) throws java.lang.InterruptedException , java.util.concurrent.ExecutionException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { org.ovirt.vdsm.jsonrpc.client.JsonRpcClient client = org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createStompClient ( org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.HOST_ADDRESS , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.PORT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , 0 , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , true , "TLSv1" ) ; final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getCapabilities" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( client , request ) ; org.junit.Assert.assertTrue ( map.isEmpty ( ) ) ; }

Target:
public void testGetVdsCapabilities ( ) throws java.lang.InterruptedException , java.util.concurrent.ExecutionException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { org.ovirt.vdsm.jsonrpc.client.JsonRpcClient client = org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createStompClient ( org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.HOST_ADDRESS , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.PORT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , 0 , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , true , "TLSv1" , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.DEFAULT_REQUEST_QUEUE , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.DEFAULT_RESPONSE_QUEUE ) ; final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getCapabilities" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( client , request ) ; org.junit.Assert.assertTrue ( map.isEmpty ( ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel getSpecificImportModel ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel model = importFromExportDomainModelProvider.get ( ) ; model.init ( getVmsToImport ( ) , exportDomain.getId ( ) ) ; model.setEntity ( exportDomain.getId ( ) ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importVirtualMachinesTitle ( ) ) ; model.setHelpTag ( HelpTag.import_virtual_machine ) ; model.setHashName ( "import_virtual_machine" ) ; return model ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel getSpecificImportModel ( ) { importVmFromExportDomainModel.setEntity ( null ) ; importVmFromExportDomainModel.init ( getVmsToImport ( ) , exportDomain.getId ( ) ) ; importVmFromExportDomainModel.setEntity ( exportDomain.getId ( ) ) ; return importVmFromExportDomainModel ; }
Source:
public static org.ovirt.engine.ui.common.widget.tab.TabDefinition createTab ( com.gwtplatform.mvp.client.TabData tabData , org.ovirt.engine.ui.common.widget.tab.AbstractTabPanel tabPanel , com.google.gwt.event.shared.EventBus eventBus ) { if ( tabData instanceof org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ) { return new org.ovirt.engine.ui.common.widget.tab.ModelBoundTab ( ( ( org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ) ( tabData ) ) , tabPanel , eventBus ) ; } else { return new org.ovirt.engine.ui.common.widget.tab.SimpleTab ( tabData , tabPanel ) ; } }

Target:
public static org.ovirt.engine.ui.common.widget.tab.TabDefinition createTab ( com.gwtplatform.mvp.client.TabData tabData , org.ovirt.engine.ui.common.widget.tab.AbstractTabPanel tabPanel , com.google.gwt.event.shared.EventBus eventBus ) { if ( tabData instanceof org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ) { return new org.ovirt.engine.ui.common.widget.tab.ModelBoundTab ( ( ( org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ) ( tabData ) ) , tabPanel , eventBus ) ; } else if ( tabData instanceof org.ovirt.engine.ui.common.widget.tab.DynamicTabData ) { return new org.ovirt.engine.ui.common.widget.tab.DynamicTab ( ( ( org.ovirt.engine.ui.common.widget.tab.DynamicTabData ) ( tabData ) ) , tabPanel , eventBus ) ; } else { return new org.ovirt.engine.ui.common.widget.tab.SimpleTab ( tabData , tabPanel ) ; } }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }
Source:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; vmStatic.setdedicated_vm_for_vds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.VM_CANNOT_UPDATE_DEFAULT_VDS_NOT_VALID ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassCanDoAction ( ) ; vmStatic.setvds_group_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with cant change cluster." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.VM_CANNOT_UPDATE_CLUSTER ) ; }
Source:
public void testExecuteQueryCommand ( ) { mcr.mockConfigValue ( ConfigValues.DefaultTimeZone , org.ovirt.engine.core.bll.GetDefualtTimeZoneQueryTest.DEFAULT_TIME_ZONE ) ; getQuery ( ) . executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , java.lang.String > result = ( ( org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertTrue ( "Wrong default time zone" , result.getValue ( ) . equals ( org.ovirt.engine.core.bll.GetDefualtTimeZoneQueryTest.DEFAULT_TIME_ZONE ) ) ; }

Target:
public void testQueryDefaultWindowsTimeZone ( ) { mcr.mockConfigValue ( ConfigValues.DefaultWindowsTimeZone , org.ovirt.engine.core.bll.GetDefualtTimeZoneQueryTest.DEFAULT_WINDOWS_TIME_ZONE ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getTimeZoneType ( ) ) . thenReturn ( TimeZoneType.WINDOWS_TIMEZONE ) ; getQuery ( ) . executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.String result = ( ( java.lang.String ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertTrue ( ( "Wrong default time zone: " + result ) , result.equals ( org.ovirt.engine.core.bll.GetDefualtTimeZoneQueryTest.DEFAULT_WINDOWS_TIME_ZONE ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > getAll ( ) { try { org.openstack.quantum.model.Networks networks = getQuantumClient ( ) . execute ( new org.openstack.quantum.api.networks.ListNetworks ( ) ) ; return map ( networks.getList ( ) ) ; } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.ENGINE , new java.lang.RuntimeException ( e ) ) ; } }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > getAll ( ) { try { com.woorea.openstack.quantum.model.Networks networks = getClient ( ) . networks ( ) . list ( ) . execute ( ) ; return map ( networks.getList ( ) ) ; } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.PROVIDER_FAILURE , e ) ; } }
Source:
public void moveFloatingDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getMoveDiskParametersList ( ) . size ( ) ) ; }

Target:
public void moveFloatingDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; command.init ( ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getMoveDiskParametersList ( ) . size ( ) ) ; }
Source:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( oldHost.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( oldHost.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected org.ovirt.engine.ui.userportal.ApplicationResources getApplicationResources ( ) { return org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.resources ; }

Target:
public org.ovirt.engine.ui.common.widget.ImageWithDecorator getValue ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; com.google.gwt.resources.client.ImageResource changesImage = null ; if ( ( vm != null ) && ( vm.isNextRunConfigurationExists ( ) ) ) { changesImage = org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.resources.vmDelta ( ) ; } return new org.ovirt.engine.ui.common.widget.ImageWithDecorator ( getMainImage ( item ) , changesImage , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_LEFT , org.ovirt.engine.ui.userportal.widget.table.column.VmStatusColumn.DECORATOR_POSITION_TOP ) ; }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToDaily ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public int compareTo ( ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.row11Struct other ) { int returnValue = - 1 ; returnValue = checkNullsAndCompare ( this . var_name , other.var_name ) ; if ( returnValue != 0 ) { return returnValue ; } return returnValue ; }
Source:
private static void modifySettings ( org.ovirt.engine.api.extensions.ExtMap settingKeys , javax.sql.DataSource dataSource ) throws java.sql.SQLException { java.util.List < java.lang.String > updates = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.api.extensions.ExtKey , java.lang.Object > entry : settingKeys.entrySet ( ) ) { updates.add ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "UPDATE settings SET value = '{}' WHERE uuid = '{}'" , entry.getValue ( ) , entry.getKey ( ) . getUuid ( ) . getUuid ( ) ) ) ; } new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( updates ) . execute ( dataSource ) ; }

Target:
private static void modifySettings ( org.ovirt.engine.api.extensions.ExtMap settingKeys , javax.sql.DataSource dataSource ) throws java.sql.SQLException { java.util.List < java.lang.String > updates = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.api.extensions.ExtKey , java.lang.Object > entry : settingKeys.entrySet ( ) ) { updates.add ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "UPDATE settings SET value = WHERE uuid = {}" , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( entry.getValue ( ) ) , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( entry.getKey ( ) . getUuid ( ) . getUuid ( ) ) ) ) ; } new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( updates ) . execute ( dataSource ) ; }
Source:
public void executeCommandTest ( ) { addClusterCommand.executeCommand ( ) ; org.mockito.Mockito.verify ( clusterDao ) . save ( cluster ) ; org.mockito.Mockito.verify ( backend ) . runAction ( org.mockito.Matchers.eq ( VdcActionType.AddCpuProfile ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.CpuProfileParameters.class ) ) ; org.junit.Assert.assertTrue ( addClusterCommand.getReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void executeCommandTest ( ) { addClusterCommand.executeCommand ( ) ; org.mockito.Mockito.verify ( clusterDao ) . save ( cluster ) ; org.mockito.Mockito.verify ( backend ) . runAction ( org.mockito.ArgumentMatchers.eq ( VdcActionType.AddCpuProfile ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.CpuProfileParameters.class ) ) ; org.junit.Assert.assertTrue ( addClusterCommand.getReturnValue ( ) . getSucceeded ( ) ) ; }
Source:
public boolean canBeSelected ( ) { boolean hasVmSpiceSupport = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.hasSpiceSupport ( getEntity ( ) . getOs ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ; return ( getEntity ( ) . getGraphicsInfos ( ) . get ( GraphicsType.SPICE ) . isSet ( ) ) && hasVmSpiceSupport ; }

Target:
public boolean canBeSelected ( ) { boolean hasVmSpiceSupport = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . hasSpiceSupport ( getEntity ( ) . getOs ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ; return ( getEntity ( ) . getGraphicsInfos ( ) . containsKey ( GraphicsType.SPICE ) ) && hasVmSpiceSupport ; }
Source:
public void testgetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > result = dao.getAll ( ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.StorageServerConnectionDAOTest.SERVER_CONNECTION_COUNT , result.size ( ) ) ; }

Target:
public void testSaveServerConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections conn = dao.get ( newServerConnection.getid ( ) ) ; org.junit.Assert.assertNull ( conn ) ; dao.save ( newServerConnection ) ; conn = dao.get ( newServerConnection.getid ( ) ) ; org.junit.Assert.assertEquals ( newServerConnection , conn ) ; }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.statisticssync_3_2.StatisticsSync.disk_usage_historyStruct.commonByteArrayLock ) { try { int length = 0 ; this . history_datetime = readDate ( dis ) ; this . vm_id = ( ( java.lang.Object ) ( dis.readObject ( ) ) ) ; this . disks_usage = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } catch ( java.lang.ClassNotFoundException eCNFE ) { throw new java.lang.RuntimeException ( eCNFE ) ; } } }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.statisticssync_3_2.StatisticsSync.disk_usage_historyStruct.commonByteArrayLock_OVIRT_ENGINE_DWH_StatisticsSync ) { try { int length = 0 ; this . history_datetime = readDate ( dis ) ; this . vm_id = ( ( java.lang.Object ) ( dis.readObject ( ) ) ) ; this . disks_usage = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } catch ( java.lang.ClassNotFoundException eCNFE ) { throw new java.lang.RuntimeException ( eCNFE ) ; } } }
Source:
public void testAttachFailFormatType ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain domainToAttach = createValidStorageDomain ( ) ; domainToAttach.setStorageFormat ( StorageFormatType.V2 ) ; org.junit.Assert.assertFalse ( "Attaching domain with unsupported version succeeded while it should have failed" , cmd.checkDomainCanBeAttached ( domainToAttach ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "Attaching domain with unsupported version failed with the wrong message" , cmd , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL ) ; }

Target:
public void testAttachFailFormatType ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain domainToAttach = createValidStorageDomain ( ) ; domainToAttach.setStorageFormat ( StorageFormatType.V3 ) ; storagePool.setcompatibility_version ( Version.v3_0 ) ; org.junit.Assert.assertFalse ( "Attaching domain with unsupported version succeeded while it should have failed" , cmd.checkDomainCanBeAttached ( domainToAttach ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "Attaching domain with unsupported version failed with the wrong message" , cmd , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( vmId ) == null ? 0 : vmId.hashCode ( ) ) ; result = ( prime * result ) + ( ( vmPoolId ) == null ? 0 : vmPoolId.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( vmId , vmPoolId ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > getLinuxOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; }

Target:
public static boolean isLinuxOsType ( java.lang.Integer osId ) { if ( osId == null ) { return false ; } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsIds.contains ( osId ) ; }
Source:
private long getRequestDiskSpace ( ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getSizeInGigabytes ( ) ; } return 0 ; }

Target:
private long getRequestDiskSpace ( ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return getDiskImageInfo ( ) . getSizeInGigabytes ( ) ; } return 0 ; }
Source:
private org.ovirt.engine.core.common.action.AddDiskParameters getAddDiskParameters ( ) { org.ovirt.engine.core.common.action.AddDiskParameters diskParameters = org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getParameters ( ) . getAddDiskParameters ( ) ; diskParameters.setParentCommand ( org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getActionType ( ) ) ; diskParameters.setParentParameters ( org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getParameters ( ) ) ; diskParameters.setShouldRemainIllegalOnFailedExecution ( true ) ; diskParameters.setSkipDomainCheck ( true ) ; return diskParameters ; }

Target:
private org.ovirt.engine.core.common.action.AddDiskParameters getAddDiskParameters ( ) { org.ovirt.engine.core.common.action.AddDiskParameters diskParameters = org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getParameters ( ) . getAddDiskParameters ( ) ; diskParameters.setParentCommand ( org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getActionType ( ) ) ; diskParameters.setParentParameters ( org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getParameters ( ) ) ; diskParameters.setShouldRemainIllegalOnFailedExecution ( true ) ; diskParameters.setSkipDomainCheck ( true ) ; return diskParameters ; }
Source:
public static void addDiskToVm ( org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getBaseDiskDao ( ) . save ( disk ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , true , false , null , false ) ; }

Target:
public static void addDiskToVm ( org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getBaseDiskDao ( ) . save ( disk ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addDiskDevice ( vmId , disk.getId ( ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getDbFacade ( ) . getIscsiBondDao ( ) . save ( iscsiBond ) ; for ( org.ovirt.engine.core.compat.Guid networkId : networkIds ) { getDbFacade ( ) . getIscsiBondDao ( ) . addNetworkToIscsiBond ( iscsiBond.getId ( ) , networkId ) ; } for ( java.lang.String connectionId : connectionsIds ) { getDbFacade ( ) . getIscsiBondDao ( ) . addStorageConnectionToIscsiBond ( iscsiBond.getId ( ) , connectionId ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getDbFacade ( ) . getIscsiBondDao ( ) . save ( iscsiBond ) ; for ( org.ovirt.engine.core.compat.Guid networkId : iscsiBond.getNetworkIds ( ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . addNetworkToIscsiBond ( iscsiBond.getId ( ) , networkId ) ; } for ( java.lang.String connectionId : iscsiBond.getStorageConnectionIds ( ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . addStorageConnectionToIscsiBond ( iscsiBond.getId ( ) , connectionId ) ; } return null ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildVmGraphicsSpecParamsFromVm ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > infos ) { java.util.Map < java.lang.String , java.lang.Object > specParamsFromVm = null ; if ( ( infos != null ) && ( infos.containsKey ( GraphicsType.SPICE ) ) ) { specParamsFromVm = new java.util.HashMap ( ) ; addVmSpiceOptions ( infos , specParamsFromVm ) ; } return specParamsFromVm ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > buildVmGraphicsSpecParamsFromVm ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > infos ) { java.util.Map < java.lang.String , java.lang.Object > specParamsFromVm = null ; if ( infos != null ) { specParamsFromVm = new java.util.HashMap ( ) ; addVmGraphicsOptions ( infos , specParamsFromVm , false ) ; } return specParamsFromVm ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImageBase nextDiskImageBase ( ) { org.ovirt.engine.core.common.businessentities.DiskImageBase disk = new org.ovirt.engine.core.common.businessentities.DiskImageBase ( ) ; disk.setvolume_type ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.VolumeType.class ) ) ; disk.setvolume_format ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.VolumeFormat.class ) ) ; disk.setWipeAfterDelete ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) ) ; return disk ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImageBase nextDiskImageBase ( ) { org.ovirt.engine.core.common.businessentities.DiskImageBase disk = new org.ovirt.engine.core.common.businessentities.DiskImageBase ( ) ; disk.setVolumeType ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.VolumeType.class ) ) ; disk.setvolumeFormat ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.VolumeFormat.class ) ) ; disk.setWipeAfterDelete ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) ) ; return disk ; }
Source:
private org.ovirt.engine.api.model.StorageDomain getExistingStorageDomain ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > existing = asCollection ( org.ovirt.engine.api.model.StorageDomain.class , getEntity ( java.util.ArrayList.class , VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , cnx.getconnection ( ) ) , ( "Existing storage domains: path=" + ( cnx.getconnection ( ) ) ) ) ) ; return ( existing.size ( ) ) != 0 ? existing.get ( 0 ) : null ; }

Target:
private org.ovirt.engine.api.model.StorageDomain getExistingStorageDomain ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > existing = asCollection ( org.ovirt.engine.api.model.StorageDomain.class , getEntity ( java.util.ArrayList.class , VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , cnx.getConnection ( ) ) , ( "Existing storage domains: path=" + ( cnx.getConnection ( ) ) ) ) ) ; return ( existing.size ( ) ) != 0 ? existing.get ( 0 ) : null ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { org.ovirt.engine.core.compat.Guid clusterId = getParameters ( ) . getConfigParams ( ) . get ( 0 ) . getClusterId ( ) ; if ( ! ( isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( clusterId.toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER_SNAPSHOT , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { org.ovirt.engine.core.compat.Guid clusterId = getParameters ( ) . getConfigParams ( ) . get ( 0 ) . getClusterId ( ) ; if ( ! ( isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( clusterId.toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER_SNAPSHOT , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }
Source:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; canDoActionFailedWithReason ( EngineMessage.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }

Target:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; validateFailedWithReason ( EngineMessage.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }