auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.util.Map < org.ovirt.engine.core.common.businessentities.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > filterConnectionsByStorageType ( org.ovirt.engine.core.common.businessentities.LUNs lun ) { java.util.Map < org.ovirt.engine.core.common.businessentities.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > storageConnectionsForStorageTypeMap = new java.util.EnumMap < org.ovirt.engine.core.common.businessentities.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections lunConnections : lun.getLunConnections ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( lunConnections.getstorage_type ( ) , lunConnections , storageConnectionsForStorageTypeMap ) ; } return storageConnectionsForStorageTypeMap ; }

Target:
public static java.util.Map < org.ovirt.engine.core.common.businessentities.storage.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > filterConnectionsByStorageType ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > storageConnectionsForStorageTypeMap = new java.util.EnumMap ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections lunConnections : lun.getLunConnections ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( lunConnections.getstorage_type ( ) , lunConnections , storageConnectionsForStorageTypeMap ) ; } return storageConnectionsForStorageTypeMap ; }
Source:
public void testConfigDirWithFlagSet ( ) throws java.lang.Exception { final java.lang.String path = java.net.URLDecoder.decode ( java.lang.ClassLoader.getSystemResource ( "engine-config.conf" ) . getPath ( ) , "UTF-8" ) ; junit.framework.Assert.assertNotNull ( path ) ; org.ovirt.engine.core.config.EngineConfig.main ( "-a" , ( "--config=" + path ) ) ; }

Target:
public void testConfigDirWithFlagSet ( ) throws java.lang.Exception { final java.lang.String path = java.net.URLDecoder.decode ( java.lang.ClassLoader.getSystemResource ( "engine-config.conf" ) . getPath ( ) , "UTF-8" ) ; junit.framework.Assert.assertNotNull ( path ) ; org.ovirt.engine.core.config.EngineConfigExecutor.main ( "-a" , ( "--config=" + path ) ) ; }
Source:
public boolean isFenceAgentVersionCompatible ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent , java.lang.String clusterCompatibilityVersion , java.util.List < java.lang.String > messages ) { if ( ! ( org.ovirt.engine.core.compat.Regex.IsMatch ( org.ovirt.engine.core.utils.pm.FenceConfigHelper.getFenceConfigurationValue ( ConfigValues.VdsFenceType.name ( ) , clusterCompatibilityVersion ) , java.lang.String.format ( "(,|^)%1$s(,|$)" , agent.getType ( ) ) ) ) ) { messages.add ( EngineMessage.ACTION_TYPE_FAILED_AGENT_NOT_SUPPORTED.name ( ) ) ; return false ; } else { return true ; } }

Target:
public boolean isFenceAgentVersionCompatible ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent , java.lang.String clusterCompatibilityVersion , java.util.List < java.lang.String > messages ) { if ( ! ( org.ovirt.engine.core.compat.Regex.isMatch ( org.ovirt.engine.core.utils.pm.FenceConfigHelper.getFenceConfigurationValue ( ConfigValues.VdsFenceType.name ( ) , clusterCompatibilityVersion ) , java.lang.String.format ( "(,|^)%1$s(,|$)" , agent.getType ( ) ) ) ) ) { messages.add ( EngineMessage.ACTION_TYPE_FAILED_AGENT_NOT_SUPPORTED.name ( ) ) ; return false ; } else { return true ; } }
Source:
public static void GetStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetLocalFSPath ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.action.UiAction unlabelNics ( java.util.List < org.ovirt.engine.core.common.action.LabelNicParameters > removedLabelsParameters ) { org.ovirt.engine.ui.uicommonweb.action.UiVdcAction uiVdcAction = new org.ovirt.engine.ui.uicommonweb.action.UiVdcAction ( org.ovirt.engine.core.common.action.VdcActionType.UnlabelNic , removedLabelsParameters.get ( 0 ) , this , true ) ; int size = removedLabelsParameters.size ( ) ; if ( size == 1 ) { return uiVdcAction ; } else { return uiVdcAction.then ( unlabelNics ( removedLabelsParameters.subList ( 1 , size ) ) ) ; } }

Target:
private org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters createBeforeSyncNetParams ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters params = new org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters ( ) ; params.setBootProtocol ( nic.getBootProtocol ( ) ) ; params.setAddress ( nic.getAddress ( ) ) ; params.setSubnet ( nic.getSubnet ( ) ) ; params.setGateway ( nic.getGateway ( ) ) ; params.setQos ( nic.getQos ( ) ) ; params.setQosOverridden ( attachment.isQosOverridden ( ) ) ; params.setCustomProperties ( attachment.getProperties ( ) ) ; return params ; }
Source:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }

Target:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }
Source:
private void updateSuggestedDiskAlias ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNextAvailableDiskAliasNameByVMId ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String suggestedDiskAlias = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( model ) ) ; diskModel.getAlias ( ) . setEntity ( suggestedDiskAlias ) ; } } ) , getVm ( ) . getId ( ) ) ; }

Target:
public void updateSuggestedDiskAliasFromServer ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNextAvailableDiskAliasNameByVMId ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String suggestedDiskAlias = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( model ) ) ; diskModel.getAlias ( ) . setEntity ( suggestedDiskAlias ) ; } } ) , getVm ( ) . getId ( ) ) ; }
Source:
public < T extends org.ovirt.engine.core.common.vdscommands.StorageDomainIdParametersBase & org.ovirt.engine.core.common.vdscommands.PostDeleteAction > T fixParameters ( T parameters ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = storageDomainStaticDao.get ( parameters.getStorageDomainId ( ) ) ; T parametersWithFixedPostZero = fixPostZeroField ( parameters , storageDomain.getStorageType ( ) . isFileDomain ( ) ) ; return fixDiscardField ( parametersWithFixedPostZero , storageDomain ) ; }

Target:
public < T extends org.ovirt.engine.core.common.vdscommands.StoragePoolDomainAndGroupIdBaseVDSCommandParameters & org.ovirt.engine.core.common.vdscommands.PostDeleteAction > T fixParameters ( T parameters ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = storageDomainStaticDao.get ( parameters.getStorageDomainId ( ) ) ; T parametersWithFixedPostZero = fixPostZeroField ( parameters , storageDomain.getStorageType ( ) . isFileDomain ( ) ) ; return fixDiscardField ( parametersWithFixedPostZero , storageDomain ) ; }
Source:
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.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void auditLog ( java.util.Map < java.lang.String , java.lang.String > customValues , org.ovirt.engine.core.common.AuditLogType auditLogType ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > customValue : customValues.entrySet ( ) ) { logable.addCustomValue ( customValue.getKey ( ) , customValue.getValue ( ) ) ; } getAuditLogDirector ( ) . log ( logable , auditLogType ) ; }

Target:
private void auditLogFailedToStoreDiskFields ( java.lang.String diskAlias , java.lang.String diskFieldsNames ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logable = createDiskEvent ( diskAlias ) ; logable.addCustomValue ( "DiskFieldsNames" , diskFieldsNames ) ; getAuditLogDirector ( ) . log ( logable , AuditLogType.FAILED_TO_STORE_DISK_FIELDS_IN_DISK_DESCRIPTION_METADATA ) ; }
Source:
public void invokeClient ( ) { org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.CLIENT_PAGE , getConfig ( ) , getOptions ( ) . getHost ( ) , getOptions ( ) . getPort ( ) , getOptions ( ) . getTicket ( ) , false ) ; invoker.invokeClient ( ) ; }

Target:
public void invokeClient ( ) { org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.CLIENT_PAGE , getConfig ( ) , getOptions ( ) . getHost ( ) , getOptions ( ) . getPort ( ) , getOptions ( ) . getTicket ( ) , false , ( ( getOptions ( ) . getVmName ( ) ) + ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.NOVNC_TITLE_SUFFIX ) ) ) ; invoker.invokeClient ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.LUNs createDummyLun ( ) { final org.ovirt.engine.core.common.businessentities.LUNs dummyLun = new org.ovirt.engine.core.common.businessentities.LUNs ( ) ; dummyLun.setLUN_id ( ( ( org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions.DUMMY_LUN_ID_PREFIX ) + ( org.ovirt.engine.core.bll.storage.AttachStorageConnectionToStorageDomainCommand.getStorageDomainId ( ) ) ) ) ; dummyLun.setvolume_group_id ( org.ovirt.engine.core.bll.storage.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) . getStorage ( ) ) ; return dummyLun ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.LUNs createDummyLun ( ) { final org.ovirt.engine.core.common.businessentities.storage.LUNs dummyLun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; dummyLun.setLUN_id ( ( ( org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions.DUMMY_LUN_ID_PREFIX ) + ( org.ovirt.engine.core.bll.storage.AttachStorageConnectionToStorageDomainCommand.getStorageDomainId ( ) ) ) ) ; dummyLun.setvolume_group_id ( org.ovirt.engine.core.bll.storage.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) . getStorage ( ) ) ; return dummyLun ; }
Source:
public void testCheckVmOnlyOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( inClusterUpgradeValidator ) . isVmReadyForUpgrade ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isVmReadyForUpgrade ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void testCheckVmOnlyOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( inClusterUpgradeValidator ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
protected void HandleUserSession ( org.ovirt.engine.core.common.businessentities.AdUser adUser ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.LoginBaseCommand.getParameters ( ) . getHttpSessionId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.user_sessions user_sessions = new org.ovirt.engine.core.dal.dbbroker.user_sessions ( "" , "" , new java.util.Date ( ) , "" , org.ovirt.engine.core.bll.LoginBaseCommand.getParameters ( ) . getHttpSessionId ( ) , adUser.getUserId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . saveSession ( user_sessions ) ; } }

Target:
protected void HandleUserSession ( org.ovirt.engine.core.common.businessentities.LdapUser ldapUser ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.LoginBaseCommand.getParameters ( ) . getHttpSessionId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.user_sessions user_sessions = new org.ovirt.engine.core.dal.dbbroker.user_sessions ( "" , "" , new java.util.Date ( ) , "" , org.ovirt.engine.core.bll.LoginBaseCommand.getParameters ( ) . getHttpSessionId ( ) , ldapUser.getUserId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . saveSession ( user_sessions ) ; } }
Source:
public void testIsNetworkInSyncWhenIpv4BootProtocolDifferent ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocol ( 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.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4BootProtocolEqual ( ) { initIpv4ConfigurationBootProtocol ( true ) ; org.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public void testReapingOnRemoveWithGC ( ) { setUpGCExpectations ( 5 ) ; populate ( 1 , 2 , 3 ) ; map.reapable ( "one" ) ; map.reapable ( "three" ) ; assertSizes ( 1 , 2 ) ; map.remove ( "two" ) ; assertSizes ( 0 , 1 ) ; org.junit.Assert.assertNull ( map.get ( "three" ) ) ; }

Target:
public void testReapingOnRemoveWithGC ( ) { setUpGCExpectations ( 5 ) ; populate ( 1 , 2 , 3 ) ; map.reapable ( "one" ) ; map.reapable ( "three" ) ; assertSizes ( 1 , 2 ) ; map.remove ( "two" ) ; assertSizes ( 0 , 1 ) ; org.junit.jupiter.api.Assertions.assertNull ( map.get ( "three" ) ) ; }
Source:
public void setFallbackProtocol ( ) { final org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = this . vds.getStaticData ( ) ; vdsStatic.setProtocol ( VdsProtocol.XML ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . update ( vdsStatic ) ; return null ; } } ) ; }

Target:
private void setFallbackProtocol ( org.ovirt.engine.core.common.businessentities.VdsProtocol protocol ) { final org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = this . vds.getStaticData ( ) ; vdsStatic.setProtocol ( protocol ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( ( ) -> { vdsStaticDao.update ( vdsStatic ) ; return null ; } ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( result.getState ( ) ) ) ; if ( dataCenterGuideModel.removeConnection ) { dataCenterGuideModel.CleanConnection ( dataCenterGuideModel.connection , dataCenterGuideModel.hostId ) ; dataCenterGuideModel.removeConnection = false ; } dataCenterGuideModel.OnFinish ( dataCenterGuideModel.context , false , dataCenterGuideModel.storageModel ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( result.getState ( ) ) ) ; if ( dataCenterGuideModel.removeConnection ) { dataCenterGuideModel.cleanConnection ( dataCenterGuideModel.connection , dataCenterGuideModel.hostId ) ; dataCenterGuideModel.removeConnection = false ; } dataCenterGuideModel.onFinish ( dataCenterGuideModel.context , false , dataCenterGuideModel.storageModel ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 1 , getEntity ( 0 ) ) ; setUpGetStorageServerConnectionExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateStorageDomain , org.ovirt.engine.core.common.action.StorageDomainManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 1 , getEntity ( 0 ) ) ; setUpGetStorageServerConnectionExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateStorageDomain , org.ovirt.engine.core.common.action.StorageDomainManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; }
Source:
public void hostNameNotUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }
Source:
protected void OnSelectedItemChanged ( ) { super . OnSelectedItemChanged ( ) ; UpdateActionAvailability ( ) ; }

Target:
protected void OnSelectedItemChanged ( ) { super . OnSelectedItemChanged ( ) ; UpdateActionAvailability ( ) ; if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; UpdateVmConfigurationBySnapshot ( snapshot.getId ( ) ) ; } }
Source:
public void testListFailure ( ) { setUpVnicProfilesQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae ) ; } }

Target:
public void testListCrash ( ) { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpVnicProfilesQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; }
Source:
protected void OnEntityChanged ( ) { if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ( this ) ; } else if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ( this ) ; } else { throw new java.lang.UnsupportedOperationException ( ) ; } behavior.OnEntityChanged ( ) ; }

Target:
protected void onEntityChanged ( ) { if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ( this ) ; } else if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ( this ) ; } else { throw new java.lang.UnsupportedOperationException ( ) ; } behavior.OnEntityChanged ( ) ; }
Source:
public void testNotRemovingLabeledNetworksNicHasLabelOldAttachRemovedNewAttachWithSameNetworkAddedToNicValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicWithLabel = createNic ( "nicWithLabel" ) ; nicWithLabel.setLabels ( java.util.Collections.singleton ( "lbl1" ) ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithNameAndLabel ( "net" , "lbl1" ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment = createNetworkAttachment ( network , nicWithLabel ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment addedAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( removedAttachment ) ; addedAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; assertTestNotRemovingLabeledNetworksValid ( nicWithLabel , removedAttachment , new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( addedAttachment ) . build ( ) , network ) ; }

Target:
public void testValidateNotRemovingUsedNetworkByVmsWhenNotUsedByVms ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . build ( ) ) ; org.mockito.Mockito.when ( findActiveVmsUsingNetwork.findNamesOfActiveVmsUsingNetworks ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( java.util.Collection.class ) ) ) . thenReturn ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.validateNotRemovingUsedNetworkByVms ( "removedNet" ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testNotEnoughSpaceToMergeSnapshotsWithMultipleDisk ( ) { spySdValidatorForOneDomain ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 15 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertFalse ( "Validation should fail. Free space minus threshold should be smaller then summarize all disks size" , cmd.validateStorageDomains ( ) ) ; }

Target:
public void testValidateImageNotInTemplateFalse ( ) { org.mockito.Mockito.when ( vmTemplateDAO.get ( mockSourceImageAndGetId ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) ; org.junit.Assert.assertFalse ( "validation should succeed" , cmd.validateImageNotInTemplate ( ) ) ; }
Source:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
private void updateRemoveDisksCheckBox ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model , boolean deleteDisks , boolean isChangable , java.lang.String changeProhibitionReason ) { model.setEntity ( deleteDisks ) ; if ( ( ! isChangable ) && ( changeProhibitionReason != null ) ) { model.getChangeProhibitionReasons ( ) . add ( changeProhibitionReason ) ; } model.setIsChangable ( isChangable ) ; }

Target:
private void updateRemoveDisksCheckBox ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model , boolean deleteDisks , boolean isChangable , java.lang.String changeProhibitionReason ) { model.setEntity ( deleteDisks ) ; if ( ( ! isChangable ) && ( changeProhibitionReason != null ) ) { model.setChangeProhibitionReason ( changeProhibitionReason ) ; } model.setIsChangable ( isChangable ) ; }
Source:
private java.lang.String getHostId ( java.lang.String hostName ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VdsStatic.class , VdcQueryType.GetVdsStaticByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( hostName ) , ( "Hosts: name=" + hostName ) ) . getId ( ) . toString ( ) ; }

Target:
private void updateIdForSingleHost ( org.ovirt.engine.api.model.Host host , java.util.Set < org.ovirt.engine.core.compat.Guid > guidsSet ) { if ( ( host.isSetName ( ) ) && ( ! ( host.isSetId ( ) ) ) ) { org.ovirt.engine.core.compat.Guid hostGuid = getHostId ( host ) ; if ( hostGuid != null ) { guidsSet.add ( hostGuid ) ; host.setId ( hostGuid.toString ( ) ) ; } } else if ( host.isSetId ( ) ) { guidsSet.add ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( host.getId ( ) ) ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getId ( ) , entity.getId ( ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getGlusterServerUuid ( ) , entity.getGlusterServerUuid ( ) ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ( obj ) ) ; return ( ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getId ( ) , entity.getId ( ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getGlusterServerUuid ( ) , entity.getGlusterServerUuid ( ) ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getKnownAddresses ( ) , entity.getKnownAddresses ( ) ) ) ; }
Source:
public static org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel createInstance ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.core.compat.Guid dcId , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNicList , org.ovirt.engine.ui.uicommonweb.models.EntityModel sourceModel ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel instance = new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel ( vm , dcId , clusterCompatibilityVersion , vmNicList , sourceModel ) ; instance.init ( ) ; return instance ; }

Target:
public static org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel createInstance ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.core.common.businessentities.VMStatus vmStatus , org.ovirt.engine.core.compat.Guid dcId , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNicList , org.ovirt.engine.ui.uicommonweb.models.EntityModel sourceModel ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel instance = new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel ( vm , vmStatus , dcId , clusterCompatibilityVersion , vmNicList , sourceModel ) ; instance.init ( ) ; return instance ; }
Source:
private void updateMemoryBalloonDevice ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } boolean isBalloonEnabled = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isBalloonEnabled ( osType , cluster.getCompatibilityVersion ( ) ) ; getMemoryBalloonDeviceEnabled ( ) . setIsChangeable ( isBalloonEnabled ) ; if ( getBehavior ( ) . basedOnCustomInstanceType ( ) ) { getMemoryBalloonDeviceEnabled ( ) . setEntity ( isBalloonEnabled ) ; } }

Target:
private void initConsoleDisconnectAction ( ) { getConsoleDisconnectAction ( ) . setItems ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.ConsoleDisconnectAction.values ( ) ) ) ; }
Source:
public javax.ws.rs.core.Response cloneVm ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "vm.name" ) ; org.ovirt.engine.api.restapi.resource.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , ( "VM: id=" + ( guid ) ) ) ; org.ovirt.engine.core.common.action.CloneVmParameters cloneVmParameters = new org.ovirt.engine.core.common.action.CloneVmParameters ( vm , action.getVm ( ) . getName ( ) ) ; cloneVmParameters.setMakeCreatorExplicitOwner ( isFiltered ( ) ) ; javax.ws.rs.core.Response response = doAction ( VdcActionType.CloneVm , cloneVmParameters , action ) ; return response ; }

Target:
public javax.ws.rs.core.Response clone ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "vm.name" ) ; org.ovirt.engine.api.restapi.resource.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , ( "VM: id=" + ( guid ) ) ) ; org.ovirt.engine.core.common.action.CloneVmParameters cloneVmParameters = new org.ovirt.engine.core.common.action.CloneVmParameters ( vm , action.getVm ( ) . getName ( ) ) ; cloneVmParameters.setMakeCreatorExplicitOwner ( isFiltered ( ) ) ; javax.ws.rs.core.Response response = doAction ( VdcActionType.CloneVm , cloneVmParameters , action ) ; return response ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void testUpdate ( ) { existingDomain.setStorageName ( "UpdatedName" ) ; dao.update ( existingDomain ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic after = dao.get ( existingDomain.getId ( ) ) ; org.junit.Assert.assertEquals ( after , existingDomain ) ; }

Target:
public void testUpdate ( ) { existingDomain.setStorageName ( "UpdatedName" ) ; existingDomain.setWipeAfterDelete ( true ) ; dao.update ( existingDomain ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic after = dao.get ( existingDomain.getId ( ) ) ; org.junit.Assert.assertEquals ( after , existingDomain ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > FindAllStorageDomainsBySharedStatus ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > items , org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus status ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain i : items ) { if ( ( i.getstorage_domain_shared_status ( ) ) == status ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > FindAllStorageDomainsBySharedStatus ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > items , org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus status ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain i : items ) { if ( ( i.getStorageDomainSharedStatus ( ) ) == status ) { ret.add ( i ) ; } } return ret ; }
Source:
protected void completeImageData ( org.ovirt.engine.core.common.businessentities.DiskImage fromIRS ) { getDestinationDiskImage ( ) . setCreationDate ( fromIRS.getCreationDate ( ) ) ; getDestinationDiskImage ( ) . setLastModifiedDate ( fromIRS.getLastModifiedDate ( ) ) ; getDestinationDiskImage ( ) . setLastModified ( getDestinationDiskImage ( ) . getLastModifiedDate ( ) ) ; org.ovirt.engine.core.common.businessentities.DiskImageDynamic destinationDiskDynamic = getDiskImageDynamicDAO ( ) . get ( getDestinationDiskImage ( ) . getImageId ( ) ) ; if ( destinationDiskDynamic != null ) { destinationDiskDynamic.setactual_size ( fromIRS.getActualSizeInBytes ( ) ) ; getDiskImageDynamicDAO ( ) . update ( destinationDiskDynamic ) ; } }

Target:
protected void completeImageData ( org.ovirt.engine.core.common.businessentities.storage.DiskImage fromIRS ) { getDestinationDiskImage ( ) . setCreationDate ( fromIRS.getCreationDate ( ) ) ; getDestinationDiskImage ( ) . setLastModifiedDate ( fromIRS.getLastModifiedDate ( ) ) ; getDestinationDiskImage ( ) . setLastModified ( getDestinationDiskImage ( ) . getLastModifiedDate ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic destinationDiskDynamic = getDiskImageDynamicDAO ( ) . get ( getDestinationDiskImage ( ) . getImageId ( ) ) ; if ( destinationDiskDynamic != null ) { destinationDiskDynamic.setactual_size ( fromIRS.getActualSizeInBytes ( ) ) ; getDiskImageDynamicDAO ( ) . update ( destinationDiskDynamic ) ; } }
Source:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNotNullAndBootProtocolIsStaticAndAddressIsNull ( ) throws java.lang.Exception { doTestIpConfiguredForStaticBootProtocol ( null , "255.255.255.0" ) ; }

Target:
public void testNetworkExistWhenBothNetworkNameAndNetworkIdAreSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( "network" ) ; networkAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( networkAttachment ) . networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testHostsRuleStructure ( ) { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( true ) ; rule.setPositive ( false ) ; model.setHostsRule ( rule ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVdsAffinityRule ( ) ) ; org.junit.Assert.assertTrue ( entity.isVdsEnforcing ( ) ) ; }

Target:
public void testHostsRuleStructure ( ) { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( true ) ; rule.setPositive ( false ) ; model.setHostsRule ( rule ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.jupiter.api.Assertions.assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVdsAffinityRule ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( entity.isVdsEnforcing ( ) ) ; }
Source:
private void Alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType ) ; }

Target:
private void alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.Erratum > runErrataListMethod ( java.lang.String relativeUrl ) { try { org.ovirt.engine.core.bll.host.provider.foreman.ErrataWrapper wrapper = objectMapper.readValue ( runHttpGetMethod ( relativeUrl ) , org.ovirt.engine.core.bll.host.provider.foreman.ErrataWrapper.class ) ; return mapErrata ( java.util.Arrays.asList ( wrapper.getResults ( ) ) ) ; } catch ( java.io.IOException e ) { return null ; } }

Target:
public org.ovirt.engine.core.common.businessentities.Erratum getErratumForHost ( java.lang.String hostName , java.lang.String erratumId ) { return getContentHostProvider ( ) . getErratumForHost ( hostName , erratumId ) ; }