auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc getVGList ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getLVMVolumeGroups" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vglist" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc getHostJobs ( java.lang.String jobType , java.util.List < java.lang.String > jobIds ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getJobs" ) . withOptionalParameter ( "job_type" , jobType ) . withOptionalParameterAsList ( "job_ids" , jobIds ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "jobs" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc ( response ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ( getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ! ( memoryChecker.evaluate ( vds , getVm ( ) ) ) ) ) { sb.append ( "has insufficient memory to run the VM" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_MEMORY ; } return null ; }

Target:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ( getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ! ( memoryChecker.evaluate ( vds , getVm ( ) ) ) ) ) { sb.append ( "has insufficient memory to run the VM" ) ; return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_MEMORY ; } return null ; }
Source:
public void executeCommandFailedWhenServerIdPresent ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID , org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommandTest.SERVER_ID ) ) ) ; setUpMocksForUpdate ( ) ; mockForReadContent ( false , VdcBllErrors.GlusterHookNotFound ) ; try { cmd.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { org.junit.Assert.assertEquals ( e.getErrorCode ( ) , VdcBllErrors.GlusterHookNotFound ) ; } org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; }

Target:
public void executeCommandFailedWhenServerIdPresent ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID , org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommandTest.SERVER_ID ) ) ) ; setUpMocksForUpdate ( ) ; mockForReadContent ( false , EngineError.GlusterHookNotFound ) ; try { cmd.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.junit.Assert.assertEquals ( e.getErrorCode ( ) , EngineError.GlusterHookNotFound ) ; } org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > upHosts = filterUpHosts ( hosts ) ; proxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; xenProxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; this . hosts.setItems ( upHosts ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > upHosts = filterUpHosts ( hosts ) ; proxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; xenProxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; kvmProxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; this . hosts.setItems ( upHosts ) ; stopProgress ( ) ; }
Source:
public void poll ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = getVmsFetcher ( ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( fetcher , fetchTime ) . perform ( ) ; } else { org.ovirt.engine.core.vdsbroker.PollVmStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , manager.getVdsName ( ) ) ; } } }

Target:
public void poll ( ) { if ( vdsManager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = getVmsFetcher ( ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( fetcher , fetchTime ) . perform ( ) ; } else { org.ovirt.engine.core.vdsbroker.PollVmStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , vdsManager.getVdsName ( ) ) ; } } }
Source:
public static boolean isVmTemlateWithSameNameExist ( java.lang.String name ) { org.ovirt.engine.core.common.queries.SearchParameters p = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "template : name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.VmTemplate ) ; p.setMaxCount ( java.lang.Integer.MAX_VALUE ) ; java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > list = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( VdcQueryType.Search , p ) . getReturnValue ( ) ) ) ; return ( list.size ( ) ) > 0 ; }

Target:
public static boolean isVmTemlateWithSameNameExist ( java.lang.String name ) { return ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . getByName ( name , null , false ) ) != null ; }
Source:
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 ) { if ( ( ( getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( getEnableTrustedService ( ) . getEntity ( ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangeable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangeable ( true ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getEnableKsm ( ) . getEntity ( ) ) == null ) { return ; } if ( ( getEnableKsm ( ) . getEntity ( ) ) == true ) { getKsmPolicyForNumaSelection ( ) . setIsChangeable ( true ) ; } if ( ( getEnableKsm ( ) . getEntity ( ) ) == false ) { getKsmPolicyForNumaSelection ( ) . setIsChangeable ( false ) ; } }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StoragePoolUnknown : case SpmStatusError : break ; case TaskInProgress : org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) . mMessage ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . ProceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StoragePoolUnknown : case SpmStatusError : break ; case TaskInProgress : org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) . mMessage ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }
Source:
private org.ovirt.engine.core.bll.ValidationResult networkActuallyExists ( org.ovirt.engine.core.compat.Guid networkId ) { if ( ( networkBusinessEntityMap.get ( networkId ) ) == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_NOT_EXISTS ) ; } else { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } }

Target:
org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentNotRemoved ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.core.compat.Guid networkAttachmentId = networkAttachment.getId ( ) ; if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentInRemoveList = params.getRemovedNetworkAttachments ( ) . contains ( networkAttachmentId ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ATTACHMENT_IN_BOTH_LISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "NETWORK_ATTACHMENT_IN_BOTH_LISTS_ENTITY" , networkAttachmentId.toString ( ) ) ) . when ( attachmentInRemoveList ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.Quota mockBasicQuota ( ) { org.ovirt.engine.core.bll.quota.QuotaManagerTest.dbWasCalled = true ; org.ovirt.engine.core.common.businessentities.Quota quota = new org.ovirt.engine.core.common.businessentities.Quota ( ) ; quota.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; quota.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; quota.setDescription ( "My Quota description" ) ; quota.setQuotaName ( "My Quota Name" ) ; quota.setGraceStoragePercentage ( 20 ) ; quota.setGraceVdsGroupPercentage ( 20 ) ; quota.setThresholdStoragePercentage ( 80 ) ; quota.setThresholdVdsGroupPercentage ( 80 ) ; quota.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; return quota ; }

Target:
private org.ovirt.engine.core.common.businessentities.Quota mockBasicQuota ( ) { dbWasCalled = true ; org.ovirt.engine.core.common.businessentities.Quota quota = new org.ovirt.engine.core.common.businessentities.Quota ( ) ; quota.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; quota.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; quota.setDescription ( "My Quota description" ) ; quota.setQuotaName ( "My Quota Name" ) ; quota.setGraceStoragePercentage ( 20 ) ; quota.setGraceVdsGroupPercentage ( 20 ) ; quota.setThresholdStoragePercentage ( 80 ) ; quota.setThresholdVdsGroupPercentage ( 80 ) ; quota.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; return quota ; }
Source:
public void testValidateQosOverriddenInterfacesWhenHostNetworkQosIsNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithName ( "network" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createValidatorForTestingValidateQosOverridden ( network ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentStringWithMultipleValues ( EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , network.getName ( ) ) ) ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.CreateOrUpdateBond createOrUpdateBond = createNewCreateOrUpdateBond ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "bond1" , "slaveA" , "slaveB" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addBonds ( createOrUpdateBond ) ) . build ( ) ; doTestValidateModifiedBondSlaves ( org.mockito.Mockito.spy ( validator ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static 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 ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile ) { return createIdParameterMapper ( profile.getId ( ) ) . addValue ( "name" , profile.getName ( ) ) . addValue ( "network_id" , profile.getNetworkId ( ) ) . addValue ( "port_mirroring" , profile.isPortMirroring ( ) ) . addValue ( "description" , profile.getDescription ( ) ) . addValue ( "custom_properties" , org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serialize ( profile.getCustomProperties ( ) ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile ) { return createIdParameterMapper ( profile.getId ( ) ) . addValue ( "name" , profile.getName ( ) ) . addValue ( "network_id" , profile.getNetworkId ( ) ) . addValue ( "network_qos_id" , profile.getNetworkQosId ( ) ) . addValue ( "port_mirroring" , profile.isPortMirroring ( ) ) . addValue ( "description" , profile.getDescription ( ) ) . addValue ( "custom_properties" , org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serialize ( profile.getCustomProperties ( ) ) ) ; }
Source:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.UpdateVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "DiskId" , "DiskInfo.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID , GUIDS [ 1 ] , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.UpdateVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "DiskId" , "DiskInfo.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }
Source:
private void addQuotaRow ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.VerticalPanel list , java.lang.String quotaName , org.ovirt.engine.ui.userportal.widget.QuotaProgressBar progressBar ) { org.ovirt.engine.ui.userportal.section.main.view.tab.extended.VerticalPanel verticalPanel = new org.ovirt.engine.ui.userportal.section.main.view.tab.extended.VerticalPanel ( ) ; org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Label quotaNameLabel = new org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Label ( ) ; quotaNameLabel.setText ( quotaName ) ; verticalPanel.add ( quotaNameLabel ) ; verticalPanel.add ( progressBar ) ; verticalPanel.setWidth ( "100%" ) ; list.add ( verticalPanel ) ; }

Target:
private void addQuotaRow ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.VerticalPanel list , java.lang.String quotaName , org.ovirt.engine.ui.userportal.widget.QuotaProgressBar progressBar ) { org.ovirt.engine.ui.userportal.section.main.view.tab.extended.FlowPanel flowPanel = new org.ovirt.engine.ui.userportal.section.main.view.tab.extended.FlowPanel ( ) ; org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Label quotaNameLabel = new org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Label ( ) ; quotaNameLabel.setText ( quotaName ) ; flowPanel.add ( quotaNameLabel ) ; flowPanel.add ( progressBar ) ; flowPanel.setWidth ( "100%" ) ; list.add ( flowPanel ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain addNewStorageDomainToDisk ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storage.setStorageType ( storageType ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( storage.getId ( ) ) ) ) ; return storage ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain addNewStorageDomainToDisk ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storage.setStorageType ( storageType ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storage.getId ( ) ) ) ) ; return storage ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > > asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
private void setUpGetSoundcardExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetSoundDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }

Target:
private void setUpGetSoundcardExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( QueryType.GetSoundDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.LunDisk > filterDiskBasedOnLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > listOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.LunDisk > lunDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LunDisk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : listOfDisks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) { lunDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( disk ) ) ) ; } } return lunDisks ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.LunDisk > filterDiskBasedOnLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > listOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LunDisk > lunDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LunDisk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : listOfDisks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { lunDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( disk ) ) ) ; } } return lunDisks ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : org.ovirt.engine.core.bll.AddVmTemplateCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getQuotaIdForDisk ( disk ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }

Target:
private void endDefaultOperations ( ) { endUnlockOps ( ) ; if ( isTemplateVersion ( ) ) { java.lang.String jobId = getSchedulUtil ( ) . scheduleAOneTimeJob ( this , "updateVmVersion" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , 0 , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.core.bll.AddVmTemplateCommand.updateVmsJobIdMap.put ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getBaseTemplateId ( ) , jobId ) ; } }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static void getRoleList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
protected void log ( ) { final javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { try { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this ) ; } catch ( final java.lang.RuntimeException ex ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.errorFormat ( "Error during log command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
protected void log ( ) { final javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { try { auditLogDirector.log ( this ) ; } catch ( final java.lang.RuntimeException ex ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.error ( "Error during log command: {}. Exception {}" , getClass ( ) . getName ( ) , ex.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.debug ( "Exception" , ex ) ; } } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }
Source:
private void addSourceStorageDomainName ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel disk , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceStorageDomains ) { java.lang.String sourceStorageName = ( sourceStorageDomains.isEmpty ( ) ) ? constants.notAvailableLabel ( ) : sourceStorageDomains.get ( 0 ) . getstorage_name ( ) ; disk.getSourceStorageDomainName ( ) . setEntity ( sourceStorageName ) ; }

Target:
private void addSourceStorageDomainName ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel disk , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceStorageDomains ) { java.lang.String sourceStorageName = ( sourceStorageDomains.isEmpty ( ) ) ? constants.notAvailableLabel ( ) : sourceStorageDomains.get ( 0 ) . getStorageName ( ) ; disk.getSourceStorageDomainName ( ) . setEntity ( sourceStorageName ) ; }
Source:
private void logMessage ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , final java.lang.String action , final java.lang.String status , org.ovirt.engine.core.common.AuditLogType logType ) { org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.logUtil.logAuditMessage ( clusterId , volume , null , logType , new java.util.HashMap < java.lang.String , java.lang.String > ( ) { { put ( "action" , action ) ; put ( "status" , status ) ; } } ) ; }

Target:
private void logMessage ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , final java.lang.String action , final java.lang.String status , org.ovirt.engine.core.common.AuditLogType logType ) { java.util.Map < java.lang.String , java.lang.String > customValues = new java.util.HashMap < > ( ) ; customValues.put ( "action" , action ) ; customValues.put ( "status" , status ) ; org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.logUtil.logAuditMessage ( clusterId , volume , null , logType , customValues ) ; }
Source:
public void validateSameSourceAndDest ( ) { destStorageId = srcStorageId ; initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; command.getParameters ( ) . setStorageDomainId ( destStorageId ) ; command.setStorageDomainId ( destStorageId ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }

Target:
public void validateSameSourceAndDest ( ) { destStorageId = srcStorageId ; initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; command.getParameters ( ) . setStorageDomainId ( destStorageId ) ; command.setStorageDomainId ( destStorageId ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain object ) { if ( ( object.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getstorage_domain_shared_status ( ) ) ; } else { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getstatus ( ) ) ; } }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain object ) { if ( ( object.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getStorageDomainSharedStatus ( ) ) ; } else { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getStatus ( ) ) ; } }
Source:
private java.lang.String GetValue ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.common.businessentities.VM ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( obj ) ) . getName ( ) ; } if ( obj instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { return ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( obj ) ) . getName ( ) ; } throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }

Target:
public boolean match ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster source ) { if ( ( source.getCluster ( ) ) == null ) { return false ; } return source.getCluster ( ) . getId ( ) . equals ( clusterId ) ; }
Source:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > boolean nameAndIdIsIncoherent ( org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { T interfaceById = map.get ( nicId ) ; T interfaceByName = map.get ( nicName ) ; return ! ( java.util.Objects.equals ( interfaceById , interfaceByName ) ) ; }

Target:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > org.ovirt.engine.core.bll.ValidationResult validateCoherentIdentification ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName , org.ovirt.engine.core.common.errors.EngineMessage message , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { boolean bothIdentificationSet = ( referringId != null ) && ( referringName != null ) ; java.lang.String [ ] replacements = createIncoherentIdentificationErrorReplacements ( violatingEntityId , referringId , referringName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( isNameAndIdIncoherent ( referringId , referringName , map ) ) ) ) ; }
Source:
public void template_SelectedItemChanged ( ) { super . template_SelectedItemChanged ( ) ; getModel ( ) . getName ( ) . setEntity ( "" ) ; getModel ( ) . getDescription ( ) . setEntity ( "" ) ; getModel ( ) . getComment ( ) . setEntity ( "" ) ; getModel ( ) . getProvisioning ( ) . setEntity ( true ) ; getModel ( ) . getProvisioning ( ) . setIsAvailable ( true ) ; getModel ( ) . getProvisioning ( ) . setIsChangable ( false ) ; initDisks ( ) ; initStorageDomains ( ) ; }

Target:
public void templateWithVersion_SelectedItemChanged ( ) { super . templateWithVersion_SelectedItemChanged ( ) ; getModel ( ) . getName ( ) . setEntity ( "" ) ; getModel ( ) . getDescription ( ) . setEntity ( "" ) ; getModel ( ) . getComment ( ) . setEntity ( "" ) ; getModel ( ) . getProvisioning ( ) . setEntity ( true ) ; getModel ( ) . getProvisioning ( ) . setIsAvailable ( true ) ; getModel ( ) . getProvisioning ( ) . setIsChangable ( false ) ; initDisks ( ) ; initStorageDomains ( ) ; }
Source:
public void testGetAsAbsoluteContext ( ) { java.lang.String result = org.ovirt.engine.core.utils.servlet.ServletUtils.getAsAbsoluteContext ( "/ovirt-engine/testpath" , ".." ) ; org.junit.Assert.assertEquals ( "The result should be '/ovirt-engine/'" , "/ovirt-engine/" , result ) ; result = org.ovirt.engine.core.utils.servlet.ServletUtils.getAsAbsoluteContext ( "/ovirt-engine/testpath" , "/something" ) ; org.junit.Assert.assertEquals ( "The result should be '/something'" , "/something" , result ) ; result = org.ovirt.engine.core.utils.servlet.ServletUtils.getAsAbsoluteContext ( "/ovirt-engine/testpath" , "../somethingelse" ) ; org.junit.Assert.assertEquals ( "The result should be '/ovirt-engine/somethingelse'" , "/ovirt-engine/somethingelse" , result ) ; result = org.ovirt.engine.core.utils.servlet.ServletUtils.getAsAbsoluteContext ( "/ovirt-engine/testpath" , "." ) ; org.junit.Assert.assertEquals ( "The result should be '/ovirt-engine/testpath/'" , "/ovirt-engine/testpath/" , result ) ; }

Target:
public void testGetAsAbsoluteContext ( ) { java.lang.String result = org.ovirt.engine.core.utils.servlet.ServletUtils.getAsAbsoluteContext ( "/ovirt-engine/testpath" , ".." ) ; org.junit.jupiter.api.Assertions.assertEquals ( "/ovirt-engine/" , result , "The result should be '/ovirt-engine/'" ) ; result = org.ovirt.engine.core.utils.servlet.ServletUtils.getAsAbsoluteContext ( "/ovirt-engine/testpath" , "/something" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "/something" , result , "The result should be '/something'" ) ; result = org.ovirt.engine.core.utils.servlet.ServletUtils.getAsAbsoluteContext ( "/ovirt-engine/testpath" , "../somethingelse" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "/ovirt-engine/somethingelse" , result , "The result should be '/ovirt-engine/somethingelse'" ) ; result = org.ovirt.engine.core.utils.servlet.ServletUtils.getAsAbsoluteContext ( "/ovirt-engine/testpath" , "." ) ; org.junit.jupiter.api.Assertions.assertEquals ( "/ovirt-engine/testpath/" , result , "The result should be '/ovirt-engine/testpath/'" ) ; }
Source:
protected void determineMigrationFailueForAuditLog ( ) { if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.MigrateStatus , new org.ovirt.engine.core.common.vdscommands.MigrateStatusVDSCommandParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { migrationErrorCode = e.getErrorCode ( ) ; } } }

Target:
protected void determineMigrationFailureForAuditLog ( ) { if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.MigrateStatus , new org.ovirt.engine.core.common.vdscommands.MigrateStatusVDSCommandParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { migrationErrorCode = e.getErrorCode ( ) ; } } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( glusterVolume.isOnline ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED ) ; return false ; } if ( ( ! ( glusterVolume.getVolumeType ( ) . isDistributedType ( ) ) ) || ( ( glusterVolume.getBricks ( ) . size ( ) ) == 1 ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_BRICKS_ARE_NOT_DISTRIBUTED ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( glusterVolume.getVolumeType ( ) . isDistributedType ( ) ) ) || ( ( glusterVolume.getBricks ( ) . size ( ) ) == 1 ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_BRICKS_ARE_NOT_DISTRIBUTED ) ; } return true ; }
Source:
private java.lang.String getMigrationNetworkAddress ( org.ovirt.engine.core.compat.Guid hostId , java.lang.String migrationNetworkName ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = org.ovirt.engine.core.bll.MigrateVmCommand.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( hostId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nics ) { if ( ( migrationNetworkName.equals ( nic.getNetworkName ( ) ) ) && ( migrationInterfaceUp ( nic , nics ) ) ) { return nic.getAddress ( ) ; } } return null ; }

Target:
private java.lang.String getMigrationNetworkAddress ( org.ovirt.engine.core.compat.Guid hostId , java.lang.String migrationNetworkName , java.util.function.Function < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , java.lang.String > ipAddressGetter ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = org.ovirt.engine.core.bll.MigrateVmCommand.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( hostId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nics ) { if ( ( migrationNetworkName.equals ( nic.getNetworkName ( ) ) ) && ( migrationInterfaceUp ( nic , nics ) ) ) { return ipAddressGetter.apply ( nic ) ; } } return null ; }
Source:
void localize ( org.ovirt.engine.ui.userportal.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameLabel.setText ( constants.loginFormUserNameLabel ( ) ) ; passwordLabel.setText ( constants.loginFormPasswordLabel ( ) ) ; domainLabel.setText ( constants.loginFormDomainLabel ( ) ) ; connectAutomatically.setLabel ( constants.loginFormConnectAutomaticallyLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.userportal.ApplicationConstants constants , org.ovirt.engine.ui.userportal.ApplicationDynamicConstants dynamicConstants ) { headerLabel.setText ( dynamicConstants.loginHeaderLabel ( ) ) ; userNameLabel.setText ( constants.loginFormUserNameLabel ( ) ) ; passwordLabel.setText ( constants.loginFormPasswordLabel ( ) ) ; domainLabel.setText ( constants.loginFormDomainLabel ( ) ) ; connectAutomatically.setLabel ( constants.loginFormConnectAutomaticallyLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }
Source:
public void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getCustomProperties ( ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } return permissionList ; }

Target:
private boolean isVMPartOfManualPool ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) == null ) { return false ; } final org.ovirt.engine.core.common.businessentities.VmPool vmPool = org.ovirt.engine.core.bll.RunVmCommand.getDbFacade ( ) . getVmPoolDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) ; return vmPool.getVmPoolType ( ) . equals ( VmPoolType.Manual ) ; }
Source:
protected void RemoveTaskFromDB ( ) { try { if ( ( coco.removeByVdsmTaskId ( getVdsmTaskId ( ) ) ) != 0 ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::RemoveTaskFromDB: Removed task {0} from DataBase" , getVdsmTaskId ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.error ( java.lang.String.format ( "BaseAsyncTask::RemoveTaskFromDB: Removing task %1$s from DataBase threw an exception." , getVdsmTaskId ( ) ) , e ) ; } }

Target:
protected void removeTaskFromDB ( ) { try { if ( ( coco.removeByVdsmTaskId ( getVdsmTaskId ( ) ) ) != 0 ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::removeTaskFromDB: Removed task {0} from DataBase" , getVdsmTaskId ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.error ( java.lang.String.format ( "BaseAsyncTask::removeTaskFromDB: Removing task %1$s from DataBase threw an exception." , getVdsmTaskId ( ) ) , e ) ; } }
Source:
public int compare ( java.lang.String str1 , java.lang.String str2 ) { return str1.toLowerCase ( ) . compareTo ( str2.toLowerCase ( ) ) ; }

Target:
private static final java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > filterProvidersByProvidedType ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > source , final org.ovirt.engine.core.common.VdcObjectType type ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( source , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.Provider > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.Provider provider ) { return provider.getType ( ) . getProvidedTypes ( ) . contains ( type ) ; } } ) ; }
Source:
public void getExternalProviderDiscoveredHostList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListAsyncConverter ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.NumaTuneMode mode , java.lang.String incoming ) { if ( mode == null ) { return null ; } switch ( mode ) { case STRICT : return NumaTuneMode.STRICT.value ( ) ; case INTERLEAVE : return NumaTuneMode.INTERLEAVE.value ( ) ; case PREFERRED : return NumaTuneMode.PREFERRED.value ( ) ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.NumaTuneMode map ( org.ovirt.engine.api.model.NumaTuneMode mode , org.ovirt.engine.api.model.NumaTuneMode incoming ) { if ( mode == null ) { return null ; } switch ( mode ) { case STRICT : return org.ovirt.engine.api.model.NumaTuneMode.STRICT ; case INTERLEAVE : return org.ovirt.engine.api.model.NumaTuneMode.INTERLEAVE ; case PREFERRED : return org.ovirt.engine.api.model.NumaTuneMode.PREFERRED ; default : return null ; } }