auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
public void testCompleteWhenNicNameReferencesExistingNic ( ) { org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleterTest.TestAccessors withNameSet = new org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleterTest.TestAccessors ( ) ; withNameSet.setName ( nic.getName ( ) ) ; completer.complete ( withNameSet ) ; org.junit.Assert.assertThat ( withNameSet.getName ( ) , org.hamcrest.CoreMatchers.is ( nic.getName ( ) ) ) ; org.junit.Assert.assertThat ( withNameSet.getId ( ) , org.hamcrest.CoreMatchers.is ( nic.getId ( ) ) ) ; }

Target:
public void testCompleteWhenNicNameReferencesExistingNic ( ) { org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleterTest.TestAccessors withNameSet = new org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleterTest.TestAccessors ( ) ; withNameSet.setName ( nic.getName ( ) ) ; completer.complete ( withNameSet ) ; org.hamcrest.MatcherAssert.assertThat ( withNameSet.getName ( ) , org.hamcrest.CoreMatchers.is ( nic.getName ( ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( withNameSet.getId ( ) , org.hamcrest.CoreMatchers.is ( nic.getId ( ) ) ) ; }
Source:
public void testAllowRhel6InRhel7 ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 7Server - 1.el7" ) ; vds.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; cluster.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertFalse ( vds.getStatus ( ) . equals ( VDSStatus.NonOperational ) ) ; }

Target:
public void testAllowRhel6InRhel7 ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 7Server - 1.el7" ) ; vds.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; cluster.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertNotEquals ( vds.getStatus ( ) , VDSStatus.NonOperational ) ; }
Source:
protected void executeCommand ( ) { AddCustomValue ( "InterfaceType" , org.ovirt.engine.core.common.businessentities.VmInterfaceType.forValue ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) . getType ( ) ) . getInterfaceTranslation ( ) . toString ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . update ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) ) ; org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { AddCustomValue ( "InterfaceType" , org.ovirt.engine.core.common.businessentities.VmInterfaceType.forValue ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) . getType ( ) ) . getInterfaceTranslation ( ) . toString ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . update ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) ) ; org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.setSucceeded ( true ) ; }
Source:
protected void updateActionAvailability ( ) { super . updateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( getEntity ( ) ) != null ) && ( ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isWindowsOsType ( getEntity ( ) . getVmOsId ( ) ) ) ) ) ; }

Target:
public boolean canConnect ( ) { return ( ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isWindowsOsType ( getEntity ( ) . getVmOsId ( ) ) ) ; }
Source:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) ; getStorageServerConnectionDao ( ) . remove ( connectionId ) ; log.infoFormat ( "Removing connection {0} from database " , connectionId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) ) ) { log.info ( "No vdsId passed - hosts will not be disconnected." ) ; } else { org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; } org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) ; getStorageServerConnectionDao ( ) . remove ( connectionId ) ; log.info ( "Removing connection '{}' from database " , connectionId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) ) ) { log.info ( "No vdsId passed - hosts will not be disconnected." ) ; } else { org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; } org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }
Source:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VM > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VM > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { return object.getName ( ) ; } } ; getTable ( ) . addColumn ( nameColumn , constants.nameVm ( ) , "300px" ) ; }

Target:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VM > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VM > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { return object.getName ( ) ; } } ; nameColumn.makeSortable ( ) ; getTable ( ) . addColumn ( nameColumn , constants.nameVm ( ) , "300px" ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStoragePoolDAO ( ) ) ; existingPool = dao.get ( new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; existingPool.setstatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; vdsGroup = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; newPool.setname ( "newPoolDude" ) ; newPool.setcompatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.0" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStoragePoolDao ( ) ) ; existingPool = dao.get ( new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; existingPool.setstatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; vdsGroup = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; newPool.setname ( "newPoolDude" ) ; newPool.setcompatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.0" ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getDisksStorageDomainId ( ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : org.ovirt.engine.core.bll.AddDiskCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getStorageIds ( ) . get ( 0 ) ; } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private org.ovirt.engine.core.compat.Guid getDisksStorageDomainId ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : org.ovirt.engine.core.bll.AddDiskCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) . getStorageIds ( ) . get ( 0 ) ; } } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public void testGetAllForRunningForVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDynamic > result = dao.getAllRunningForVds ( org.ovirt.engine.core.dao.VmDynamicDaoTest.VDS_STATIC_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDynamicDaoTest.DYNAMIC_RUNNING_COUNT , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDynamic vmdynamic : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDynamicDaoTest.VDS_STATIC_ID , vmdynamic.getRunOnVds ( ) ) ; } }

Target:
public void testGetAllForRunningForVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDynamic > result = dao.getAllRunningForVds ( FixturesTool.VDS_RHEL6_NFS_SPM ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDynamicDaoTest.DYNAMIC_RUNNING_COUNT , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDynamic vmdynamic : result ) { org.junit.Assert.assertEquals ( FixturesTool.VDS_RHEL6_NFS_SPM , vmdynamic.getRunOnVds ( ) ) ; } }
Source:
private void removeNetworkFromHosts ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = org.ovirt.engine.core.bll.network.cluster.DetachNetworkToVdsGroupCommand.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesByLabelForCluster ( org.ovirt.engine.core.bll.network.cluster.DetachNetworkToVdsGroupCommand.getParameters ( ) . getVdsGroupId ( ) , getNetwork ( ) . getLabel ( ) ) ; org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder builder = new org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder ( getNetwork ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.cluster.DetachNetworkToVdsGroupCommand.getBackend ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network getPersistedNetwork ( ) { if ( ( persistedNetwork ) == null ) { persistedNetwork = org.ovirt.engine.core.bll.network.cluster.DetachNetworkToVdsGroupCommand.getNetworkDAO ( ) . get ( getNetwork ( ) . getId ( ) ) ; } return persistedNetwork ; }
Source:
protected void doEdit ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel model ) { org.ovirt.engine.ui.common.widget.uicommon.template.TemplateGeneralModelForm.Driver.driver.edit ( model ) ; monitorCount.setText ( java.lang.Integer.toString ( getModel ( ) . getMonitorCount ( ) ) ) ; isStateless.setText ( java.lang.Boolean.toString ( getModel ( ) . getIsStateless ( ) ) ) ; }

Target:
protected void doEdit ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel model ) { driver.edit ( model ) ; monitorCount.setText ( java.lang.Integer.toString ( getModel ( ) . getMonitorCount ( ) ) ) ; isStateless.setText ( java.lang.Boolean.toString ( getModel ( ) . getIsStateless ( ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepConfigReset" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "key" , configKey ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepConfigReset" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "optionName" , configKey ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void setUpContainer ( ) { org.mockito.Mockito.when ( engineSessionDao.remove ( org.mockito.Matchers.any ( java.lang.Long.class ) ) ) . thenReturn ( 1 ) ; org.mockito.Mockito.when ( ssoSessionValidator.isSessionValid ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( true ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.aaa.DbUser.class ) ; container.setSSOSessionValidaor ( ssoSessionValidator ) ; container.setUser ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , user ) ; }

Target:
public void setUpContainer ( ) { org.mockito.Mockito.when ( engineSessionDao.remove ( org.mockito.Matchers.any ( java.lang.Long.class ) ) ) . thenReturn ( 1 ) ; org.mockito.Mockito.when ( ssoSessionValidator.isSessionValid ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( ssoSessionUtils.isSessionInUse ( org.mockito.Matchers.anyLong ( ) ) ) . thenReturn ( false ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.aaa.DbUser.class ) ; container.setUser ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , user ) ; }
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network networkA , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachment ( networkA , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; attachment.setNicId ( nic.getId ( ) ) ; attachment.setNicName ( nic.getName ( ) ) ; return attachment ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network networkA , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.compat.Guid guid ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachment ( networkA , guid ) ; if ( nic != null ) { attachment.setNicId ( nic.getId ( ) ) ; attachment.setNicName ( nic.getName ( ) ) ; } return attachment ; }
Source:
public static void getStorageDomainMaxNameLength ( 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.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void validateSpaceNotEnough ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertFalse ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void validateSpaceNotEnough ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult diskImagesBelongToSameImageGroup ( ) { org.ovirt.engine.core.compat.Guid imageGroupId = null ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( imageGroupId == null ) || ( diskImage.getId ( ) . equals ( imageGroupId ) ) ) { imageGroupId = diskImage.getId ( ) ; continue ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISKS_SNAPSHOTS_DONT_BELONG_TO_SAME_DISK ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult diskImagesBelongToSameImageGroup ( ) { org.ovirt.engine.core.compat.Guid imageGroupId = null ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( imageGroupId == null ) || ( diskImage.getId ( ) . equals ( imageGroupId ) ) ) { imageGroupId = diskImage.getId ( ) ; continue ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_SNAPSHOTS_DONT_BELONG_TO_SAME_DISK ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; setTitle ( ( disk.isBoot ( ) ? constants.bootableDisk ( ) : null ) ) ; return disk.isBoot ( ) ? resources.bootableDiskIcon ( ) : null ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return disk.getLun ( ) . getSerial ( ) ; }
Source:
public void testNotValidCustomProerties ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_0 ) ; vm.setCustomProperties ( "property=value;" ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; org.junit.Assert.assertFalse ( runVmValidator.validateVmProperties ( vm , messages ) ) ; org.junit.Assert.assertFalse ( messages.isEmpty ( ) ) ; }

Target:
public void testNotValidCustomProerties ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_0 ) ; vm.setCustomProperties ( "property=value;" ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( runVmValidator.validateVmProperties ( vm , messages ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( messages.isEmpty ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( changedArgs.propertyName.contains ( "Alert" ) ) { updateAlerts ( getView ( ) , model ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( args.propertyName.contains ( "Alert" ) ) { updateAlerts ( getView ( ) , model ) ; } }
Source:
private org.ovirt.engine.api.model.User getUser ( ) { org.ovirt.engine.api.model.User user = new org.ovirt.engine.api.model.User ( ) ; user.setName ( "admin" ) ; user.setId ( GUIDS [ 1 ] . toString ( ) ) ; return user ; }

Target:
private org.ovirt.engine.api.model.User getUser ( ) { org.ovirt.engine.api.model.User user = new org.ovirt.engine.api.model.User ( ) ; user.setUserName ( "admin" ) ; user.setId ( GUIDS [ 1 ] . toString ( ) ) ; org.ovirt.engine.api.model.Domain domain = new org.ovirt.engine.api.model.Domain ( ) ; domain.setName ( "internal" ) ; user.setDomain ( domain ) ; return user ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel < T , P > qosListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel ) ( model ) ) ; qosListModel.setItems ( ( ( java.util.ArrayList < T > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.QosQueryParameterBase ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getEntity ( ) . getId ( ) , getQosType ( ) ) ; parameters.setRefresh ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllQosByStoragePoolIdAndType , parameters , new org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.SetItemsAsyncQuery ( ) ) ; }
Source:
protected void syncSearch ( ) { org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; tempVar.setRefresh ( getIsQueryFirstTime ( ) ) ; tempVar.setAllUsersWithPermission ( getAllUsersWithPermission ( ) ) ; super . syncSearch ( VdcQueryType.GetPermissionsForObject , tempVar ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; tempVar.setRefresh ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel.getIsQueryFirstTime ( ) ) ; tempVar.setAllUsersWithPermission ( getAllUsersWithPermission ( ) ) ; super . syncSearch ( VdcQueryType.GetPermissionsForObject , tempVar ) ; }
Source:
public static void GetPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }

Target:
public static void GetRpmVersionViaPublic ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void testNetworkExistsWhenValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; java.lang.String variableReplacements = "a" ; org.ovirt.engine.core.bll.ValidationResult propagatedResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_NOT_EXISTS , variableReplacements ) ; org.mockito.Mockito.when ( networkValidatorMock.networkIsSet ( ) ) . thenReturn ( propagatedResult ) ; org.junit.Assert.assertThat ( "ValidationResult is not correctly propagated" , networkAttachmentValidatorSpy.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_NOT_EXISTS , variableReplacements ) ) ; }

Target:
public void testNetworkExistWhenNeitherIdNorNameIsSpecified ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( networkAttachment ) ; org.junit.Assert.assertThat ( validator.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_NETWORK_ID_OR_NAME_IS_NOT_SET ) ) ; }
Source:
protected org.ovirt.engine.core.dao.qos.QosDao < ? > getQosDao ( ) { org.ovirt.engine.core.common.businessentities.qos.QosType qosType = getParameters ( ) . getQosType ( ) ; if ( qosType == null ) { qosType = org.ovirt.engine.core.common.businessentities.qos.QosType.STORAGE ; } switch ( qosType ) { case STORAGE : qosDao = getDbFacade ( ) . getStorageQosDao ( ) ; break ; default : break ; } return qosDao ; }

Target:
protected org.ovirt.engine.core.dao.qos.QosDao < ? > getQosDao ( ) { org.ovirt.engine.core.common.businessentities.qos.QosType qosType = getParameters ( ) . getQosType ( ) ; if ( qosType == null ) { return getDbFacade ( ) . getQosBaseDao ( ) ; } switch ( qosType ) { case STORAGE : qosDao = getDbFacade ( ) . getStorageQosDao ( ) ; break ; case CPU : qosDao = getDbFacade ( ) . getCpuQosDao ( ) ; break ; default : log.debugFormat ( "Not handled QoS type: {0}" , qosType ) ; break ; } return qosDao ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.StorageType storageType , java.lang.String template ) { switch ( storageType ) { case ISCSI : return StorageType.ISCSI.value ( ) ; case FCP : return StorageType.FCP.value ( ) ; case NFS : return StorageType.NFS.value ( ) ; case LOCALFS : return StorageType.LOCALFS.value ( ) ; case POSIXFS : return StorageType.POSIXFS.value ( ) ; default : return null ; } }

Target:
public static java.lang.String map ( org.ovirt.engine.api.model.StorageType storageType , java.lang.String template ) { switch ( storageType ) { case ISCSI : return StorageType.ISCSI.value ( ) ; case FCP : return StorageType.FCP.value ( ) ; case NFS : return StorageType.NFS.value ( ) ; case LOCALFS : return StorageType.LOCALFS.value ( ) ; case POSIXFS : return StorageType.POSIXFS.value ( ) ; case GLUSTERFS : return StorageType.GLUSTERFS.value ( ) ; default : return null ; } }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; }

Target:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > > aQuery , boolean doRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters params = new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? params : params.withoutRefresh ( ) ) , aQuery ) ; }
Source:
private void failureEventHandler ( final java.lang.String errorMessage ) { failureEventHandler ( null , errorMessage ) ; }

Target:
private void failureEventHandler ( final java.lang.Throwable caught ) { java.lang.String errorMessage ; if ( caught instanceof com.google.gwt.user.client.rpc.StatusCodeException ) { errorMessage = ( ( getConstants ( ) . requestToServerFailedWithCode ( ) ) + ": " ) + ( ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( caught ) ) . getStatusCode ( ) ) ; } else { errorMessage = ( ( getConstants ( ) . requestToServerFailed ( ) ) + ": " ) + ( caught.getLocalizedMessage ( ) ) ; } failureEventHandler ( null , java.util.Collections.singletonList ( errorMessage ) ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList ( ) ; }

Target:
public T convert ( java.lang.Object source ) { java.lang.Iterable < T > iterable = ( ( java.lang.Iterable < T > ) ( source ) ) ; java.util.Iterator < T > iterator = iterable.iterator ( ) ; while ( iterator.hasNext ( ) ) { return iterator.next ( ) ; } return null ; }
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ( ) ; }
Source:
public void disableWidget ( com.google.gwt.user.client.ui.Widget widget ) { if ( widget instanceof com.google.gwt.user.client.ui.IndexedPanel ) { for ( int i = 0 ; i < ( ( ( com.google.gwt.user.client.ui.IndexedPanel ) ( widget ) ) . getWidgetCount ( ) ) ; i ++ ) { disableWidget ( ( ( com.google.gwt.user.client.ui.IndexedPanel ) ( widget ) ) . getWidget ( i ) ) ; } } else if ( widget instanceof com.google.gwt.user.client.ui.HasEnabled ) { ( ( com.google.gwt.user.client.ui.HasEnabled ) ( widget ) ) . setEnabled ( false ) ; } }

Target:
private void setEnabled ( com.google.gwt.user.client.ui.Widget widget , boolean enable ) { if ( widget instanceof com.google.gwt.user.client.ui.IndexedPanel ) { for ( int i = 0 ; i < ( ( ( com.google.gwt.user.client.ui.IndexedPanel ) ( widget ) ) . getWidgetCount ( ) ) ; i ++ ) { setEnabled ( ( ( com.google.gwt.user.client.ui.IndexedPanel ) ( widget ) ) . getWidget ( i ) , enable ) ; } } else if ( widget instanceof com.google.gwt.user.client.ui.HasEnabled ) { ( ( com.google.gwt.user.client.ui.HasEnabled ) ( widget ) ) . setEnabled ( enable ) ; } }
Source:
boolean checkRngDeviceClusterCompatibility ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > rngDevs = org.ovirt.engine.core.bll.RunVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) , VmDeviceGeneralType.RNG , VmDeviceType.VIRTIO.getName ( ) ) ; if ( ! ( rngDevs.isEmpty ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmRngDevice rngDev = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( rngDevs.get ( 0 ) ) ; if ( ! ( org.ovirt.engine.core.bll.RunVmCommand.getVdsGroup ( ) . getRequiredRngSources ( ) . contains ( rngDev.getSource ( ) ) ) ) { return false ; } } return true ; }

Target:
boolean checkRngDeviceClusterCompatibility ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > rngDevs = org.ovirt.engine.core.bll.RunVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) , VmDeviceGeneralType.RNG , VmDeviceType.VIRTIO.getName ( ) ) ; if ( ! ( rngDevs.isEmpty ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmRngDevice rngDev = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( rngDevs.get ( 0 ) ) ; if ( ! ( org.ovirt.engine.core.bll.RunVmCommand.getCluster ( ) . getRequiredRngSources ( ) . contains ( rngDev.getSource ( ) ) ) ) { return false ; } } return true ; }
Source:
public final boolean IsFieldsUpdated ( java.lang.Object source , java.lang.Object destination , java.lang.Iterable < java.lang.String > fields ) { java.util.List < java.lang.String > changedFields = org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( source , destination ) ; for ( java.lang.String field : fields ) { if ( changedFields.contains ( field ) ) { return true ; } } return false ; }

Target:
public final boolean isFieldsUpdated ( java.lang.Object source , java.lang.Object destination , java.lang.Iterable < java.lang.String > fields ) { java.util.List < java.lang.String > changedFields = org.ovirt.engine.core.utils.ObjectIdentityChecker.getChangedFields ( source , destination ) ; for ( java.lang.String field : fields ) { if ( changedFields.contains ( field ) ) { return true ; } } return false ; }
Source:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > getExistingClusterNetworks ( ) { if ( ( existingClusterNetworks ) == null ) { existingClusterNetworks = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( getDbFacade ( ) . getNetworkDao ( ) . getAllForCluster ( vds.getVdsGroupId ( ) ) ) ; } return existingClusterNetworks ; }

Target:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getExistingIfaces ( ) { if ( ( existingIfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces = interfaceDao.getAllInterfacesForVds ( params.getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : ifaces ) { org.ovirt.engine.core.common.businessentities.network.Network network = getExistingClusterNetworks ( ) . get ( iface.getNetworkName ( ) ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = networkImplementationDetailsUtils.calculateNetworkImplementationDetails ( iface , network ) ; iface.setNetworkImplementationDetails ( networkImplementationDetails ) ; } existingIfaces = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( ifaces ) ; } return existingIfaces ; }
Source:
public static void GetCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , 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 ) , aQuery ) ; }
Source:
private void DataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.DataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }

Target:
private void dataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( isMigrate && ( ( ( getVm ( ) . getrun_on_vds ( ) ) != null ) && ( getVm ( ) . getrun_on_vds ( ) . equals ( vds.getId ( ) ) ) ) ) { sb.append ( "is the same host the VM is currently running on" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_TO_SAME_HOST ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( isMigrate && ( ( ( getVm ( ) . getRunOnVds ( ) ) != null ) && ( getVm ( ) . getRunOnVds ( ) . equals ( vds.getId ( ) ) ) ) ) { sb.append ( "is the same host the VM is currently running on" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_TO_SAME_HOST ; } return null ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpConfigurationIsEmpty ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockedIpConfiguration.hasIpv4PrimaryAddressSet ( ) ) . thenReturn ( false ) ; org.mockito.Mockito.when ( mockedIpConfiguration.hasIpv6PrimaryAddressSet ( ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setEmulatedMachine ( "pc-1.0" ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( cluster ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setEmulatedMachine ( "pc-1.0" ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; cluster.setClusterId ( clusterId ) ; org.mockito.Mockito.when ( mock.get ( clusterId ) ) . thenReturn ( cluster ) ; return mock ; }