auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getMaxSpmPriority ( 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 ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

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 ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testWarnOnActiveVmPositive ( ) { testWarnOnActiveVmInner ( true ) ; org.mockito.Mockito.verify ( mockAuditLogDirector ) . log ( auditLogableBaseCaptor.capture ( ) , org.mockito.Mockito.same ( AuditLogType.NETWORK_UPDATE_DISPLAY_FOR_CLUSTER_WITH_ACTIVE_VM ) ) ; final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase actualLoggable = auditLogableBaseCaptor.getValue ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_CLUSTER_ID , actualLoggable.getClusterId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_NAME , actualLoggable.getCustomValue ( "networkname" ) ) ; }

Target:
public void testWarnOnActiveVmPositive ( ) { testWarnOnActiveVmInner ( true ) ; org.mockito.Mockito.verify ( mockAuditLogDirector ) . log ( auditLogableBaseCaptor.capture ( ) , org.mockito.Matchers.same ( AuditLogType.NETWORK_UPDATE_DISPLAY_FOR_CLUSTER_WITH_ACTIVE_VM ) ) ; final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase actualLoggable = auditLogableBaseCaptor.getValue ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_CLUSTER_ID , actualLoggable.getClusterId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_NAME , actualLoggable.getCustomValue ( "networkname" ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > getAllAsyncTasksFromDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > asyncTasks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask : asyncTasks ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTasks ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommandsWithCallBackEnabled ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( commandsCache.get ( cmdId ) . isCallBackEnabled ( ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . withParameter ( "volName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
protected void MoveOrCopyAllImageGroups ( ) { MoveOrCopyAllImageGroups ( getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , false , false ) ) ; }

Target:
public boolean validateAndSetQuota ( ) { if ( getQuotaManager ( ) . validateQuotaForStoragePool ( getStoragePool ( ) , getVdsGroupId ( ) , getQuotaId ( ) , getReturnValue ( ) . getCanDoActionMessages ( ) ) ) { return getQuotaManager ( ) . validateAndSetStorageQuota ( getStoragePool ( ) , getStorageQuotaListParameters ( ) , getReturnValue ( ) . getCanDoActionMessages ( ) ) ; } return false ; }
Source:
public void getTemplateNicList ( 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 < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void runOnce ( ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel selectedItem = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( getSelectedItem ( ) ) ) ; if ( ( selectedItem == null ) || ( ( selectedItem.getEntity ( ) ) == null ) ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( selectedItem.getEntity ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.UserPortalRunOnceModel ( vm , getCustomPropertiesKeysList ( ) . get ( vm.getVdsGroupCompatibilityVersion ( ) ) , this ) ; setWindow ( model ) ; model.init ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > poolRepresentants = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > poolRepresentantsRetval = result.getReturnValues ( ) ; for ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue poolRepresentant : poolRepresentantsRetval ) { poolRepresentants.add ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( poolRepresentant.getReturnValue ( ) ) ) ) ; } consoleModelsCache.updatePoolCache ( poolRepresentants ) ; finishSearch ( all ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getBroker ( ) . glusterVolumeRemoveBrickForce ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getBrickDirectories ( ) . toArray ( new java.lang.String [ 0 ] ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getReplicaCount ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getBroker ( ) . glusterVolumeRemoveBrickForce ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getBrickDirectories ( ) . toArray ( new java.lang.String [ 0 ] ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.getParameters ( ) . getReplicaCount ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeRemoveBricksVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
protected void RemoveVmNetwork ( ) { new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) . removeAll ( macAdded , getVmId ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : getVm ( ) . getDiskMap ( ) . values ( ) ) { if ( disk instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( diskImage.getQuotaId ( ) , imageToDestinationDomainMap.get ( diskImage.getId ( ) ) , diskImage.getSizeInGigabytes ( ) ) ) ; } } return list ; }
Source:
public void NameLengthIsTooLong ( ) { org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( ( ( org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) * 2 ) ) ) ; org.junit.Assert.assertThat ( validator.nameLengthIsLegal ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ) ; }

Target:
public void nameLengthIsTooLong ( ) { org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( ( ( org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) * 2 ) ) ) ; org.junit.Assert.assertThat ( validator.nameLengthIsLegal ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS createServer ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String hostname ) { org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; vdsStatic.setId ( serverId ) ; vdsStatic.setHostName ( hostname ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; vdsDynamic.setstatus ( VDSStatus.Up ) ; return new org.ovirt.engine.core.common.businessentities.VDS ( vdsStatic , vdsDynamic , new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS createServer ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String hostname , org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; vdsStatic.setId ( serverId ) ; vdsStatic.setHostName ( hostname ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; vdsDynamic.setstatus ( VDSStatus.Up ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( vdsStatic , vdsDynamic , new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ) ; vds.setVdsGroupCompatibilityVersion ( version ) ; return vds ; }
Source:
public void testRemoveNetworkFromIscsiBond ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > networks = dao.getNetworkIdsByIscsiBondId ( FixturesTool.ISCSI_BOND_ID ) ; org.ovirt.engine.core.compat.Guid networkId = networks.get ( 0 ) ; dao.removeNetworkFromIscsiBond ( FixturesTool.ISCSI_BOND_ID , networkId ) ; networks = dao.getNetworkIdsByIscsiBondId ( FixturesTool.ISCSI_BOND_ID ) ; org.junit.Assert.assertTrue ( networks.isEmpty ( ) ) ; }

Target:
public void testRemoveNetworkFromIscsiBond ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > networks = dao.getNetworkIdsByIscsiBondId ( FixturesTool.ISCSI_BOND_ID ) ; org.ovirt.engine.core.compat.Guid networkId = networks.get ( 0 ) ; dao.removeNetworkFromIscsiBond ( FixturesTool.ISCSI_BOND_ID , networkId ) ; networks = dao.getNetworkIdsByIscsiBondId ( FixturesTool.ISCSI_BOND_ID ) ; org.junit.jupiter.api.Assertions.assertTrue ( networks.isEmpty ( ) ) ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsDhcp ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplayIsFalse ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForDisplayNetworkWhenNetworkIsNonDisplay ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult hasSpaceForAllDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > newDiskImages , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > clonedDiskImages ) { java.lang.Long availableSize = storageDomain.getAvailableDiskSizeInBytes ( ) ; double totalSizeForNewDisks = getTotalSizeForNewDisks ( newDiskImages ) ; double totalSizeForClonedDisks = getTotalSizeForClonedDisks ( clonedDiskImages ) ; double totalSizeForDisks = totalSizeForNewDisks + totalSizeForClonedDisks ; return validateRequiredSpace ( availableSize , totalSizeForDisks ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hasSpaceForAllDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > newDiskImages , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > clonedDiskImages ) { if ( storageDomain.getStorageType ( ) . isCinderDomain ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.lang.Long availableSize = storageDomain.getAvailableDiskSizeInBytes ( ) ; double totalSizeForNewDisks = getTotalSizeForNewDisks ( newDiskImages ) ; double totalSizeForClonedDisks = getTotalSizeForClonedDisks ( clonedDiskImages ) ; double totalSizeForDisks = totalSizeForNewDisks + totalSizeForClonedDisks ; return validateRequiredSpace ( availableSize , totalSizeForDisks ) ; }
Source:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setStatus ( storagePoolStatus ) ; org.ovirt.engine.api.model.DataCenter dataCenter = org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ; org.junit.Assert.assertEquals ( dataCenter.getStatus ( ) , dataCenterStatus ) ; }

Target:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setStatus ( storagePoolStatus ) ; org.ovirt.engine.api.model.DataCenter dataCenter = org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( dataCenter.getStatus ( ) , dataCenterStatus ) ; }
Source:
public void convertValidPropertiesToMap ( ) { org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils ( ) ; java.lang.String propStr = "speed=1024;duplex=half" ; java.util.Map < java.lang.String , java.lang.String > map = utils.convertProperties ( propStr ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyMap ( map , 2 ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "speed" , "1024" ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "duplex" , "half" ) ; }

Target:
public void convertValidPropertiesToMap ( ) { org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils ( ) ; java.lang.String propStr = "speed=1024;duplex=half;debug=" ; java.util.Map < java.lang.String , java.lang.String > map = utils.convertProperties ( propStr ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyMap ( map , 3 ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "speed" , "1024" ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "duplex" , "half" ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "debug" , "" ) ; }
Source:
public void testImagesLocked ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotsForVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotsForVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksListForChecks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ) . when ( diskImagesValidator ) . diskImagesNotLocked ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; }

Target:
public void testImagesLocked ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksListForChecks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ) . when ( diskImagesValidator ) . diskImagesNotLocked ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; }
Source:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { return true ; }

Target:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > bootModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getIsBootable ( ) ; return ( bootModel.getIsChangable ( ) ) || ( ( bootModel.getEntity ( ) ) == true ) ; }
Source:
private static void assertFullGetAllAttachableDisksByPoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { org.junit.Assert.assertEquals ( "There should be only four attachable disks" , 4 , disks.size ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > expectedFloatingDiskIds = new java.util.HashSet ( java.util.Arrays.asList ( FixturesTool.FLOATING_DISK_ID , FixturesTool.FLOATING_LUN_ID , FixturesTool.FLOATING_CINDER_DISK_ID ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > actualFloatingDiskIds = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { actualFloatingDiskIds.add ( disk.getId ( ) ) ; } org.junit.Assert.assertEquals ( "Wrong attachable disks" , expectedFloatingDiskIds , actualFloatingDiskIds ) ; }

Target:
private static void assertFullGetAllAttachableDisksByPoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { org.junit.Assert.assertEquals ( "There should be only four attachable disks" , 4 , disks.size ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > expectedFloatingDiskIds = new java.util.HashSet ( java.util.Arrays.asList ( FixturesTool.FLOATING_DISK_ID , FixturesTool.FLOATING_LUN_ID , FixturesTool.FLOATING_CINDER_DISK_ID ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > actualFloatingDiskIds = disks.stream ( ) . map ( BaseDisk :: getId ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; org.junit.Assert.assertEquals ( "Wrong attachable disks" , expectedFloatingDiskIds , actualFloatingDiskIds ) ; }
Source:
protected void resetActionTypeIfNecessary ( ) { boolean allCleared = true ; synchronized ( _listTasks ) { java.util.List < org.ovirt.engine.core.bll.EntityAsyncTask > CurrentActionTypeTasks = GetCurrentActionTypeTasks ( ) ; for ( org.ovirt.engine.core.bll.EntityAsyncTask task : CurrentActionTypeTasks ) { allCleared = allCleared && ( taskWasCleared ( task ) ) ; } if ( allCleared ) { setActionType ( VdcActionType.Unknown ) ; } } }

Target:
public boolean ShouldEndAction ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.EntityAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.EntityAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getState ( ) ) != ( AsyncTaskState.Ended ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "Task ID: '{0}' is in state {1}. End action for command {2} will proceed when all the entity's tasks are completed." , task.getVdsmTaskId ( ) , task.getState ( ) , getCommandId ( ) ) ; return false ; } } } return true ; }
Source:
public void testInterfaceIsValidSlaveWhenInterfaceIsBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setBonded ( true ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }

Target:
public void testInterfaceIsValidSlaveWhenInterfaceIsVlan ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVlanId ( 1 ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_INTERFACE_NAME , vdsNetworkInterface.getName ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , matcher ) ; }
Source:
protected java.lang.String getDiskSharedLockMessage ( ) { if ( ( cachedDiskSharedLockMessage ) == null ) { cachedDiskSharedLockMessage = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_USED_FOR_CREATE_VM.name ( ) ) . append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.AddVmCommand.getVmName ( ) ) ) . toString ( ) ; } return cachedDiskSharedLockMessage ; }

Target:
protected java.lang.String getDiskSharedLockMessage ( ) { if ( ( cachedDiskSharedLockMessage ) == null ) { cachedDiskSharedLockMessage = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_USED_FOR_CREATE_VM.name ( ) ) . append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.AddVmCommand.getVmName ( ) ) ) . toString ( ) ; } return cachedDiskSharedLockMessage ; }
Source:
public void testDirectDescetor ( ) { org.ovirt.engine.core.common.businessentities.Tags tag1 = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tag2 = createTag ( "tag2" , "desc2" ) ; tagsDirector.AddTag ( tag1 ) ; tagsDirector.AddTag ( tag2 ) ; tagsDirector.MoveTag ( tag2.gettag_id ( ) , tag1.gettag_id ( ) ) ; org.junit.Assert.assertTrue ( tagsDirector.IsTagDescestorOfTag ( tag1.gettag_id ( ) , tag2.gettag_id ( ) ) ) ; }

Target:
public void testDirectDescetor ( ) { org.ovirt.engine.core.common.businessentities.Tags tag1 = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tag2 = createTag ( "tag2" , "desc2" ) ; tagsDirector.addTag ( tag1 ) ; tagsDirector.addTag ( tag2 ) ; tagsDirector.MoveTag ( tag2.gettag_id ( ) , tag1.gettag_id ( ) ) ; org.junit.Assert.assertTrue ( tagsDirector.isTagDescestorOfTag ( tag1.gettag_id ( ) , tag2.gettag_id ( ) ) ) ; }
Source:
public org.ovirt.engine.api.model.VmPools list ( ) { return mapCollection ( getBackendCollection ( SearchType.VmPools ) ) ; }

Target:
public org.ovirt.engine.api.model.VmPools list ( ) { if ( isFiltered ( ) ) { org.ovirt.engine.core.common.queries.GetAllVmPoolsAttachedToUserParameters params = new org.ovirt.engine.core.common.queries.GetAllVmPoolsAttachedToUserParameters ( getCurrent ( ) . get ( org.ovirt.engine.core.common.users.VdcUser.class ) . getUserId ( ) ) ; return mapCollection ( getBackendCollection ( VdcQueryType.GetAllVmPoolsAttachedToUser , params ) ) ; } else { return mapCollection ( getBackendCollection ( SearchType.VmPools ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.DevicesVisibilityMapReturnForXmlRpc getDevicesVisibility ( java.lang.String [ ] devicesList ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getDevicesVisibility" ) . withParameter ( "guidList" , new java.util.ArrayList < > ( java.util.Arrays.asList ( devicesList ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "visible" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.DevicesVisibilityMapReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.DevicesVisibilityMapReturn getDevicesVisibility ( java.lang.String [ ] devicesList ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getDevicesVisibility" ) . withParameter ( "guidList" , new java.util.ArrayList < > ( java.util.Arrays.asList ( devicesList ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "visible" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.DevicesVisibilityMapReturn ( response ) ; }
Source:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }

Target:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }
Source:
public static void getHostPublicKey ( 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.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void testListAllContent ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.util.List < java.lang.String > populates = new java.util.ArrayList < java.lang.String > ( ) ; populates.add ( "true" ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ) . andReturn ( populates ) . anyTimes ( ) ; setUpGetPayloadExpectations ( 3 ) ; setUpGetBallooningExpectations ( 3 ) ; setUpGetCertuficateExpectations ( 3 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }

Target:
public void testAddWithClonePermissionsClone ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM model = createModel ( null ) ; model.setPermissions ( new org.ovirt.engine.api.model.Permissions ( ) ) ; model.getPermissions ( ) . setClone ( true ) ; doTestAddWithClonePermissions ( model , true ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getIrsProxy ( ) . attachStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteIrsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getIrsProxy ( ) . attachStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterVolume model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE.toString ( ) , model.getVolumeType ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumeResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterVolume model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE.name ( ) . toLowerCase ( ) , model.getVolumeType ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumeResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > getAllRunningByVds ( org.ovirt.engine.core.compat.Guid id ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > map = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : getAllRunningForVds ( id ) ) { map.put ( vm.getId ( ) , vm ) ; } return map ; }

Target:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > getAllRunningByVds ( org.ovirt.engine.core.compat.Guid id ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = getCallsHandler ( ) . executeReadList ( "GetVmsRunningByVds" , org.ovirt.engine.core.dao.VmDaoImpl.VmMonitoringRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vds_id" , id ) ) ; java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { map.put ( vm.getId ( ) , vm ) ; } return map ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getDocumentationBaseURL ( 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.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.api.model.Clusters mapVirtOnlyCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > entities ) { org.ovirt.engine.api.model.Clusters collection = new org.ovirt.engine.api.model.Clusters ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster entity : entities ) { collection.getClusters ( ) . add ( addLinks ( map ( entity ) , org.ovirt.engine.api.restapi.resource.BackendClustersResource.VIRT_ONLY_MODE_COLLECTIONS_TO_HIDE ) ) ; } return collection ; }

Target:
private org.ovirt.engine.api.model.Clusters mapVirtOnlyCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > entities ) { org.ovirt.engine.api.model.Clusters collection = new org.ovirt.engine.api.model.Clusters ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster entity : entities ) { collection.getClusters ( ) . add ( addLinks ( populate ( map ( entity ) , entity ) , org.ovirt.engine.api.restapi.resource.BackendClustersResource.VIRT_ONLY_MODE_COLLECTIONS_TO_HIDE ) ) ; } return collection ; }
Source:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) == null ) || ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) . getOrigin ( ) . equalsIgnoreCase ( OVIRT ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; result = false ; } if ( ! result ) { addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__ADD ) ; addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__EXTERNAL_EVENT ) ; } return result ; }

Target:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) == null ) || ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) . getOrigin ( ) . equalsIgnoreCase ( org.ovirt.engine.core.bll.AddExternalEventCommand.OVIRT ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; result = false ; } if ( ! result ) { addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__ADD ) ; addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__EXTERNAL_EVENT ) ; } return result ; }
Source:
protected boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction , boolean newNic ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction , newNic ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.ActivateDeactivateVmNic , parameters , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }

Target:
protected boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction , boolean newNic ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction , newNic ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.ActivateDeactivateVmNic , parameters , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }
Source:
public void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void removeStatlessSnapsoht ( ) { runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , true ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }

Target:
private void removeStatlessSnapshot ( ) { runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , true ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Permissions mapCollection ( java.util.Set < org.ovirt.engine.core.common.businessentities.Permissions > entities ) { org.ovirt.engine.core.common.businessentities.Permissions collection = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions entity : entities ) { castEveryonePermissionsToUser ( entity ) ; org.ovirt.engine.api.model.Permission permission = map ( entity , getUserById ( entity.getAdElementId ( ) ) ) ; collection.getPermissions ( ) . add ( addLinks ( permission , ( ( permission.getUser ( ) ) != null ? suggestedParentType : org.ovirt.engine.api.model.Group.class ) ) ) ; } return collection ; }

Target:
protected org.ovirt.engine.api.model.Permissions mapCollection ( java.util.Set < org.ovirt.engine.api.model.Permissions > entities ) { org.ovirt.engine.api.model.Permissions collection = new org.ovirt.engine.api.model.Permissions ( ) ; for ( org.ovirt.engine.api.model.Permissions entity : entities ) { castEveryonePermissionsToUser ( entity ) ; org.ovirt.engine.api.model.Permission permission = map ( entity , getUserById ( entity.getAdElementId ( ) ) ) ; collection.getPermissions ( ) . add ( addLinks ( permission , ( ( permission.getUser ( ) ) != null ? suggestedParentType : org.ovirt.engine.api.model.Group.class ) ) ) ; } return collection ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getParameters ( ) . getId ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > result = new java.util.HashMap < > ( ) ; if ( vds != null ) { result = org.ovirt.engine.core.utils.vdshooks.VdsHooksParser.parseHooks ( vds.getHooksStr ( ) ) ; } org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = vdsDao.get ( org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getParameters ( ) . getId ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > result = new java.util.HashMap < > ( ) ; if ( vds != null ) { result = org.ovirt.engine.core.utils.vdshooks.VdsHooksParser.parseHooks ( vds.getHooksStr ( ) ) ; } org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }