auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void PollAndUpdateAsyncTasks ( ) { if ( logChangedMap ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "AsyncTaskManager::PollAndUpdateAsyncTasks: {0} tasks, {1} tasks to poll now" , _tasks.size ( ) , NumberOfTasksToPoll ( ) ) ; } java.util.Set < org.ovirt.engine.core.compat.Guid > poolsOfActiveTasks = getPoolIdsTasks ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > > poolsAllTasksMap = getSPMsTasksStatuses ( poolsOfActiveTasks ) ; updateTaskStatuses ( poolsAllTasksMap ) ; }

Target:
private void PollAndUpdateAsyncTasks ( ) { if ( logChangedMap ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Polling and updating Async Tasks: {0} tasks, {1} tasks to poll now" , _tasks.size ( ) , NumberOfTasksToPoll ( ) ) ; } java.util.Set < org.ovirt.engine.core.compat.Guid > poolsOfActiveTasks = getPoolIdsTasks ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > > poolsAllTasksMap = getSPMsTasksStatuses ( poolsOfActiveTasks ) ; updateTaskStatuses ( poolsAllTasksMap ) ; }
Source:
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 ( java.lang.String 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 ) ) ) ) ; }

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:
public void qosBondSpeedMissing ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosBondSpeedSetup ( null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }
Source:
public void testCheckGroupsCanBeAttachedAlreadyExists ( ) { org.ovirt.engine.core.common.businessentities.RoleGroupMap map = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( getParams ( ) . getActionGroups ( ) . get ( 0 ) , getParams ( ) . getRoleId ( ) ) ; mockGetAllForRole ( java.util.Collections.singletonList ( map ) ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( 1 ) ; org.junit.Assert.assertTrue ( "canDoAction should fail" , getCommand ( ) . checkIfGroupsCanBeAttached ( messages ) ) ; org.junit.Assert.assertEquals ( "wrong messages" , EngineMessage.ERROR_CANNOT_ATTACH_ACTION_GROUP_TO_ROLE_ATTACHED.toString ( ) , messages.get ( 0 ) ) ; }

Target:
public void testCheckGroupsCanBeAttachedAlreadyExists ( ) { org.ovirt.engine.core.common.businessentities.RoleGroupMap map = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( getParams ( ) . getActionGroups ( ) . get ( 0 ) , getParams ( ) . getRoleId ( ) ) ; mockGetAllForRole ( java.util.Collections.singletonList ( map ) ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( 1 ) ; org.junit.Assert.assertTrue ( "validate should fail" , getCommand ( ) . checkIfGroupsCanBeAttached ( messages ) ) ; org.junit.Assert.assertEquals ( "wrong messages" , EngineMessage.ERROR_CANNOT_ATTACH_ACTION_GROUP_TO_ROLE_ATTACHED.toString ( ) , messages.get ( 0 ) ) ; }
Source:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( cachedVds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Failed to refresh VDS , cachedVds = '{}' : '{}', VDS Network Error, continuing. '{}'" , cachedVds.getId ( ) , cachedVds.getName ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( "Failed to refresh VDS , cachedVds = '{}' : '{}', VDS Network Error, continuing. '{}'" , cachedVds.getId ( ) , cachedVds.getName ( ) , e.getMessage ( ) ) ; } org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Exception" , e ) ; }

Target:
private void logHostFailToResponde ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ex , long timeoutToFence ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( ( "Server failed to respond, vds_id='{}', vds_name='{}', vm_count={}, " + "spm_status='{}', non-responsive_timeout (seconds)={}, error: {}" ) , cachedVds.getId ( ) , cachedVds.getName ( ) , cachedVds.getVmCount ( ) , cachedVds.getSpmStatus ( ) , java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( timeoutToFence ) , ex.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ; logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( cachedVds.getId ( ) ) ; logable.updateCallStackFromThrowable ( ex ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VDS_FAILURE ) ; }
Source:
public void testExecuteCommandByClusterIdForRestart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART ) ) ) ; setUpMockUpForRestart ( ) ; mockBackend ( true , null , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 4 ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_RESTARTED ) ; }

Target:
public void testExecuteCommandByClusterIdForRestart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART ) ) ) ; setUpMockUpForRestart ( ) ; mockBackend ( true , null , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 4 ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_RESTARTED ) ; }
Source:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNotNullAndBootProtocolIsNotStatic ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) . ipConfiguredForStaticBootProtocol ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) . ipConfiguredForStaticBootProtocol ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsDhcp ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
public void testGetValue ( ) { org.junit.Assert.assertFalse ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.NonVmNetworkSupported , "3.0" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.NonVmNetworkSupported , "3.1" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.NonVmNetworkSupported , "3.2" ) ) ; }

Target:
public void testGetValue ( ) { org.junit.Assert.assertFalse ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.CinderProviderSupported , "3.5" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.CinderProviderSupported , "3.6" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.CinderProviderSupported , "4.0" ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; return performAction ( VdcActionType.RemoveDisk , new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guid ) ) ; }

Target:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { get ( ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters params = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( asGuid ( id ) ) ; if ( action.isSetForce ( ) ) { params.setForceDelete ( action.isForce ( ) ) ; } if ( ( action.isSetStorageDomain ( ) ) && ( action.getStorageDomain ( ) . isSetId ( ) ) ) { params.setStorageDomainId ( asGuid ( action.getStorageDomain ( ) . getId ( ) ) ) ; } return performAction ( VdcActionType.RemoveDisk , params ) ; }
Source:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) ; org.junit.Assert.assertThat ( validator.ipConfiguredForStaticBootProtocol ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.junit.Assert.assertThat ( validator.ipConfiguredForStaticBootProtocol ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }

Target:
public void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( this , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }
Source:
public boolean IsTemplate ( ) { java.lang.String id1 = "1" ; java.lang.String id2 = "2" ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = _document.SelectSingleNode ( "//*/Content/TemplateId" ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { id1 = node.InnerText ; } org.ovirt.engine.core.compat.backendcompat.XmlNodeList list = _document.SelectNodes ( "//*/Content/Section" ) ; for ( org.ovirt.engine.core.compat.backendcompat.XmlNode section : list ) { java.lang.String value = section.Attributes.get ( "xsi:type" ) . getValue ( ) ; if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( value , "ovf:OperatingSystemSection_Type" ) ) { id2 = section.Attributes.get ( "ovf:id" ) . getValue ( ) ; } } return org.ovirt.engine.core.compat.StringHelper.EqOp ( id1 , id2 ) ; }

Target:
public boolean IsTemplate ( ) { java.lang.String id1 = "1" ; java.lang.String id2 = "2" ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = _document.SelectSingleNode ( "//*/Content/TemplateId" ) ; if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( node.InnerText ) ) ) { id1 = node.InnerText ; } org.ovirt.engine.core.compat.backendcompat.XmlNodeList list = _document.SelectNodes ( "//*/Content/Section" ) ; for ( org.ovirt.engine.core.compat.backendcompat.XmlNode section : list ) { java.lang.String value = section.Attributes.get ( "xsi:type" ) . getValue ( ) ; if ( org.apache.commons.lang.StringUtils.equals ( value , "ovf:OperatingSystemSection_Type" ) ) { id2 = section.Attributes.get ( "ovf:id" ) . getValue ( ) ; } } return org.apache.commons.lang.StringUtils.equals ( id1 , id2 ) ; }
Source:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParametersForEndAction ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters parameters = buildCreateSnapshotParameters ( ) ; parameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; return parameters ; }

Target:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParametersForEndAction ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters parameters = buildCreateSnapshotParameters ( ) ; parameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; if ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . isUseCinderCommandCallback ( ) ) { parameters.setShouldBeEndedByParent ( false ) ; parameters.setCommandId ( org.ovirt.engine.core.bll.RunVmCommand.getParametersForChildCommand ( ) . get ( 0 ) . getCommandId ( ) ) ; } return parameters ; }
Source:
public void updateCompletedJobAndSteps ( final org.ovirt.engine.core.common.job.Job job ) { 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 ( ) { for ( org.ovirt.engine.core.common.job.Step step : job.getSteps ( ) ) { if ( ( step.getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) { step.setStatus ( job.getStatus ( ) ) ; step.setEndTime ( job.getEndTime ( ) ) ; } } jobDao.update ( job ) ; return null ; } } ) ; }

Target:
public void updateCompletedJobAndSteps ( final org.ovirt.engine.core.common.job.Job job ) { 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 ( ) { jobDao.update ( job ) ; stepDao.updateJobStepsCompleted ( job.getId ( ) , job.getStatus ( ) , job.getEndTime ( ) ) ; return null ; } } ) ; }
Source:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > getAllRunningByVds ( org.ovirt.engine.core.compat.Guid id ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > map = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : getAllRunningForVds ( id ) ) { map.put ( vm.getId ( ) , vm ) ; } return map ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > vmsIds ) { return getCallsHandler ( ) . executeReadList ( "GetVmsByIds" , org.ovirt.engine.core.dao.VmDaoImpl.VMRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vms_ids" , createArrayOfUUIDs ( vmsIds ) ) ) ; }
Source:
private void PollAndUpdateAsyncTasks ( ) { if ( logChangedMap ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Polling and updating Async Tasks: {0} tasks, {1} tasks to poll now" , _tasks.size ( ) , NumberOfTasksToPoll ( ) ) ; } java.util.Set < org.ovirt.engine.core.compat.Guid > poolsOfActiveTasks = getPoolIdsTasks ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > > poolsAllTasksMap = getSPMsTasksStatuses ( poolsOfActiveTasks ) ; updateTaskStatuses ( poolsAllTasksMap ) ; }

Target:
private void pollAndUpdateAsyncTasks ( ) { if ( logChangedMap ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Polling and updating Async Tasks: {0} tasks, {1} tasks to poll now" , _tasks.size ( ) , numberOfTasksToPoll ( ) ) ; } java.util.Set < org.ovirt.engine.core.compat.Guid > poolsOfActiveTasks = getPoolIdsTasks ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > > poolsAllTasksMap = getSPMsTasksStatuses ( poolsOfActiveTasks ) ; updateTaskStatuses ( poolsAllTasksMap ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil ) ; return validator.validate ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkAttachmentDao , networkDao , vdsDao ) ; return validator.validate ( ) ; }
Source:
protected boolean canDoAction ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.VmLogonCommand.getVm ( ) ; if ( vm == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.VmLogonCommand.getVm ( ) ; if ( vm == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST ) ; return false ; } if ( ! ( org.ovirt.engine.core.bll.VmLogonCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } return true ; }
Source:
private static boolean isBelowSpaceThreshold ( final org.ovirt.engine.core.common.businessentities.storage_domains domain ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamic = domain.getStorageDynamicData ( ) ; return ( ( dynamic != null ) && ( ( dynamic.getfreeDiskInGB ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceCriticalLowInGB ) ) ) ) && ( ( dynamic.getfreeDiskPercent ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceLow ) ) ) ; }

Target:
private static boolean isEnoughFreeSpace ( final org.ovirt.engine.core.common.businessentities.storage_domains domain ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamic = domain.getStorageDynamicData ( ) ; return ( ( dynamic != null ) && ( ( dynamic.getfreeDiskInGB ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceCriticalLowInGB ) ) ) ) && ( ( dynamic.getfreeDiskPercent ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceLow ) ) ) ; }
Source:
protected java.util.List < java.lang.Class < ? > > getValidationGroups ( ) { if ( ( org.ovirt.engine.core.bll.VmManagementCommandBase.getParameters ( ) . getVmStaticData ( ) . getvm_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) { org.ovirt.engine.core.bll.VmManagementCommandBase.addValidationGroup ( org.ovirt.engine.core.common.validation.group.DesktopVM.class ) ; } return super . getValidationGroups ( ) ; }

Target:
protected java.util.List < java.lang.Class < ? > > getValidationGroups ( ) { if ( ( org.ovirt.engine.core.bll.VmManagementCommandBase.getParameters ( ) . getVmStaticData ( ) . getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) { org.ovirt.engine.core.bll.VmManagementCommandBase.addValidationGroup ( org.ovirt.engine.core.common.validation.group.DesktopVM.class ) ; } return super . getValidationGroups ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > getAllAsyncTasksFromDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > asyncTasks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask : asyncTasks ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTasks ; }

Target:
public void removeAllCommandsInHierarchy ( final org.ovirt.engine.core.compat.Guid commandId ) { for ( org.ovirt.engine.core.compat.Guid childCmdId : getChildCommandIds ( commandId ) ) { removeAllCommandsInHierarchy ( childCmdId ) ; } removeCommand ( commandId ) ; }
Source:
protected void executeQueryCommand ( ) { boolean filterInternalDomain = false ; if ( ( org.ovirt.engine.core.bll.GetDomainListQuery.getParameters ( ) ) instanceof org.ovirt.engine.core.common.queries.GetDomainListParameters ) { filterInternalDomain = ( ( org.ovirt.engine.core.common.queries.GetDomainListParameters ) ( org.ovirt.engine.core.bll.GetDomainListQuery.getParameters ( ) ) ) . getFilterInternalDomain ( ) ; } java.util.List < java.lang.String > domains = org.ovirt.engine.core.bll.adbroker.LdapBrokerUtils.getDomainsList ( filterInternalDomain ) ; java.util.Collections.sort ( domains ) ; org.ovirt.engine.core.bll.GetDomainListQuery.getQueryReturnValue ( ) . setReturnValue ( domains ) ; }

Target:
protected void executeQueryCommand ( ) { boolean filterInternalDomain = false ; if ( ( org.ovirt.engine.core.bll.GetDomainListQuery.getParameters ( ) ) instanceof org.ovirt.engine.core.common.queries.GetDomainListParameters ) { filterInternalDomain = ( ( org.ovirt.engine.core.common.queries.GetDomainListParameters ) ( org.ovirt.engine.core.bll.GetDomainListQuery.getParameters ( ) ) ) . getFilterInternalDomain ( ) ; } java.util.List < java.lang.String > domains = org.ovirt.engine.core.bll.adbroker.LdapBrokerUtils.getDomainsList ( filterInternalDomain ) ; java.lang.String internalDomainName = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.AdminDomain ) ; java.util.Collections.sort ( domains , new org.ovirt.engine.core.bll.LoginDomainComparator ( internalDomainName ) ) ; org.ovirt.engine.core.bll.GetDomainListQuery.getQueryReturnValue ( ) . setReturnValue ( domains ) ; }
Source:
public java.util.List < org.ovirt.engine.api.model.ReportedDevice > getDevices ( org.ovirt.engine.core.compat.Guid vmId , java.lang.String mac ) { java.util.List < org.ovirt.engine.api.model.ReportedDevice > devices = new java.util.ArrayList < org.ovirt.engine.api.model.ReportedDevice > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface iface : getDevicesCollection ( vmId ) ) { if ( org.apache.commons.lang.StringUtils.equals ( iface.getMacAddress ( ) , mac ) ) { devices.add ( org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , org.ovirt.engine.api.restapi.types.ReportedDeviceMapper.map ( iface , new org.ovirt.engine.api.model.ReportedDevice ( ) ) ) ) ; } } return devices ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Nic nic ) { validateEnums ( org.ovirt.engine.api.model.Nic.class , nic ) ; validateParameters ( nic , "name" ) ; return performCreate ( VdcActionType.AddVmInterface , new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( vmId , map ( nic ) ) , new org.ovirt.engine.api.restapi.resource.NicResolver ( nic.getName ( ) ) ) ; }
Source:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setClusterCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; }

Target:
protected org.ovirt.engine.core.common.action.VmDiskOperationParameterBase createParameters ( ) { return new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( diskVmElement ) ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static 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 , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc glusterSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( vdsServer.glusterSnapshotCreate ( volumeName , snapshotName , description , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotplugMemory ( java.util.Map info ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.hotplugMemory ( info ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
static < 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 ( java.lang.String 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 = org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.createIncoherentIdentificationErrorReplacements ( violatingEntityId , referringId , referringName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.isNameAndIdIncoherent ( referringId , referringName , map ) ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateAttachmentNotReferenceVlanDevice ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = existingInterfacesMap.get ( attachment.getNicName ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ATTACHMENT_REFERENCE_VLAN_DEVICE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "ATTACHMENT_REFERENCE_VLAN_DEVICE_ENTITY" , attachment.getNetworkName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "nicName" , attachment.getNicName ( ) ) ) . when ( ( ( nic != null ) && ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( nic ) ) ) ) ; }
Source:
private static org.ovirt.engine.core.bll.utils.VideoDeviceSettings.VideoRAMSettings selectVideoRAMSettings ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { org.ovirt.engine.core.compat.Version vmVersion = vmBase.getCustomCompatibilityVersion ( ) ; java.util.function.Supplier < org.ovirt.engine.core.compat.Version > clusterVersionSupplier = ( ) -> org.ovirt.engine.core.bll.utils.ClusterUtils.getCompatibilityVersion ( vmBase ) ; if ( org.ovirt.engine.core.common.utils.CompatibilityVersionUtils.getEffective ( vmVersion , clusterVersionSupplier ) . greaterOrEquals ( new org.ovirt.engine.core.compat.Version ( 3 , 6 ) ) ) { return new org.ovirt.engine.core.bll.utils.VideoDeviceSettings.VgamemVideoRAMSettings ( ) ; } else { return new org.ovirt.engine.core.bll.utils.VideoDeviceSettings.LegacyVideoRAMSettings ( ) ; } }

Target:
private static org.ovirt.engine.core.bll.utils.VideoDeviceSettings.VideoRAMSettings selectVideoRAMSettings ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { org.ovirt.engine.core.compat.Version vmVersion = vmBase.getCustomCompatibilityVersion ( ) ; java.util.function.Supplier < org.ovirt.engine.core.compat.Version > clusterVersionSupplier = ( ) -> org.ovirt.engine.core.bll.utils.ClusterUtils.getCompatibilityVersion ( vmBase ) ; if ( org.ovirt.engine.core.common.utils.CompatibilityVersionUtils.getEffective ( vmVersion , clusterVersionSupplier ) . greaterOrEquals ( Version.v3_6 ) ) { return new org.ovirt.engine.core.bll.utils.VideoDeviceSettings.VgamemVideoRAMSettings ( ) ; } else { return new org.ovirt.engine.core.bll.utils.VideoDeviceSettings.LegacyVideoRAMSettings ( ) ; } }
Source:
public void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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 java.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.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.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.nameProvider ( ) ) ; typeEditor.setLabel ( constants.typeProvider ( ) ) ; descriptionEditor.setLabel ( constants.descriptionProvider ( ) ) ; urlEditor.setLabel ( constants.urlProvider ( ) ) ; requiresAuthenticationEditor.setLabel ( constants.requiresAuthenticationProvider ( ) ) ; usernameEditor.setLabel ( constants.usernameProvider ( ) ) ; passwordEditor.setLabel ( constants.passwordProvider ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.nameProvider ( ) ) ; typeEditor.setLabel ( constants.typeProvider ( ) ) ; descriptionEditor.setLabel ( constants.descriptionProvider ( ) ) ; urlEditor.setLabel ( constants.urlProvider ( ) ) ; testButton.setLabel ( constants.testProvider ( ) ) ; requiresAuthenticationEditor.setLabel ( constants.requiresAuthenticationProvider ( ) ) ; usernameEditor.setLabel ( constants.usernameProvider ( ) ) ; passwordEditor.setLabel ( constants.passwordProvider ( ) ) ; }
Source:
public void glusterServiceNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.GLUSTER_NOT_SUPPORTED , "compatibilityVersion" , null ) ) ; }

Target:
public void glusterServiceNotRequired ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( false ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( ! ( super . canDoAction ( ) ) ) || ( ! ( org.ovirt.engine.core.bll.storage.UpdateStorageDomainCommand.checkStorageDomain ( ) ) ) ) { return false ; } oldDomain = org.ovirt.engine.core.bll.storage.UpdateStorageDomainCommand.getStorageDomainStaticDAO ( ) . get ( org.ovirt.engine.core.bll.storage.UpdateStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.storage.UpdateStorageDomainCommand.getStorageDomain ( ) . setLastTimeUsedAsMaster ( oldDomain.getLastTimeUsedAsMaster ( ) ) ; return validateStoragePropertiesUpdate ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( ! ( super . canDoAction ( ) ) ) || ( ! ( org.ovirt.engine.core.bll.storage.UpdateStorageDomainCommand.checkStorageDomain ( ) ) ) ) { return false ; } oldDomain = org.ovirt.engine.core.bll.storage.UpdateStorageDomainCommand.getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.bll.storage.UpdateStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.storage.UpdateStorageDomainCommand.getStorageDomain ( ) . setLastTimeUsedAsMaster ( oldDomain.getLastTimeUsedAsMaster ( ) ) ; return validateStoragePropertiesUpdate ( ) ; }
Source:
public java.util.List < java.lang.String > findViolatedNics ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypesMap ) { java.util.List < java.lang.String > violatedNics = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypes : nicNameToNetworkTypesMap.entrySet ( ) ) { java.lang.String nicName = nicNameToNetworkTypes.getKey ( ) ; java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > networkTypes = nicNameToNetworkTypes.getValue ( ) ; if ( ! ( validateNetworkTypesOnNic ( networkTypes ) ) ) { violatedNics.add ( nicName ) ; } } return violatedNics ; }

Target:
private java.util.List < java.lang.String > findViolatedNics ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.network.NetworkType > > nicNameToNetworkTypesMap ) { java.util.List < java.lang.String > violatedNics = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.network.NetworkType > > nicNameToNetworkTypes : nicNameToNetworkTypesMap.entrySet ( ) ) { java.lang.String nicName = nicNameToNetworkTypes.getKey ( ) ; java.util.List < org.ovirt.engine.core.bll.validator.network.NetworkType > networkTypes = nicNameToNetworkTypes.getValue ( ) ; if ( ! ( networkExclusivenessValidator.isNetworkExclusive ( networkTypes ) ) ) { violatedNics.add ( nicName ) ; } } return violatedNics ; }
Source:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionSubjects = new java.util.ArrayList < > ( ) ; permissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; return permissionSubjects ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionSubjects = new java.util.ArrayList < > ( ) ; permissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; permissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getParameters ( ) . getSourceStorageDomainId ( ) , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.ACCESS_IMAGE_STORAGE ) ) ; return permissionSubjects ; }
Source:
public boolean validate ( org.ovirt.engine.core.config.entity.ConfigKey key , java.lang.String value ) { return value == null ? false : ! ( value.isEmpty ( ) ) ; }

Target:
public boolean validate ( org.ovirt.engine.core.config.entity.ConfigKey key , java.lang.String value ) { if ( ( org.apache.commons.lang.StringUtils.isNotBlank ( value ) ) && ( value.equals ( org.ovirt.engine.core.config.entity.helper.PasswordValueHelper.INTERACTIVE_MODE ) ) ) { return true ; } if ( ( parser.getAdminPassFile ( ) ) != null ) { return true ; } return false ; }