auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void init ( ) { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.info ( "Initializing DWH Heart Beat" ) ; heartBeatVar = new org.ovirt.engine.core.common.businessentities.DwhHistoryTimekeeping ( ) ; heartBeatVar.setVariable ( DwhHistoryTimekeepingVariable.HEART_BEAT ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( this , org.ovirt.engine.core.bll.dwh.DwhHeartBeat.DWH_HEART_BEAT_METHOD , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , 0 , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.DwhHeartBeatInterval ) , java.util.concurrent.TimeUnit.SECONDS ) ; }

Target:
public void init ( ) { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.info ( "Initializing DWH Heart Beat" ) ; heartBeatVar = new org.ovirt.engine.core.common.businessentities.DwhHistoryTimekeeping ( ) ; heartBeatVar.setVariable ( DwhHistoryTimekeepingVariable.HEART_BEAT ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( this , org.ovirt.engine.core.bll.dwh.DwhHeartBeat.DWH_HEART_BEAT_METHOD , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , 0 , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.DwhHeartBeatInterval ) , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.info ( "DWH Heart Beat initialized" ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.tags createTag ( java.lang.String name , java.lang.String description ) { org.ovirt.engine.core.compat.Guid tagId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.tags tag = new org.ovirt.engine.core.common.businessentities.tags ( ) ; tag.setdescription ( description ) ; tag.settag_id ( tagId ) ; tag.settag_name ( name ) ; tag.settype ( TagsType.GeneralTag ) ; tag.setparent_id ( tagsDirector.GetRootTag ( ) . gettag_id ( ) ) ; return tag ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Tags createTag ( java.lang.String name , java.lang.String description ) { org.ovirt.engine.core.compat.Guid tagId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.Tags tag = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; tag.setdescription ( description ) ; tag.settag_id ( tagId ) ; tag.settag_name ( name ) ; tag.settype ( TagsType.GeneralTag ) ; tag.setparent_id ( tagsDirector.GetRootTag ( ) . gettag_id ( ) ) ; return tag ; }
Source:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; 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 ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; 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 ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
public void versionNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.junit.Assert.assertThat ( validator.versionSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( org.ovirt.engine.core.bll.utils.VersionSupport.getUnsupportedVersionMessage ( ) ) ) ; }

Target:
public void versionNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.versionSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( org.ovirt.engine.core.bll.utils.VersionSupport.getUnsupportedVersionMessage ( ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String remoteUserName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepKeysUpdate" ) . withParameter ( "geoRepPubKeys" , geoRepPubKeys ) . withOptionalParameter ( "userName" , remoteUserName ) . 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 glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepKeysUpdate" ) . withParameter ( "geoRepPubKeys" , geoRepPubKeys ) . withOptionalParameter ( "userName" , userName ) . 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 calculateNetworkImplementationDetailsNetworkQosOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos = createQos ( ) ; qos.setOutboundAverage ( 30 ) ; qos.setOutboundPeak ( 30 ) ; qos.setOutboundBurst ( 30 ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , qos ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkQosOverridden ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setQosOverridden ( true ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , true , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ) ; }
Source:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalAction ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( disk , containerID ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.ImportVmCommand.getExecutionContext ( ) ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcRetValue.getFault ( ) . getError ( ) , "ImportVmCommand::MoveOrCopyAllImageGroups: Failed to copy disk!" ) ; } getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }

Target:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( disk , containerID ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcRetValue.getFault ( ) . getError ( ) , "ImportVmCommand::MoveOrCopyAllImageGroups: Failed to copy disk!" ) ; } getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }
Source:
public void testInvalidUpdateOfNonEditableFieldOnRunningVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = org.ovirt.engine.core.bll.VmHandler.isUpdateValid ( src , dest ) ; org.junit.Assert.assertFalse ( "Update should be invalid for different IDs" , updateIsValid ) ; }

Target:
public void testInvalidUpdateOfNonEditableFieldOnRunningVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vmHandler.isUpdateValid ( src , dest ) ; org.junit.Assert.assertFalse ( "Update should be invalid for different IDs" , updateIsValid ) ; }
Source:
private void writePrimitiveType ( org.ovirt.api.metamodel.concepts.PrimitiveType type ) { writer.writeStartElement ( "primitive" ) ; writeCommon ( type ) ; writer.writeEndElement ( ) ; }

Target:
private void writeModel ( ) { writer.writeStartElement ( "model" ) ; writer.writeStartElement ( "types" ) ; model.types ( ) . forEach ( this :: writeType ) ; writer.writeEndElement ( ) ; writer.writeStartElement ( "services" ) ; model.services ( ) . forEach ( this :: writeService ) ; writer.writeEndElement ( ) ; writer.writeEndElement ( ) ; }
Source:
private void saveOriginalNetworkParameters ( ) { if ( ( originalNetParams ) == null ) { originalNetParams = new org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters ( ) ; } originalNetParams.setBootProtocol ( getBootProtocol ( ) ) ; originalNetParams.setAddress ( ( ( java.lang.String ) ( getAddress ( ) . getEntity ( ) ) ) ) ; originalNetParams.setSubnet ( ( ( java.lang.String ) ( getSubnet ( ) . getEntity ( ) ) ) ) ; }

Target:
public void setOriginalNetParams ( org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters originalNetParams ) { this . originalNetParams = originalNetParams ; }
Source:
private void setManagedVideoDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > managedDeviceMap = vmBase.getManagedDeviceMap ( ) ; if ( managedDeviceMap == null ) { managedDeviceMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vmBase.getId ( ) , VmDeviceGeneralType.VIDEO ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { managedDeviceMap.put ( device.getDeviceId ( ) , device ) ; } }

Target:
private void setManagedDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > managedDeviceMap = vmBase.getManagedDeviceMap ( ) ; if ( managedDeviceMap == null ) { managedDeviceMap = new java.util.HashMap < > ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vmBase.getId ( ) , type ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { managedDeviceMap.put ( device.getDeviceId ( ) , device ) ; } }
Source:
public java.lang.String getTemplate ( java.lang.String methodName , java.lang.String actionName , java.lang.String docParams ) { org.ovirt.engine.sdk.codegen.utils.StringTemplateWrapper templateWrapper = new org.ovirt.engine.sdk.codegen.utils.StringTemplateWrapper ( getTemplate ( ) ) ; templateWrapper.set ( "methodName" , methodName ) ; templateWrapper.set ( "actionName" , actionName ) ; templateWrapper.set ( "docParams" , docParams ) ; return templateWrapper.toString ( ) ; }

Target:
private java.lang.String getTemplate ( java.lang.String methodName , java.lang.String actionName , java.lang.String docParams , java.lang.String methodExtraParamsDef , java.lang.String headersToBuild , java.lang.String urlParamsToBuild ) { org.ovirt.engine.sdk.codegen.utils.StringTemplateWrapper templateWrapper = new org.ovirt.engine.sdk.codegen.utils.StringTemplateWrapper ( getTemplate ( ) ) ; templateWrapper.set ( "methodName" , methodName ) ; templateWrapper.set ( "actionName" , actionName ) ; templateWrapper.set ( "docParams" , docParams ) ; templateWrapper.set ( "methodExtraParamsDef" , methodExtraParamsDef ) ; templateWrapper.set ( "headersToBuild" , headersToBuild ) ; templateWrapper.set ( "urlParamsToBuild" , urlParamsToBuild ) ; return templateWrapper.toString ( ) ; }
Source:
private void updateConnectionMapForFiberChannel ( java.util.Set < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > statuses ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomainList = org.ovirt.engine.core.bll.storage.pool.ConnectHostToStoragePoolServerCommandBase.getStorageDomainDao ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.storage.pool.ConnectHostToStoragePoolServerCommandBase.getStoragePool ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain sd : storageDomainList ) { if ( ( ( sd.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.FCP ) ) && ( statuses.contains ( sd.getStatus ( ) ) ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( StorageType.FCP , org.ovirt.engine.core.bll.storage.connection.FCPStorageHelper.getFCPConnection ( ) , getConnectionsTypeMap ( ) ) ; break ; } } }

Target:
private void updateConnectionMapForFiberChannel ( java.util.Set < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > statuses ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomainList = storageDomainDao.getAllForStoragePool ( org.ovirt.engine.core.bll.storage.pool.ConnectHostToStoragePoolServerCommandBase.getStoragePool ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain sd : storageDomainList ) { if ( ( ( sd.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.FCP ) ) && ( statuses.contains ( sd.getStatus ( ) ) ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( StorageType.FCP , org.ovirt.engine.core.bll.storage.connection.FCPStorageHelper.getFCPConnection ( ) , getConnectionsTypeMap ( ) ) ; break ; } } }
Source:
public void setNumberOfSockets ( java.lang.Integer value ) { if ( ( ( numberOfSockets ) == null ) && ( value == null ) ) { return ; } if ( ( ( numberOfSockets ) == null ) || ( ! ( numberOfSockets.equals ( value ) ) ) ) { numberOfSockets = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "NumberOfSockets" ) ) ; } }

Target:
public void setNumberOfSockets ( java.lang.Integer value ) { if ( ( ( numberOfSockets ) == null ) && ( value == null ) ) { return ; } if ( ( ( numberOfSockets ) == null ) || ( ! ( numberOfSockets.equals ( value ) ) ) ) { numberOfSockets = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "NumberOfSockets" ) ) ; } }
Source:
public void testExistingDiscardFunctionalityIsPreservedNoDiskRequiresDiscardFunctionality ( ) { setSdFullDiscardFunctionality ( ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; junit.framework.Assert.assertTrue ( discardHelper.isExistingDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { setSdFullDiscardSupport ( ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; junit.framework.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }
Source:
private void updateVmAfterMigrationToDifferentCluster ( ) { if ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupId ( ) . equals ( org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . getTargetVdsGroupId ( ) ) ) { return ; } org.ovirt.engine.core.common.action.ChangeVMClusterParameters params = new org.ovirt.engine.core.common.action.ChangeVMClusterParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . getTargetVdsGroupId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ; setSucceeded ( org.ovirt.engine.core.bll.MigrateVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.ChangeVMCluster , params ) . getSucceeded ( ) ) ; }

Target:
private void updateVmAfterMigrationToDifferentCluster ( ) { if ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getClusterId ( ) . equals ( org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . getTargetClusterId ( ) ) ) { return ; } org.ovirt.engine.core.common.action.ChangeVMClusterParameters params = new org.ovirt.engine.core.common.action.ChangeVMClusterParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . getTargetClusterId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getCustomCompatibilityVersion ( ) ) ; setSucceeded ( org.ovirt.engine.core.bll.MigrateVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.ChangeVMCluster , params ) . getSucceeded ( ) ) ; }
Source:
public void postOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue , boolean approveInitiated ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { if ( approveInitiated ) { onApproveInternal ( ) ; } cancel ( ) ; } }

Target:
public void postOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue , boolean approveInitiated ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { if ( approveInitiated ) { onApproveInternal ( ) ; } cancel ( ) ; } }
Source:
protected boolean isInterfaceSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ! ( ( DiskInterface.VirtIO.equals ( disk.getDiskInterface ( ) ) ) || ( DiskInterface.VirtIO_SCSI.equals ( disk.getDiskInterface ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO ) ; return false ; } return true ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Disk loadDisk ( org.ovirt.engine.core.compat.Guid diskId ) { if ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getParameters ( ) . getSnapshotId ( ) ) == null ) { return loadActiveDisk ( diskId ) ; } else { return loadDiskFromSnapshot ( diskId , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getParameters ( ) . getSnapshotId ( ) ) ; } }
Source:
public void testValidateQosOverriddenInterfacesWhenHostNetworkQosIsNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithName ( "network" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createValidatorForTestingValidateQosOverridden ( network ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED_LIST , network.getName ( ) ) ) ) ; }

Target:
public void testValidateQosOverriddenInterfacesWhenHostNetworkQosIsNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithName ( "network" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createValidatorForTestingValidateQosOverridden ( network ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentStringWithMultipleValues ( EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , network.getName ( ) ) ) ) ; }
Source:
public java.util.SortedSet < java.lang.String > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet < java.lang.String > ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; }

Target:
public java.util.SortedSet < java.lang.String > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; }
Source:
private org.ovirt.engine.core.compat.Version clusterVersionOrNull ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = model.getSelectedCluster ( ) ; if ( ( vdsGroup == null ) || ( ( vdsGroup.getCompatibilityVersion ( ) ) == null ) ) { return null ; } return vdsGroup.getCompatibilityVersion ( ) ; }

Target:
private static org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion computeNewTemplateWithVersionToSelect ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion > newItems , boolean addLatest ) { if ( newItems.isEmpty ( ) ) { return null ; } if ( addLatest ) { return ( newItems.size ( ) ) >= 2 ? newItems.get ( 1 ) : newItems.get ( 0 ) ; } return newItems.get ( 0 ) ; }
Source:
public void testIpConfiguredForStaticBootProtocol_WhenIpConfigurationIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) ; org.junit.Assert.assertThat ( validator.ipConfiguredForStaticBootProtocol ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.junit.Assert.assertThat ( validator.ipConfiguredForStaticBootProtocol ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.ImageStatus checkImageStatus ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk removedVolume ) { try { return getCinderBroker ( ) . getImageStatusByClassificationType ( removedVolume ) ; } catch ( java.lang.Exception e ) { log.error ( "An exception occured while verifying status for volume id '{0}' with the following exception: {1}." , removedVolume.getImageId ( ) , e ) ; return org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL ; } }

Target:
private org.ovirt.engine.core.common.businessentities.storage.ImageStatus checkImageStatus ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk removedVolume ) { try { return getCinderBroker ( ) . getImageStatusByClassificationType ( removedVolume ) ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { log.info ( "Image status could not be provided since the cinder image might have already been removed from Cinder." ) ; return org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ; } logError ( removedVolume , ex ) ; } catch ( java.lang.Exception e ) { logError ( removedVolume , e ) ; } return org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL ; }
Source:
protected void EndSuccessfully ( ) { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.EndActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getCompensationContext ( ) ) ; restoreVmConfigFromSnapshot ( ) ; } else { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing EndAction on Vm" ) ; } org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setSucceeded ( true ) ; }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.EndActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getCompensationContext ( ) ) ; restoreVmConfigFromSnapshot ( ) ; } else { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing EndAction on Vm" ) ; } org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setSucceeded ( true ) ; }
Source:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public static void getHostById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
void localize ( ) { pathEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.GlusterStorageView.constants.storagePopupPosixPathLabel ( ) ) ; pathExampleLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.GlusterStorageView.constants.storagePopupGlusterPathExampleLabel ( ) ) ; vfsTypeEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.GlusterStorageView.constants.storagePopupVfsTypeLabel ( ) ) ; mountOptionsEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.GlusterStorageView.constants.storagePopupMountOptionsLabel ( ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean showEditor = ! ( glusterStorageModel.getLinkGlusterVolume ( ) . getEntity ( ) ) ; pathEditorRow.setVisible ( showEditor ) ; pathExampleLabel.setVisible ( showEditor ) ; glusterVolumesRow.setVisible ( ( ! showEditor ) ) ; }
Source:
void addTab ( com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.RequestTabsHandler > requestTabsEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.ChangeTabHandler > changeTabEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.proxy.RevealContentHandler < ? > > slot , java.lang.String label , java.lang.String historyToken , boolean isMainTab , java.lang.String contentUrl , org.ovirt.engine.ui.webadmin.plugin.api.TabOptions options ) { dynamicUrlContentTabProxyFactory.create ( requestTabsEventType , changeTabEventType , slot , label , options.getPriority ( ) . floatValue ( ) , historyToken , isMainTab , contentUrl , ( options.getAlignRight ( ) ? org.ovirt.engine.ui.common.widget.Align.RIGHT : org.ovirt.engine.ui.common.widget.Align.LEFT ) ) ; org.ovirt.engine.ui.common.presenter.RedrawDynamicTabContainerEvent.fire ( this , requestTabsEventType ) ; }

Target:
void addTab ( com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.RequestTabsHandler > requestTabsEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.ChangeTabHandler > changeTabEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.proxy.RevealContentHandler < ? > > slot , java.lang.String label , java.lang.String historyToken , boolean isMainTab , java.lang.String contentUrl , org.ovirt.engine.ui.webadmin.plugin.api.TabOptions options ) { dynamicUrlContentTabProxyFactory.create ( requestTabsEventType , changeTabEventType , slot , label , options.getPriority ( ) . floatValue ( ) , historyToken , isMainTab , contentUrl , ( options.getAlignRight ( ) ? org.ovirt.engine.ui.common.widget.Align.RIGHT : org.ovirt.engine.ui.common.widget.Align.LEFT ) , options.getSearchPrefix ( ) ) ; org.ovirt.engine.ui.common.presenter.RedrawDynamicTabContainerEvent.fire ( this , requestTabsEventType ) ; }
Source:
public static void GetStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void GetTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.api.model.DataCenter dataCenter = new org.ovirt.engine.api.model.DataCenter ( ) ; dataCenter.setId ( dataCenterId.toString ( ) ) ; network.setDataCenter ( dataCenter ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }

Target:
private org.ovirt.engine.api.model.Networks mapCollection ( java.util.List < org.ovirt.engine.api.model.Network > entities ) { org.ovirt.engine.api.model.Networks collection = new org.ovirt.engine.api.model.Networks ( ) ; for ( org.ovirt.engine.api.model.Network entity : entities ) { collection.getNetworks ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , getParentParameters ( parentCommand ) , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }
Source:
public void validateFailsWhenVMsPinnedToHost ( ) { mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; java.lang.String vmName = "abc" ; mockVmsPinnedToHost ( java.util.Collections.singletonList ( vmName ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DETECTED_PINNED_VMS ) ; boolean foundMessage = false ; for ( java.lang.String message : command.getReturnValue ( ) . getValidationMessages ( ) ) { foundMessage |= message.contains ( vmName ) ; } org.junit.Assert.assertTrue ( "Can't find VM name in can do action messages" , foundMessage ) ; }

Target:
public void validateFailsWhenVMsPinnedToHost ( ) { mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; java.lang.String vmName = "abc" ; mockVmsPinnedToHost ( java.util.Collections.singletonList ( vmName ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DETECTED_PINNED_VMS ) ; boolean foundMessage = false ; for ( java.lang.String message : command.getReturnValue ( ) . getValidationMessages ( ) ) { foundMessage |= message.contains ( vmName ) ; } org.junit.jupiter.api.Assertions.assertTrue ( foundMessage , "Can't find VM name in can do action messages" ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , getEntityList ( ) ) ; } }

Target:
protected org.ovirt.engine.api.model.Network getEntity ( int index ) { org.ovirt.engine.api.model.Network entity = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.Network.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; org.mockito.Mockito.when ( entity.getDataCenterId ( ) ) . thenReturn ( GUIDS [ 1 ] ) ; return entity ; }
Source:
private void initFilters ( ) { java.util.List < org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter > storageDomainFilters = java.util.Arrays.asList ( new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter ( invalidStorageDomain1 ) , new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter ( invalidStorageDomain2 ) , new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter ( invalidStorageDomain3 ) ) ; org.mockito.Mockito.doReturn ( storageDomainFilters ) . when ( memoryStorageHandler ) . getStorageDomainFilters ( ) ; }

Target:
private void initFilters ( ) { java.util.List < org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter > storageDomainFilters = java.util.Arrays.asList ( new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter ( invalidStorageDomain1 ) , new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter ( invalidStorageDomain2 ) , new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter ( invalidStorageDomain3 ) ) ; org.mockito.Mockito.doReturn ( storageDomainFilters ) . when ( memoryStorageHandler ) . getStorageDomainFilters ( memoryDisks ) ; }
Source:
public void testValidRemovedBondsWhenNotRemovingAnyBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Bond > emptyList ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , params , null , null , null ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getMaxNumOfVmCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allDcNetworks = getNetworkDao ( ) . getAllForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getParameters ( ) . isFiltered ( ) ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > managementNetworkCandidates = allDcNetworks.stream ( ) . filter ( getManagementNetworkCandidatePredicate ( ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getQueryReturnValue ( ) . setReturnValue ( managementNetworkCandidates ) ; }

Target:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allDcNetworks = networkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getParameters ( ) . getId ( ) ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > managementNetworkCandidates = allDcNetworks.stream ( ) . filter ( managementNetworkCandidatePredicate ) . collect ( java.util.stream.Collectors.toList ( ) ) ; org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getQueryReturnValue ( ) . setReturnValue ( managementNetworkCandidates ) ; }
Source:
static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.mMessages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.mMessages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.infoFormat ( "AuditLogType: {0} not exist in string table" , value.toString ( ) ) ; } } } }

Target:
static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.infoFormat ( "AuditLogType: {0} not exist in string table" , value.toString ( ) ) ; } } } }