auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testImportVMFromConfigurationWhenStorageDomainIsInMaintenance ( ) { initCommand ( getOvfEntityData ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = createStorageDomain ( ) ; storageDomain.setStatus ( StorageDomainStatus.Maintenance ) ; org.mockito.Mockito.doReturn ( storageDomain ) . when ( cmd ) . getStorageDomain ( ) ; org.mockito.Mockito.when ( validator.validateUnregisteredEntity ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.IVdcQueryable.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.OvfEntityData.class ) , org.mockito.Matchers.anyList ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; }

Target:
public void testImportVMFromConfigurationWhenStorageDomainIsInMaintenance ( ) { initCommand ( getOvfEntityData ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = createStorageDomain ( ) ; storageDomain.setStatus ( StorageDomainStatus.Maintenance ) ; org.mockito.Mockito.doReturn ( storageDomain ) . when ( cmd ) . getStorageDomain ( ) ; org.mockito.Mockito.when ( validator.validateUnregisteredEntity ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.IVdcQueryable.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.OvfEntityData.class ) , org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; }
Source:
public void testJsonEmptyDiskDescription ( ) throws java.io.IOException { disk.setDiskAlias ( "DiskAlias" ) ; disk.setDiskDescription ( "" ) ; assertDiskDescriptionMap ( disk ) ; }

Target:
public void generateDiskDescriptionWhenAliasIsTruncated ( ) throws java.io.IOException { java.lang.String alias = org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateRandomString ( 200 ) ; disk.setDiskAlias ( alias ) ; disk.setDiskDescription ( "DiskDescription" ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( alias.substring ( 0 , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.DISK_ALIAS_MAX_LENGTH ) ) ) ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND , org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_NETWORK_INTERFACE_IS_NOT_BOND_ENTITY , bond.getName ( ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }

Target:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , bond.getName ( ) ) ) ; doTestValidModifiedBonds ( bond , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }
Source:
private void syncStorageDomainInfo ( java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Boolean > > hostConnectionInfo ) { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Boolean > pair : hostConnectionInfo ) { if ( java.lang.Boolean.TRUE.equals ( pair.getSecond ( ) ) ) { if ( org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( org.ovirt.engine.core.bll.storage.domain.ActivateStorageDomainCommand.getStorageDomain ( ) . getStorageType ( ) ) . syncDomainInfo ( org.ovirt.engine.core.bll.storage.domain.ActivateStorageDomainCommand.getStorageDomain ( ) , pair.getFirst ( ) ) ) { break ; } } } }

Target:
private void syncStorageDomainInfo ( java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Boolean > > hostConnectionInfo ) { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Boolean > pair : hostConnectionInfo ) { if ( java.lang.Boolean.TRUE.equals ( pair.getSecond ( ) ) ) { if ( org.ovirt.engine.core.bll.storage.connection.StorageHelperDirector.getInstance ( ) . getItem ( org.ovirt.engine.core.bll.storage.domain.ActivateStorageDomainCommand.getStorageDomain ( ) . getStorageType ( ) ) . syncDomainInfo ( org.ovirt.engine.core.bll.storage.domain.ActivateStorageDomainCommand.getStorageDomain ( ) , pair.getFirst ( ) ) ) { break ; } } } }
Source:
public void testRemove ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetVmHostDevicesExpectations ( ) ; setUpActionExpectations ( VdcActionType.RemoveVmHostDevices , org.ovirt.engine.core.common.action.VmHostDevicesParameters.class , new java.lang.String [ ] { "VmId" , "DeviceNames" } , new java.lang.Object [ ] { VM_ID , java.util.Collections.singletonList ( org.ovirt.engine.api.restapi.resource.DEVICE_NAME ) } , true , true ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetVmHostDevicesExpectations ( ) ; setUpActionExpectations ( ActionType.RemoveVmHostDevices , org.ovirt.engine.core.common.action.VmHostDevicesParameters.class , new java.lang.String [ ] { "VmId" , "DeviceNames" } , new java.lang.Object [ ] { VM_ID , java.util.Collections.singletonList ( org.ovirt.engine.api.restapi.resource.DEVICE_NAME ) } , true , true ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateStoragePoolUp ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { return ! ( vm.isAutoStartup ( ) ) ? new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( storagePool ) . isUp ( ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateStoragePoolUp ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.StoragePool storagePool , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmImages ) { if ( ( vmImages.isEmpty ( ) ) || ( vm.isAutoStartup ( ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( storagePool ) . isUp ( ) ; }
Source:
public static void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
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 ) ; }
Source:
private void updateOriginalTemplateNameOnDerivedVms ( ) { boolean templateNameChanged = ! ( java.util.Objects.equals ( oldTemplate.getName ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ) ; if ( templateNameChanged ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDao ( ) . updateOriginalTemplateName ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ; } }

Target:
private void updateOriginalTemplateNameOnDerivedVms ( ) { boolean templateNameChanged = ! ( java.util.Objects.equals ( oldTemplate.getName ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ) ; if ( templateNameChanged ) { vmDao.updateOriginalTemplateName ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ; } }
Source:
private void vmInitEnabledChanged ( ) { if ( ! ( getVmInitEnabled ( ) . getEntity ( ) ) ) { getSysprepEnabled ( ) . setEntity ( false ) ; getCloudInitEnabled ( ) . setEntity ( false ) ; } else { getSysprepEnabled ( ) . setEntity ( getIsWindowsOS ( ) ) ; getCloudInitEnabled ( ) . setEntity ( ( ! ( getIsWindowsOS ( ) ) ) ) ; } }

Target:
private void vmInitEnabledChanged ( ) { if ( ! ( getVmInitEnabled ( ) . getEntity ( ) ) ) { getSysprepEnabled ( ) . setEntity ( false ) ; getCloudInitEnabled ( ) . setEntity ( false ) ; } else { getSysprepEnabled ( ) . setEntity ( getIsWindowsOS ( ) ) ; getCloudInitEnabled ( ) . setEntity ( ( ! ( getIsWindowsOS ( ) ) ) ) ; autoSetHostname ( ) ; } }
Source:
public void testGenerateFullSpecParams ( ) { org.ovirt.engine.core.common.businessentities.VmRngDevice dev = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) ; dev.setBytes ( 12 ) ; dev.setPeriod ( 34 ) ; dev.setSource ( VmRngDevice.Source.RANDOM ) ; java.util.Map < java.lang.String , java.lang.Object > expectedParams = new java.util.HashMap < > ( ) ; expectedParams.put ( "bytes" , "12" ) ; expectedParams.put ( "period" , "34" ) ; expectedParams.put ( "source" , "random" ) ; org.junit.Assert.assertEquals ( expectedParams , dev.getSpecParams ( ) ) ; }

Target:
public void testGenerateFullSpecParams ( ) { org.ovirt.engine.core.common.businessentities.VmRngDevice dev = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) ; dev.setBytes ( 12 ) ; dev.setPeriod ( 34 ) ; dev.setSource ( VmRngDevice.Source.RANDOM ) ; java.util.Map < java.lang.String , java.lang.Object > expectedParams = new java.util.HashMap < > ( ) ; expectedParams.put ( "bytes" , "12" ) ; expectedParams.put ( "period" , "34" ) ; expectedParams.put ( "source" , "random" ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedParams , dev.getSpecParams ( ) ) ; }
Source:
protected void verifyRemoveAllDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.mockito.Mockito.verify ( macPoolManager , org.mockito.Mockito.times ( 1 ) ) . freeMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceDAO ) . remove ( iface.getId ( ) ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . remove ( iface.getId ( ) ) ; }

Target:
protected void verifyRemoveAllDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.mockito.Mockito.verify ( macPoolManager , org.mockito.Mockito.times ( 1 ) ) . freeMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNicDao ) . remove ( iface.getId ( ) ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . remove ( iface.getId ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForRoleNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( isRoleNetwork ( ) ) && ( ( ( ipConfiguration == null ) || ( ! ( ipConfiguration.hasIpv4PrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getIpv4PrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , getNetwork ( ) . getName ( ) ) ) . when ( failWhen ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForRoleNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( isRoleNetwork ( ) ) && ( ( ( ipConfiguration == null ) || ( ! ( ipConfiguration.hasIpv4PrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getIpv4PrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , getNetwork ( ) . getName ( ) ) ) . when ( failWhen ) ; }
Source:
private java.lang.String getTicket ( org.ovirt.engine.api.model.GraphicsType graphicsTypeEntity ) { final org.ovirt.engine.core.common.queries.GetSignedWebsocketProxyTicketParams params = new org.ovirt.engine.core.common.queries.GetSignedWebsocketProxyTicketParams ( getGuid ( ) , graphicsTypeEntity ) ; final org.ovirt.engine.core.common.queries.VdcQueryReturnValue ticketQueryReturnValue = runQuery ( VdcQueryType.GetSignedWebsocketProxyTicket , params ) ; if ( ! ( ticketQueryReturnValue.getSucceeded ( ) ) ) { try { backendFailure ( ticketQueryReturnValue.getExceptionString ( ) ) ; } catch ( org.ovirt.engine.api.restapi.resource.BackendFailureException ex ) { handleError ( ex , false ) ; } } return ticketQueryReturnValue.getReturnValue ( ) ; }

Target:
private java.lang.String getTicket ( org.ovirt.engine.api.model.GraphicsType graphicsTypeEntity ) { final org.ovirt.engine.core.common.queries.GetSignedWebsocketProxyTicketParams params = new org.ovirt.engine.core.common.queries.GetSignedWebsocketProxyTicketParams ( guid , graphicsTypeEntity ) ; final org.ovirt.engine.core.common.queries.VdcQueryReturnValue ticketQueryReturnValue = runQuery ( VdcQueryType.GetSignedWebsocketProxyTicket , params ) ; if ( ! ( ticketQueryReturnValue.getSucceeded ( ) ) ) { try { backendFailure ( ticketQueryReturnValue.getExceptionString ( ) ) ; } catch ( org.ovirt.engine.api.restapi.resource.BackendFailureException ex ) { handleError ( ex , false ) ; } } return ticketQueryReturnValue.getReturnValue ( ) ; }
Source:
public boolean isValid ( org.ovirt.engine.core.common.businessentities.VDSGroup value , javax.validation.ConstraintValidatorContext context ) { if ( ( value.supportsVirtService ( ) ) && ( ( value.getcpu_name ( ) ) == null ) ) { context.disableDefaultConstraintViolation ( ) ; context.buildConstraintViolationWithTemplate ( "VDS_GROUP_CPU_TYPE_CANNOT_BE_NULL" ) . addNode ( "cpu_name" ) . addConstraintViolation ( ) ; return false ; } return true ; }

Target:
public boolean isValid ( org.ovirt.engine.core.common.businessentities.VDSGroup value , javax.validation.ConstraintValidatorContext context ) { if ( ( value.supportsVirtService ( ) ) && ( ( value.getCpuName ( ) ) == null ) ) { context.disableDefaultConstraintViolation ( ) ; context.buildConstraintViolationWithTemplate ( "VDS_GROUP_CPU_TYPE_CANNOT_BE_NULL" ) . addNode ( "cpu_name" ) . addConstraintViolation ( ) ; return false ; } return true ; }
Source:
private void createUpVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdss = new java.util.ArrayList < > ( ) ; vdss.add ( new org.ovirt.engine.core.common.businessentities.VDS ( ) ) ; org.mockito.Mockito.when ( vdsDao.getAllForStoragePoolAndStatus ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( VDSStatus.Up ) ) ) . thenReturn ( vdss ) ; }

Target:
private void createUpVds ( ) { org.mockito.Mockito.when ( vdsDao.getAllForStoragePoolAndStatus ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( VDSStatus.Up ) ) ) . thenReturn ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.VDS ( ) ) ) ; }
Source:
protected void initFrontend ( ) { super . initFrontend ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . initHandlers ( eventBus ) ; }

Target:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . setSsoToken ( user.getEngineSessionId ( ) ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { commonModelProvider.get ( ) . updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity ( ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "hook_id" ) ) ) ; entity.setClusterId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "host_id" ) ) ) ; entity.setChecksum ( rs.getString ( "checksum" ) ) ; entity.setStatus ( rs.getString ( "status" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook ( ) ; entity.setHookId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "hook_id" ) ) ) ; entity.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "server_id" ) ) ) ; entity.setStatus ( rs.getString ( "hook_status" ) ) ; entity.setContentType ( rs.getString ( "content_type" ) ) ; entity.setChecksum ( rs.getString ( "checksum" ) ) ; return entity ; }
Source:
protected org.ovirt.engine.api.model.Host postPopulate ( org.ovirt.engine.api.model.Host from ) { while ( ( from.getPort ( ) ) == 0 ) { from.setPort ( org.ovirt.engine.api.restapi.types.MappingTestHelper.rand ( 65535 ) ) ; } from.getStorageManager ( ) . setPriority ( 3 ) ; return from ; }

Target:
protected org.ovirt.engine.api.model.Host postPopulate ( org.ovirt.engine.api.model.Host from ) { while ( ( from.getPort ( ) ) == 0 ) { from.setPort ( org.ovirt.engine.api.restapi.types.MappingTestHelper.rand ( 65535 ) ) ; } from.setProtocol ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.HostProtocol.class ) . value ( ) ) ; from.getSpm ( ) . setPriority ( 3 ) ; return from ; }
Source:
public static void getTemplateById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddNetwork" ) ) { AddNetwork ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddDisk" ) ) { AddDisk ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddNetwork" ) ) { addNetwork ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddDisk" ) ) { addDisk ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }
Source:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }
Source:
private java.lang.String composeExistingVmsWarningMessage ( java.util.List < T > existingVms ) { java.lang.String res = "" ; for ( T t : existingVms ) { java.lang.String name = extractNameFromEntity ( t ) ; res += ( "• " + name ) + " " ; } return res ; }

Target:
private java.lang.String composeExistingVmsWarningMessage ( java.util.List < T > existingVms ) { final java.util.List < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( ) ; for ( T t : existingVms ) { list.add ( extractNameFromEntity ( t ) ) ; } return org.ovirt.engine.ui.uicompat.external.StringUtils.join ( list , ", " ) ; }
Source:
public static org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getAliasColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return object.getDiskAlias ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getAliasColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return object.getDiskAlias ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
public void ResetIrs ( ) { setmCurrentIrsHost ( null ) ; setmIrsProxy ( null ) ; mCurrentVdsId = null ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( _storagePoolId ) ; if ( storagePool != null ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }

Target:
public void ResetIrs ( ) { nullifyInternalProxies ( ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( _storagePoolId ) ; if ( storagePool != null ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }
Source:
private void handleResuming ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.lockImage ( ) ; log.info ( "Resuming transfer for {}" , getTransferDescription ( ) ) ; extendTicketIfNecessary ( context ) ; updateEntityPhase ( ImageTransferPhase.TRANSFERRING ) ; resetPeriodicPauseLogTime ( 0 ) ; }

Target:
private void handleResuming ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.lockImage ( ) ; log.info ( "Resuming transfer for {}" , getTransferDescription ( ) ) ; auditLog ( this , AuditLogType.TRANSFER_IMAGE_RESUMED_BY_USER ) ; extendTicketIfNecessary ( context ) ; updateEntityPhase ( ImageTransferPhase.TRANSFERRING ) ; resetPeriodicPauseLogTime ( 0 ) ; }
Source:
public java.util.Map < java.lang.String , org.ovirt.optimizer.common.DebugSnapshot > getDebugSnapshot ( ) throws java.io.IOException { response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Origin" , "*" ) ; response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Methods" , "GET" ) ; if ( ! ( configProvider.load ( ) . getConfig ( ) . getProperty ( ConfigProvider.DEBUG_ENDPOINT_ENABLED , "false" ) . equals ( "true" ) ) ) { response.sendError ( 403 , "Debug url is disabled, please check your configuration." ) ; return null ; } return optimizer.getDebugSnapshot ( ) ; }

Target:
public java.util.Map < java.lang.String , org.ovirt.optimizer.rest.dto.DebugSnapshot > getDebugSnapshot ( ) throws java.io.IOException { response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Origin" , "*" ) ; response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Methods" , "GET" ) ; if ( ! ( configProvider.load ( ) . getConfig ( ) . getProperty ( ConfigProvider.DEBUG_ENDPOINT_ENABLED , "false" ) . equals ( "true" ) ) ) { response.sendError ( 403 , "Debug url is disabled, please check your configuration." ) ; return null ; } return optimizer.getDebugSnapshot ( ) ; }
Source:
private void addChildren ( org.ovirt.engine.core.common.businessentities.Tags tag ) { org.ovirt.engine.core.bll.TagsDirector.log.info ( "Tag '{}' added to tree" , tag.getTagName ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Tags > children = getTagDao ( ) . getAllForParent ( tag.getTagId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags child : children ) { addChildren ( child ) ; org.ovirt.engine.core.bll.TagsDirector.log.info ( "Tag '{}' added as child to parent '{}'" , child.getTagName ( ) , tag.getTagName ( ) ) ; tag.getChildren ( ) . add ( child ) ; addTagToHash ( tag ) ; addTagToHash ( child ) ; } }

Target:
private void addChildren ( org.ovirt.engine.core.common.businessentities.Tags tag ) { org.ovirt.engine.core.bll.TagsDirector.log.info ( "Tag '{}' added to tree" , tag.getTagName ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Tags > children = tagDao.getAllForParent ( tag.getTagId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags child : children ) { addChildren ( child ) ; org.ovirt.engine.core.bll.TagsDirector.log.info ( "Tag '{}' added as child to parent '{}'" , child.getTagName ( ) , tag.getTagName ( ) ) ; tag.getChildren ( ) . add ( child ) ; addTagToHash ( tag ) ; addTagToHash ( child ) ; } }
Source:
private void vmNotHavingPassthroughVnicsCommon ( org.ovirt.engine.core.compat.Guid vmId , int numOfPassthroughVnic , int numOfRegularVnics ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vnics = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < numOfPassthroughVnic ; ++ i ) { vnics.add ( mockVnic ( true ) ) ; } for ( int i = 0 ; i < numOfRegularVnics ; ++ i ) { vnics.add ( mockVnic ( false ) ) ; } org.mockito.Mockito.when ( vmNetworkInterfaceDao.getAllForVm ( vmId ) ) . thenReturn ( vnics ) ; }

Target:
private java.util.stream.Stream < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > createRegularNics ( int numberOfMocks ) { boolean migratable = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) ; return createMocks ( ( ) -> mockVnic ( false , migratable , true ) , numberOfMocks ) ; }
Source:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > getNumaNodes ( org.ovirt.engine.core.compat.Guid vmId ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > numaNodes = new java.util.ArrayList < > ( ) ; for ( final org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel model : numaModelsPerVm.get ( vmId ) . values ( ) ) { numaNodes.add ( model.toVmNumaNode ( ) ) ; } return numaNodes ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > getNumaNodes ( org.ovirt.engine.core.compat.Guid vmId ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > numaNodes = new java.util.ArrayList < > ( ) ; java.util.Map < java.lang.Integer , org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel > numaModels = numaModelsPerVm.get ( vmId ) ; if ( numaModels != null ) { for ( final org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel model : numaModels.values ( ) ) { if ( model != null ) { numaNodes.add ( model.toVmNumaNode ( ) ) ; } } } return numaNodes ; }
Source:
private static java.lang.Double AssignDoubleValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { java.lang.Double returnValue = null ; if ( input.containsKey ( name ) ) { java.lang.String stringValue = ( ( java.lang.String ) ( ( ( input.get ( name ) ) instanceof java.lang.String ) ? input.get ( name ) : null ) ) ; returnValue = ( stringValue == null ) ? null : java.lang.Double.parseDouble ( stringValue ) ; } return returnValue ; }

Target:
private static java.lang.Double computeInterfaceUsage ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { java.lang.Double receiveRate = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.truncatePercentage ( iface.getStatistics ( ) . getReceiveRate ( ) ) ; java.lang.Double transmitRate = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.truncatePercentage ( iface.getStatistics ( ) . getTransmitRate ( ) ) ; if ( receiveRate == null ) { return transmitRate ; } else if ( transmitRate == null ) { return receiveRate ; } else { return java.lang.Math.max ( receiveRate , transmitRate ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; if ( useLatest ) { template = new org.ovirt.engine.ui.uicommonweb.models.templates.LatestVmTemplate ( template ) ; } setupBaseTemplate ( template.getBaseTemplateId ( ) ) ; model.getTemplate ( ) . setItems ( java.util.Collections.singletonList ( template ) ) ; model.getTemplate ( ) . setSelectedItem ( template ) ; model.getTemplate ( ) . setIsChangable ( false ) ; }

Target:
public void onSuccess ( java.lang.Object nothing , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.VmTemplate baseTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion templateCouple = new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion ( baseTemplate , template ) ; setReadOnlyTemplateWithVersion ( templateCouple ) ; }
Source:
public void failWhenProxyHostNotAvailable ( ) { org.mockito.Mockito.when ( proxyLocator.isProxyHostAvailable ( ) ) . thenReturn ( false ) ; java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isProxyHostAvailable ( new org.ovirt.engine.core.common.businessentities.VDS ( ) , messages ) ; org.junit.Assert.assertFalse ( result ) ; org.junit.Assert.assertEquals ( 1 , messages.size ( ) ) ; org.junit.Assert.assertEquals ( "VDS_NO_VDS_PROXY_FOUND" , messages.get ( 0 ) ) ; }

Target:
public void failWhenProxyHostNotAvailable ( ) { org.mockito.Mockito.when ( proxyLocator.isProxyHostAvailable ( ) ) . thenReturn ( false ) ; java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isProxyHostAvailable ( new org.ovirt.engine.core.common.businessentities.VDS ( ) , messages ) ; org.junit.jupiter.api.Assertions.assertFalse ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , messages.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "VDS_NO_VDS_PROXY_FOUND" , messages.get ( 0 ) ) ; }
Source:
private boolean otherIfaceWithSameMacExists ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.ovirt.engine.core.compat.NGuid ifaceId = iface.getId ( ) ; if ( ifaceId != null ) { for ( org.ovirt.engine.core.compat.Guid ifaceFromList : getVmNetworkInterfaceDao ( ) . getVmInterfacesByMac ( iface.getMacAddress ( ) ) ) { if ( ! ( ifaceId.equals ( ifaceFromList ) ) ) { return true ; } } } return false ; }

Target:
private void removeMacFromMap ( java.util.Map < java.lang.String , java.lang.Integer > macMap , java.lang.String mac ) { if ( ( macMap.get ( mac ) ) <= 1 ) { macMap.remove ( mac ) ; } else { decrementMacInMap ( macMap , mac ) ; } }
Source:
private org.ovirt.engine.core.bll.ValidationResult vmNotDuringMigration ( ) { if ( ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) || ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingTo ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ; } return new org.ovirt.engine.core.bll.ValidationResult ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult vmNotDuringMigration ( ) { if ( ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) || ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingTo ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ; } return ValidationResult.VALID ; }
Source:
public void appendCustomValueAppend ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = "_" ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }

Target:
public void appendCustomValueDoesntHandleNullKeys ( ) { final java.lang.String key = null ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String sep = "_" ; b.appendCustomValue ( key , value , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , s ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) return true ; if ( ( o == null ) || ( ( getClass ( ) ) != ( o.getClass ( ) ) ) ) return false ; if ( ! ( super . equals ( o ) ) ) return false ; org.ovirt.engine.core.common.businessentities.storage.CinderDisk that = ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( o ) ) ; return ! ( ( cinderConnectionInfo ) != null ? ! ( cinderConnectionInfo.equals ( that.cinderConnectionInfo ) ) : ( that.cinderConnectionInfo ) != null ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( super . hashCode ( ) , cinderConnectionInfo ) ; }
Source:
private static java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( int numOfMonitors , boolean singleQxlPci ) { int heads = ( singleQxlPci ) ? numOfMonitors : 1 ; java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.HEADS , java.lang.String.valueOf ( heads ) ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.VRAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciVRamByHeads ( heads ) ) ; if ( singleQxlPci ) { specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.RAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciRamByHeads ( heads ) ) ; } return specParams ; }

Target:
private static java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return org.ovirt.engine.core.bll.utils.VideoDeviceSettings.getVideoDeviceSpecParams ( vmBase ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS none = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; none.setName ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . unlimitedQoSTitle ( ) ) ; none.setId ( Guid.Empty ) ; networkQoSes.add ( 0 , none ) ; getNetworkQoS ( ) . setItems ( networkQoSes ) ; setSelectedNetworkQoSId ( defaultQosId ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkQoS getEmptyQos ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.emptyQos ) == null ) { org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.emptyQos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.emptyQos.setName ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . unlimitedQoSTitle ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.emptyQos.setId ( Guid.Empty ) ; } return org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.emptyQos ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterHook model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertEquals ( "create" , model.getGlusterCommand ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterHook model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "create" , model.getGlusterCommand ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ; params.setRefresh ( false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , params , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } return true ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmPool getVmPoolCached ( ) { if ( ( ( vmPoolCached ) == null ) && ( ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getVmPoolId ( ) ) != null ) ) { vmPoolCached = getVmPoolDao ( ) . get ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getVmPoolId ( ) ) ; } return vmPoolCached ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.DiskInterface diskInterface , java.lang.String template ) { switch ( diskInterface ) { case IDE : return DiskInterface.IDE.value ( ) ; case VirtIO : return DiskInterface.VIRTIO.value ( ) ; default : return null ; } }

Target:
public static java.lang.String map ( org.ovirt.engine.api.model.DiskInterface diskInterface , java.lang.String template ) { switch ( diskInterface ) { case IDE : return DiskInterface.IDE.value ( ) ; case VirtIO : return DiskInterface.VIRTIO.value ( ) ; case VirtIO_SCSI : return DiskInterface.VIRTIO_SCSI.value ( ) ; default : return null ; } }