auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addIpVersions ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.restapi.types.IpVersion [ ] values ) { version.setIpVersions ( new org.ovirt.engine.api.model.IpVersions ( ) ) ; for ( org.ovirt.engine.api.restapi.types.IpVersion ipVersion : values ) { version.getIpVersions ( ) . getIpVersions ( ) . add ( ipVersion.value ( ) ) ; } }

Target:
private void addIpVersions ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.IpVersion [ ] values ) { version.setIpVersions ( new org.ovirt.engine.api.model.IpVersions ( ) ) ; for ( org.ovirt.engine.api.model.IpVersion ipVersion : values ) { version.getIpVersions ( ) . getIpVersions ( ) . add ( ipVersion.value ( ) ) ; } }
Source:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; if ( org.ovirt.engine.core.common.config.Config.GetValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler dicovery thread" ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread discoveryThread = new org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread ( ) ; discoveryThread.start ( ) ; } else { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }

Target:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread discoveryThread = new org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread ( ) ; if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler dicovery thread" ) ; discoveryThread.start ( ) ; } else { discoveryThread.markAllExternalPoliciesAsDisabled ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }
Source:
private void moveVMsToUnknown ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = getVmsToMoveToUnknown ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { destroyVmOnDestination ( vm ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( vm.getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_SET_TO_UNKNOWN_STATUS ) ; } }

Target:
private void moveVMsToUnknown ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = getVmsToMoveToUnknown ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { destroyVmOnDestination ( vm ) ; resourceManager.runVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( vm.getId ( ) ) ; auditLogDirector.log ( logable , AuditLogType.VM_SET_TO_UNKNOWN_STATUS ) ; } }
Source:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolNetmaskEqual ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocolNetmask ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , true ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolAddressDifferent ( ) { initIpv4ConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public void onLogout ( ) { org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; query.setHandleFailure ( true ) ; query.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { Window.Location.reload ( ) ; } } ; frontend.logoffAsync ( frontend.getLoggedInUser ( ) , query ) ; }

Target:
public void onSessionExpired ( ) { if ( ( frontend.getLoginHandler ( ) ) != null ) { frontend.getLoginHandler ( ) . onLogout ( ) ; } Window.Location.reload ( ) ; }
Source:
protected void OnEntityChanged ( ) { super . OnEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( getEntity ( ) ) ) . getTemplate ( ) ; setItems ( template.getInterfaces ( ) ) ; } else { setItems ( null ) ; } }

Target:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( getEntity ( ) ) ) . getTemplate ( ) ; setItems ( template.getInterfaces ( ) ) ; } else { setItems ( null ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMetadataDiskForVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.generateMetaDataDiskAlias ( vm.getName ( ) ) ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_META_DATA_DISK_DESCRIPTION ) ; image.setSize ( org.ovirt.engine.core.bll.memory.MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; image.setVolumeType ( VolumeType.Sparse ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setDiskInterface ( DiskInterface.VirtIO ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createHibernationMetadataDisk ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.memory.MemoryUtils.createMetadataDisk ( ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.generateHibernationMetadataDiskAlias ( vm.getName ( ) ) ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_HIBERNATION_METADATA_DISK_DESCRIPTION ) ; return image ; }
Source:
private boolean validateSlave ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave ) { return ( ( org.ovirt.engine.core.common.validation.NetworkInterfaceValidator.isEmpty ( slave.getNetworkName ( ) ) ) && ( ( ( slave.getName ( ) ) == null ) || ( ! ( slave.getName ( ) . contains ( "." ) ) ) ) ) && ( ( slave.getVlanId ( ) ) == null ) ; }

Target:
private boolean validateSlave ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave ) { return ( ( org.ovirt.engine.core.common.validation.NetworkInterfaceValidator.isEmpty ( slave.getNetworkName ( ) ) ) && ( org.ovirt.engine.core.common.validation.NetworkInterfaceValidator.isEmpty ( slave.getBaseInterface ( ) ) ) ) && ( ( slave.getVlanId ( ) ) == null ) ; }
Source:
public void setSelectedItem ( java.lang.Integer value ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNameExists ( value ) ) ) { super . setSelectedItem ( AsyncDataProvider.DEFAULT_OS_ID ) ; } else { super . setSelectedItem ( value ) ; } }

Target:
public void setSelectedItem ( java.lang.Integer value ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNameExists ( value ) ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( dataCenterWithCluster == null ) ? null : dataCenterWithCluster.getCluster ( ) ; if ( cluster == null ) { return ; } super . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultOs ( cluster.getArchitecture ( ) ) ) ; } else { super . setSelectedItem ( value ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpClusters ( ) , null ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveCluster , org.ovirt.engine.core.common.action.ClusterParametersBase.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpClusters ( ) , null ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveCluster , org.ovirt.engine.core.common.action.ClusterParametersBase.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.core.common.businessentities.VDS entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }

Target:
private void setUpGetEntityWithNoCertificateInfoExpectations ( int times , boolean notFound , org.ovirt.engine.core.common.businessentities.VDS entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }
Source:
public void setCustomValuesOverridesDoesNotAffectsOtherKeys ( ) { final java.lang.String key1 = "foo" ; final java.lang.String key2 = "bar" ; b.appendCustomValue ( key2 , "test value 2" , null ) ; doSetCustomValuesTest ( b , key1 ) ; org.junit.Assert.assertThat ( b.getCustomValue ( key2 ) , org.hamcrest.Matchers.is ( "test value 2" ) ) ; }

Target:
public void setCustomValuesOverridesDoesNotAffectsOtherKeys ( ) { final java.lang.String key1 = "foo" ; final java.lang.String key2 = "bar" ; b.appendCustomValue ( key2 , "test value 2" , null ) ; doSetCustomValuesTest ( b , key1 ) ; org.hamcrest.MatcherAssert.assertThat ( b.getCustomValue ( key2 ) , org.hamcrest.Matchers.is ( "test value 2" ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Cluster cluster ) { validateParameters ( cluster , "name" , "dataCenter.name|id" ) ; validateEnums ( org.ovirt.engine.api.model.Cluster.class , cluster ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.getStoragePool ( cluster , this ) ; org.ovirt.engine.core.common.businessentities.VDSGroup entity = map ( cluster , map ( pool ) ) ; return performCreate ( VdcActionType.AddVdsGroup , new org.ovirt.engine.core.common.action.VdsGroupOperationParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Cluster cluster ) { validateParameters ( cluster , "name" , "dataCenter.name|id" ) ; validateEnums ( org.ovirt.engine.api.model.Cluster.class , cluster ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.getStoragePool ( cluster.getDataCenter ( ) , this ) ; org.ovirt.engine.core.common.businessentities.VDSGroup entity = map ( cluster , map ( pool ) ) ; return performCreate ( VdcActionType.AddVdsGroup , new org.ovirt.engine.core.common.action.VdsGroupOperationParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void storagePoolIdWithStorageDomain ( ) { b.setStoragePoolId ( null ) ; b.setStoragePool ( null ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setStoragePoolId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStorageDomain ( s ) ; final org.ovirt.engine.core.compat.Guid n = b.getStoragePoolId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , n ) ; }

Target:
public void storagePoolIdWithStorageDomain ( ) { b.setStoragePoolId ( null ) ; b.setStoragePool ( null ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setStoragePoolId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStorageDomain ( s ) ; final org.ovirt.engine.core.compat.Guid n = b.getStoragePoolId ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , n ) ; }
Source:
protected void updateBootableDiskAvailable ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; updateCanSetBoot ( disks ) ; } } ) , getVm ( ) . getId ( ) ) ; }

Target:
protected void updateBootableDiskAvailable ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmDiskList ( new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { updateCanSetBoot ( disks ) ; } } ) , getVm ( ) . getId ( ) ) ; }
Source:
protected boolean canDetachDomain ( boolean isDestroyStoragePool , boolean isRemoveLast , boolean isInternal ) { return ( ( ( ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.checkStoragePool ( ) ) && ( checkStorageDomain ( ) ) ) && ( checkStorageDomainStatus ( StorageDomainStatus.InActive , StorageDomainStatus.Maintenance ) ) ) && ( ( ( isMaster ( ) ) || isDestroyStoragePool ) || ( checkMasterDomainIsUp ( ) ) ) ) && ( isNotLocalData ( isInternal ) ) ) && ( isDetachAllowed ( isRemoveLast ) ) ; }

Target:
protected boolean canDetachDomain ( boolean isDestroyStoragePool , boolean isRemoveLast , boolean isInternal ) { return ( ( ( ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.checkStoragePool ( ) ) && ( checkStorageDomain ( ) ) ) && ( checkStorageDomainStatus ( StorageDomainStatus.Inactive , StorageDomainStatus.Maintenance ) ) ) && ( ( ( isMaster ( ) ) || isDestroyStoragePool ) || ( checkMasterDomainIsUp ( ) ) ) ) && ( isNotLocalData ( isInternal ) ) ) && ( isDetachAllowed ( isRemoveLast ) ) ; }
Source:
public static void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void validateVmRunningStateless ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS.name ( ) ) ) ; }

Target:
public void validateFailsWhenCreateAllSnapshotFromVmValidationFails ( ) { createParameters ( srcStorageId , dstStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
public void testSave ( ) { staticDao.save ( newStaticDomain ) ; newDynamicDomain.setId ( newStaticDomain.getId ( ) ) ; dao.save ( newDynamicDomain ) ; org.ovirt.engine.core.common.businessentities.StorageDomainDynamic result = dao.get ( newDynamicDomain.getId ( ) ) ; assertNotNull ( result ) ; }

Target:
public void testSave ( ) { staticDao.save ( newStaticDomain ) ; newDynamicDomain.setId ( newStaticDomain.getId ( ) ) ; dao.save ( newDynamicDomain ) ; org.ovirt.engine.core.common.businessentities.StorageDomainDynamic result = dao.get ( newDynamicDomain.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.CommandEntity buildCommandEntity ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid rootCommandId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.compat.CommandStatus status ) { org.ovirt.engine.core.common.businessentities.CommandEntity entity = new org.ovirt.engine.core.common.businessentities.CommandEntity ( ) ; entity.setId ( commandId ) ; entity.setRootCommandId ( rootCommandId ) ; entity.setCommandType ( actionType ) ; entity.setActionParameters ( params ) ; entity.setCommandStatus ( status ) ; return entity ; }

Target:
private org.ovirt.engine.core.common.businessentities.CommandEntity buildCommandEntity ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid rootCommandId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.compat.CommandStatus status , boolean enableCallBack ) { org.ovirt.engine.core.common.businessentities.CommandEntity entity = new org.ovirt.engine.core.common.businessentities.CommandEntity ( ) ; entity.setId ( commandId ) ; entity.setRootCommandId ( rootCommandId ) ; entity.setCommandType ( actionType ) ; entity.setActionParameters ( params ) ; entity.setCommandStatus ( status ) ; return entity ; }
Source:
private void validateVmNetworkInterfaceId ( java.lang.String nicId , java.util.Map < java.lang.String , java.lang.Object > vmStruct ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNetworkInterfaceList = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmNetworkInterfacesFromDevices ( vmStruct ) ; org.junit.Assert.assertNotNull ( vmNetworkInterfaceList ) ; org.junit.Assert.assertEquals ( 1 , vmNetworkInterfaceList.size ( ) ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmNetworkInterface = vmNetworkInterfaceList.get ( 0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( nicId ) , vmNetworkInterface.getId ( ) ) ; }

Target:
private void validateVmNetworkInterfaceId ( java.lang.String nicId , java.util.Map < java.lang.String , java.lang.Object > vmStruct ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNetworkInterfaceList = vdsBrokerObjectsBuilder.buildVmNetworkInterfacesFromDevices ( vmStruct ) ; org.junit.Assert.assertNotNull ( vmNetworkInterfaceList ) ; org.junit.Assert.assertEquals ( 1 , vmNetworkInterfaceList.size ( ) ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmNetworkInterface = vmNetworkInterfaceList.get ( 0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( nicId ) , vmNetworkInterface.getId ( ) ) ; }
Source:
public void testGetDefaultSortbyPhrase ( ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( true ) ; assertTrue ( "HOST" , comp.getDefaultSort ( "HOST" ) . contains ( "vds_name" ) ) ; assertEquals ( "Garbage" , "" , comp.getDefaultSort ( "kjfhkjdshkjfs" ) ) ; assertEquals ( "Null" , "" , comp.getDefaultSort ( null ) ) ; }

Target:
public void testGetDefaultSortbyPhrase ( ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( true ) ; org.junit.Assert.assertTrue ( "HOST" , comp.getDefaultSort ( "HOST" ) . contains ( "vds_name" ) ) ; org.junit.Assert.assertEquals ( "Garbage" , "" , comp.getDefaultSort ( "kjfhkjdshkjfs" ) ) ; org.junit.Assert.assertEquals ( "Null" , "" , comp.getDefaultSort ( null ) ) ; }
Source:
public void calculateFreeVirtualMemory ( ) { if ( ( ( ( getMemCommited ( ) ) != null ) && ( ( getPhysicalMemMb ( ) ) != null ) ) && ( ( getReservedMem ( ) ) != null ) ) { maxSchedulingMemory = ( ( ( getMaxVdsMemoryOverCommit ( ) ) * ( getPhysicalMemMb ( ) ) ) / 100.0F ) - ( ( getMemCommited ( ) ) + ( getReservedMem ( ) ) ) ; maxSchedulingMemory = ( ( maxSchedulingMemory ) > 0 ) ? maxSchedulingMemory : 0 ; } }

Target:
public void calculateFreeVirtualMemory ( ) { if ( ( ( ( getMemCommited ( ) ) != null ) && ( ( getPhysicalMemMb ( ) ) != null ) ) && ( ( getReservedMem ( ) ) != null ) ) { maxSchedulingMemory = ( ( ( ( ( getMaxVdsMemoryOverCommit ( ) ) * ( getPhysicalMemMb ( ) ) ) / 100.0F ) - ( getMemCommited ( ) ) ) - ( getReservedMem ( ) ) ) - ( getPendingVmemSize ( ) ) ; maxSchedulingMemory = ( ( maxSchedulingMemory ) > 0 ) ? maxSchedulingMemory : 0 ; } }
Source:
protected void disconnectFromStorage ( ) { org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters connectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , Guid.Empty , org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionCommand.getConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; boolean isDisconnectSucceeded = runVdsCommand ( VDSCommandType.DisconnectStorageServer , connectionParametersForVdsm ) . getSucceeded ( ) ; if ( ! isDisconnectSucceeded ) { log.warn ( "Failed to disconnect storage connection {}" , org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; } }

Target:
protected void disconnectFromStorage ( ) { org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters connectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , Guid.Empty , org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionCommand.getConnection ( ) . getStorageType ( ) , org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; boolean isDisconnectSucceeded = runVdsCommand ( VDSCommandType.DisconnectStorageServer , connectionParametersForVdsm ) . getSucceeded ( ) ; if ( ! isDisconnectSucceeded ) { log.warn ( "Failed to disconnect storage connection {}" , org.ovirt.engine.core.bll.storage.connection.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
protected java.lang.String transform ( java.util.ArrayList < java.lang.String > fileNameList , org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return repoImage.getRepoImageId ( ) ; }
Source:
public void discoverNetworks ( ) { getProviders ( ) . setItems ( java.util.Collections.singletonList ( provider ) ) ; getProviders ( ) . setSelectedItem ( provider ) ; }

Target:
public void discoverNetworks ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.Provider < ? > > items = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider < ? > > ( ) ; items.add ( provider ) ; getProviders ( ) . setItems ( items ) ; getProviders ( ) . setSelectedItem ( provider ) ; }
Source:
public static java.lang.StringBuilder linkBuffer ( ) { org.ovirt.engine.api.restapi.invocation.Current current = org.ovirt.engine.api.restapi.invocation.CurrentManager.get ( ) ; java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( current.getPrefix ( ) ) ; if ( ( current.getVersionSource ( ) ) == ( org.ovirt.engine.api.restapi.invocation.VersionSource.URL ) ) { builder.append ( "/v" ) ; builder.append ( current.getVersion ( ) ) ; } return builder ; }

Target:
public static java.lang.String linkHref ( java.lang.String ... segments ) { org.ovirt.engine.api.restapi.invocation.Current current = org.ovirt.engine.api.restapi.invocation.CurrentManager.get ( ) ; return current.getAbsolutePath ( segments ) ; }
Source:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; group.setCompatibilityVersion ( Version.v3_3 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO" ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }

Target:
public void testCannotDisableVirtioScsi ( ) { prepareVmToPassValidate ( ) ; command.getParameters ( ) . setVirtioScsiEnabled ( false ) ; org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setPlugged ( true ) ; mockDiskDaoGetAllForVm ( java.util.Collections.singletonList ( disk ) , true ) ; mockVmValidator ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getEntityId ( ) . toString ( ) , new org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > ( LockingGroup.DISK.name ( ) , getDiskIsBeingRemovedLockMessage ( ) ) ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getEntityId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , getDiskIsBeingRemovedLockMessage ( ) ) ) ; }
Source:
public void validateVmIsNotDown ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }

Target:
public void validateVmIsNotDown ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( diskValidator.isDiskPluggedToVmsThatAreNotDown ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
protected void executeCommand ( ) { asyncTaskStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( this . getExecutionContext ( ) , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , getStepType ( ) , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( getStepType ( ) , getStepMessageMap ( ) ) ) ; handleTaskReturn ( executeAndReturnTask ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask handleTaskReturn ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask ) { org.ovirt.engine.core.compat.Guid externalTaskId = asyncTask.getTaskId ( ) ; asyncTaskStep.setStatus ( JobExecutionStatus.STARTED ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.updateStepExternalId ( asyncTaskStep , externalTaskId , ExternalSystemType.GLUSTER ) ; org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . setStatus ( JobExecutionStatus.STARTED ) ; asyncTask.setStepId ( asyncTaskStep.getId ( ) ) ; return asyncTask ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( p.getUsageCpuPercent ( ) ) >= highUtilization ) && ( ( p.getCpuOverCommitTimestamp ( ) ) != null ) ) && ( ( ( new java.util.Date ( ) . getTime ( ) ) - ( p.getCpuOverCommitTimestamp ( ) . getTime ( ) ) ) >= ( ( cpuOverCommitDurationMinutes * 1000L ) * 60L ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( ( p.getUsageCpuPercent ( ) ) >= highUtilization ) && ( ( p.getCpuOverCommitTimestamp ( ) ) != null ) ) && ( ( ( new java.util.Date ( ) . getTime ( ) ) - ( p.getCpuOverCommitTimestamp ( ) . getTime ( ) ) ) >= ( ( cpuOverCommitDurationMinutes * 1000L ) * 60L ) ) ) && ( ( p.getVmCount ( ) ) > 0 ) ; }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

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:
protected void executeQuery ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.DirectorySearcher directorySearcher ) { final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > userList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LdapUser > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > usersList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( directorySearcher.findAll ( getLdapQueryData ( ) ) ) ) ; for ( final org.ovirt.engine.core.common.businessentities.LdapUser searchResult : usersList ) { { org.ovirt.engine.core.common.businessentities.LdapUser user = populateUserData ( searchResult , getLdapQueryData ( ) . getDomain ( ) , false ) ; userList.add ( user ) ; } } setReturnValue ( userList ) ; setSucceeded ( true ) ; }

Target:
protected void executeQuery ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.DirectorySearcher directorySearcher ) { final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > userList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LdapUser > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > usersList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( directorySearcher.findAll ( getLdapQueryData ( ) ) ) ) ; for ( final org.ovirt.engine.core.common.businessentities.LdapUser searchResult : usersList ) { { org.ovirt.engine.core.common.businessentities.LdapUser user = populateUserData ( searchResult , getLdapQueryData ( ) . getDomain ( ) , populateGroups ) ; userList.add ( user ) ; } } setReturnValue ( userList ) ; setSucceeded ( true ) ; }
Source:
public void testActivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = resource ; setUpGetEntityExpectations ( 3 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } ) ) ; verifyActionResponse ( backendVmNicResource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testActivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = resource ; setUpGetEntityExpectations ( 3 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } ) ) ; verifyActionResponse ( backendVmNicResource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
private org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler getBackendCommandObjectsHandler ( ) { try { javax.naming.InitialContext ctx = new javax.naming.InitialContext ( ) ; return ( ( org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler ) ( ctx.lookup ( org.ovirt.engine.core.bll.CommandBase.BACKEND_COMMAND_OBJECTS_HANDLER_JNDI_NAME ) ) ) ; } catch ( javax.naming.NamingException e ) { log.error ( ( "Getting backend command objects handler failed" + ( e.getMessage ( ) ) ) ) ; log.debug ( "" , e ) ; return null ; } }

Target:
public org.ovirt.engine.core.bll.tasks.interfaces.CommandCallBack getCallBack ( ) { return null ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createIscsiConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type , java.lang.String iqn , java.lang.String userName , java.lang.String password , java.lang.String portal ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setIqn ( iqn ) ; connectionDetails.setUserName ( userName ) ; connectionDetails.setPassword ( password ) ; connectionDetails.setPortal ( portal ) ; return connectionDetails ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StorageServerConnections createIscsiConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type , java.lang.String iqn , java.lang.String userName , java.lang.String password , java.lang.String portal ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommandTest.populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setIqn ( iqn ) ; connectionDetails.setUserName ( userName ) ; connectionDetails.setPassword ( password ) ; connectionDetails.setPortal ( portal ) ; return connectionDetails ; }
Source:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.warnFormat ( "Could not perform live snapshot due to error: {0}. VM will still be configured to the new created snapshot" , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }

Target:
private void logMemorySavingFailed ( ) { addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; auditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_NO_MEMORY_FAILURE ) ; }
Source:
private java.lang.String [ ] createIncoherentNicIdentificationErrorReplacements ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName ) { return new java.lang.String [ ] { java.lang.String.format ( "$id %s" , violatingEntityId ) , java.lang.String.format ( "$nicId %s" , nicId ) , java.lang.String.format ( "$nicName %s" , nicName ) } ; }

Target:
private java.lang.String [ ] createIncoherentNicIdentificationErrorReplacements ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName ) { return new java.lang.String [ ] { java.lang.String.format ( "ENTITY_ID %s" , violatingEntityId ) , java.lang.String.format ( "$nicId %s" , nicId ) , java.lang.String.format ( "$nicName %s" , nicName ) } ; }
Source:
public static void getUpHostListByCluster ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.Object > createParametersStruct ( ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < > ( ) ; struct.put ( VdsProperties.vm_guid , org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugOrUnplugNicVDSCommand.getParameters ( ) . getVm ( ) . getId ( ) . toString ( ) ) ; struct.put ( VdsProperties.VM_NETWORK_INTERFACE , initNicStructure ( ) ) ; struct.put ( VdsProperties.engineXml , generateDomainXml ( ) ) ; return struct ; }

Target:
protected java.util.Map < java.lang.String , java.lang.Object > createParametersStruct ( ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < > ( ) ; struct.put ( VdsProperties.vm_guid , org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugOrUnplugNicVDSCommand.getParameters ( ) . getVm ( ) . getId ( ) . toString ( ) ) ; struct.put ( VdsProperties.VM_NETWORK_INTERFACE , initNicStructure ( ) ) ; if ( org.ovirt.engine.core.common.FeatureSupported.isDomainXMLSupported ( org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugOrUnplugNicVDSCommand.getParameters ( ) . getVm ( ) . getClusterCompatibilityVersion ( ) ) ) { struct.put ( VdsProperties.engineXml , generateDomainXml ( ) ) ; } return struct ; }
Source:
private void validateNetworkQos ( ) { validateQosOverriddenInterfaces ( ) ; validateQosNotPartiallyConfigured ( ) ; validateQosCommitment ( ) ; }

Target:
private void validateNotRemovingGlusterBrickNetworks ( ) { for ( java.lang.String network : removedNetworks ) { org.ovirt.engine.core.common.businessentities.network.Network removedNetwork = getExistingClusterNetworks ( ) . get ( network ) ; if ( ( removedNetwork == null ) || ( ! ( removedNetwork.getCluster ( ) . isGluster ( ) ) ) ) { continue ; } java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = glusterBrickDao.getAllByClusterAndNetworkId ( vds.getVdsGroupId ( ) , removedNetwork.getId ( ) ) ; if ( ! ( bricks.isEmpty ( ) ) ) { addViolation ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_REMOVE_NETWORK_FROM_BRICK , network ) ; } } }