auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public static java.lang.String getPath ( java.lang.String helpTag ) { java.lang.String path = null ; if ( ( helpTag != null ) && ( ( org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager.documentationPathMap ) != null ) ) { path = org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager.documentationPathMap.get ( helpTag ) ; } return path ; }

Target:
public static java.lang.String getPath ( java.lang.String helpTag ) { if ( ( ( org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager.cshMappings ) == null ) || ( org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager.cshMappings.isEmpty ( ) ) ) { return null ; } if ( helpTag != null ) { return org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager.cshMappings.get ( helpTag ) ; } return null ; }
Source:
private static void endJob ( boolean exitStatus , org.ovirt.engine.core.common.job.Job job ) { job.markJobEnded ( exitStatus ) ; try { org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateCompletedJobAndSteps ( job ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.errorFormat ( "Failed to end Job {0}, {1}" , job.getId ( ) , job.getActionType ( ) . name ( ) , e ) ; } }

Target:
private static void endJob ( boolean exitStatus , org.ovirt.engine.core.common.job.Job job ) { job.markJobEnded ( exitStatus ) ; try { org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateCompletedJobAndSteps ( job ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.error ( "Failed to end Job '{}', '{}': {}" , job.getId ( ) , job.getActionType ( ) . name ( ) , e.getMessage ( ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.log.debug ( "Exception" , e ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getResetCommand ( ) ) ) { Reset ( ) ; } else if ( command == ( getExpandAllCommand ( ) ) ) { ExpandAll ( ) ; } else if ( command == ( getCollapseAllCommand ( ) ) ) { CollapseAll ( ) ; } }

Target:
private void expandAll ( ) { setIsExpandedRecursively ( true , getItems ( ) . get ( 0 ) ) ; }
Source:
public boolean getLegal ( ) { boolean returnValue = true ; if ( getUseTimout ( ) ) { synchronized ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBase.mLock ) { java.lang.String keyForCheck = getkeyForCheck ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBase timeoutBase = org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBase.mHandler.get ( keyForCheck ) ; if ( timeoutBase != null ) { if ( ( java.lang.System.currentTimeMillis ( ) ) < ( timeoutBase.getEndTime ( ) ) ) { returnValue = false ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBase.mHandler.remove ( keyForCheck ) ; } } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBase.mHandler.put ( keyForCheck , this ) ; } } } return returnValue ; }

Target:
public boolean getLegal ( ) { if ( getUseTimout ( ) ) { java.lang.String keyForCheck = getkeyForCheck ( ) ; if ( ( org.ovirt.engine.core.utils.cache.CacheManager.getTimeoutBaseCache ( ) . putIfAbsent ( keyForCheck , keyForCheck , getEndTime ( ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ) == null ) { return true ; } return false ; } return true ; }
Source:
public boolean isSysprepUsed ( ) { return ( ( ( getInitializationType ( ) ) == ( InitializationType.Sysprep ) ) && ( org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . isWindows ( getVmOsId ( ) ) ) ) && ( ( ( getFloppyPath ( ) ) == null ) || ( "" . equals ( getFloppyPath ( ) ) ) ) ; }

Target:
public boolean isSysprepUsed ( ) { return ( ( ( getInitializationType ( ) ) == ( InitializationType.Sysprep ) ) && ( org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . isWindows ( getVmOsId ( ) ) ) ) && ( ( ( getFloppyPath ( ) ) == null ) || ( "" . equals ( getFloppyPath ( ) ) ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( getDisk ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } org.ovirt.engine.core.bll.validator.storage.DiskValidator oldDiskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( getDisk ( ) ) ; return ( ( validate ( oldDiskValidator.validateNotHostedEngineDisk ( ) ) ) && ( validateAllVmsForDiskAreDown ( ) ) ) && ( canRemoveDiskBasedOnStorageTypeCheck ( ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( getDisk ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } return ( ( validateHostedEngineDisks ( ) ) && ( validateAllVmsForDiskAreDown ( ) ) ) && ( canRemoveDiskBasedOnStorageTypeCheck ( ) ) ; }
Source:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void doTestExport ( org.ovirt.engine.api.model.StorageDomain storageDomain , boolean exclusive ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ExportVmTemplate , org.ovirt.engine.core.common.action.MoveVmParameters.class , new java.lang.String [ ] { "ContainerId" , "StorageDomainId" , "ForceOverride" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 2 ] , exclusive } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setStorageDomain ( storageDomain ) ; if ( exclusive ) { action.setExclusive ( exclusive ) ; } verifyActionResponse ( resource.export ( action ) ) ; }

Target:
protected void doTestExport ( org.ovirt.engine.api.model.StorageDomain storageDomain , boolean exclusive ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ExportVmTemplate , org.ovirt.engine.core.common.action.MoveOrCopyParameters.class , new java.lang.String [ ] { "ContainerId" , "StorageDomainId" , "ForceOverride" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 2 ] , exclusive } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setStorageDomain ( storageDomain ) ; if ( exclusive ) { action.setExclusive ( exclusive ) ; } verifyActionResponse ( resource.export ( action ) ) ; }
Source:
public void validateStorageTypeOfStorageDomainsToSyncSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain blockDomain1 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; blockDomain1.setStorageType ( StorageType.ISCSI ) ; org.ovirt.engine.core.common.businessentities.StorageDomain blockDomain2 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; blockDomain2.setStorageType ( StorageType.FCP ) ; org.mockito.Mockito.doReturn ( java.util.stream.Stream.of ( blockDomain1 , blockDomain2 ) ) . when ( command ) . getStorageDomainsToSync ( ) ; org.junit.Assert.assertTrue ( command.validateStorageTypeOfStorageDomainsToSync ( ) ) ; }

Target:
public void validateStorageTypeOfStorageDomainsToSyncSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain blockDomain1 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; blockDomain1.setStorageType ( StorageType.ISCSI ) ; org.ovirt.engine.core.common.businessentities.StorageDomain blockDomain2 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; blockDomain2.setStorageType ( StorageType.FCP ) ; org.mockito.Mockito.doReturn ( java.util.stream.Stream.of ( blockDomain1 , blockDomain2 ) ) . when ( command ) . getStorageDomainsToSync ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.validateStorageTypeOfStorageDomainsToSync ( ) ) ; }
Source:
public org.ovirt.engine.sdk.entities.Action exportTemplate ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/export" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Template update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; if ( correlationId != null ) { headersBuilder.add ( "Correlation-Id" , correlationId ) ; } java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Template.class , org.ovirt.engine.sdk.decorators.Template.class , headers ) ; }
Source:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }

Target:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void qosCommitmentMissingBondSpeedMode3 ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmendMissingBondSpeed ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_MODE_3 ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_OVERCOMMITMENT , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { mVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.getBroker ( ) . getAllVmStats ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > returnVMs = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > ( ) ; for ( int idx = 0 ; idx < ( mVmListReturn.mInfoList.length ) ; ++ idx ) { org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vmInternalData = createVmInternalData ( mVmListReturn.mInfoList [ idx ] ) ; returnVMs.put ( vmInternalData.getVmDynamic ( ) . getId ( ) , vmInternalData ) ; } setReturnValue ( returnVMs ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { mVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.getBroker ( ) . getAllVmStats ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > returnVMs = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > ( ) ; for ( int idx = 0 ; idx < ( mVmListReturn.mInfoList.length ) ; ++ idx ) { org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vmInternalData = createVmInternalData ( mVmListReturn.mInfoList [ idx ] ) ; returnVMs.put ( vmInternalData.getVmDynamic ( ) . getId ( ) , vmInternalData ) ; } setReturnValue ( returnVMs ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Cluster setUpClusterExpectations ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( group.getId ( ) ) . thenReturn ( id ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { id } , group ) ; return group ; }

Target:
private org.ovirt.engine.core.common.businessentities.Cluster getCluster ( int index ) { org.ovirt.engine.api.restapi.resource.Cluster entity = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; return entity ; }
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , 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 void testNullClusterId ( ) { org.ovirt.engine.core.common.businessentities.VmBase vmBase = createVmBase ( cpuProfile1.getId ( ) ) ; vmBase.setClusterId ( null ) ; org.ovirt.engine.core.bll.ValidationResult res = cpuProfileHelper.setAndValidateCpuProfile ( vmBase , org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.USER_1_ID ) ; org.junit.Assert.assertThat ( res , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_CPU_PROFILE_CLUSTER_NOT_PROVIDED ) ) ; }

Target:
public void testNullClusterId ( ) { org.ovirt.engine.core.common.businessentities.VmBase vmBase = createVmBase ( cpuProfile1.getId ( ) ) ; vmBase.setClusterId ( null ) ; org.ovirt.engine.core.bll.ValidationResult res = cpuProfileHelper.setAndValidateCpuProfile ( vmBase , org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.USER_1_ID ) ; org.hamcrest.MatcherAssert.assertThat ( res , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_CPU_PROFILE_CLUSTER_NOT_PROVIDED ) ) ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }

Target:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { if ( ( getDiskStorageType ( ) . getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { boolean countThreadsAsCores = cluster.getCountThreadsAsCores ( ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { scores.add ( new org.ovirt.engine.core.common.utils.Pair ( vds.getId ( ) , calcEvenDistributionScore ( vds , vm , countThreadsAsCores ) ) ) ; } return scores ; }

Target:
protected float getMaxMemoryOfVdsInCluster ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { return hosts.stream ( ) . map ( VDS :: getFreeVirtualMemory ) . max ( java.lang.Float :: compareTo ) . get ( ) ; }
Source:
public void multiQueryWithOddParams ( ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryType > queryTypeList = new java.util.ArrayList ( java.util.Arrays.asList ( QueryType.Search ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryParamsList = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) ; underTest.runMultipleQueries ( queryTypeList , queryParamsList ) ; org.mockito.Mockito.verifyZeroInteractions ( backendLocal ) ; }

Target:
public void multiQueryWithOddParams ( ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryType > queryTypeList = new java.util.ArrayList ( java.util.Arrays.asList ( QueryType.Search ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryParametersBase > queryParamsList = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) , new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) ) ) ; underTest.runMultipleQueries ( queryTypeList , queryParamsList ) ; org.mockito.Mockito.verifyZeroInteractions ( backendLocal ) ; }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateDiskProfile , org.ovirt.engine.core.common.action.DiskProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendDiskProfileResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateDiskProfile , org.ovirt.engine.core.common.action.DiskProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendDiskProfileResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void setHostVmListModel ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostVmListModel hostVmListModel ) { this . hostVmListModel = hostVmListModel ; }

Target:
private void updateVNodesMap ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmNumaNode > map ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNumaNode > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmNumaNode node : vm.getvNumaNodeList ( ) ) { list.add ( node ) ; } for ( org.ovirt.engine.core.common.businessentities.VmNumaNode node : list ) { map.put ( node.getId ( ) , node ) ; } }
Source:
private void processIncomingObject ( org.ovirt.vdsm.jsonrpc.client.JsonRpcClient client , org.codehaus.jackson.JsonNode node ) { final org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse response ; try { response = org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse.fromJsonNode ( node ) ; } catch ( java.lang.IllegalArgumentException e ) { org.ovirt.vdsm.jsonrpc.client.internal.ResponseWorker.log.error ( "Recieved response is not correct" , e ) ; return ; } client.processResponse ( response ) ; }

Target:
private void processIncomingObject ( org.ovirt.vdsm.jsonrpc.client.JsonRpcClient client , org.codehaus.jackson.JsonNode node ) { final org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse response ; try { response = org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse.fromJsonNode ( node ) ; } catch ( java.lang.IllegalArgumentException e ) { org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.logException ( org.ovirt.vdsm.jsonrpc.client.internal.ResponseWorker.log , "Recieved response is not correct" , e ) ; return ; } client.processResponse ( response ) ; }
Source:
public void setCommandExecuted ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = org.ovirt.engine.core.bll.tasks.TaskManagerUtil.getCommandEntity ( getCommandId ( ) ) ; if ( cmdEntity != null ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( buildCommandEntity ( cmdEntity.getRootCommandId ( ) , cmdEntity.isCallBackEnabled ( ) ) , getContext ( ) ) ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandExecuted ( getCommandId ( ) ) ; } } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }

Target:
public void setCommandExecuted ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( getCommandId ( ) ) ; if ( cmdEntity != null ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.persistCommand ( buildCommandEntity ( cmdEntity.getRootCommandId ( ) , cmdEntity.isCallBackEnabled ( ) ) , getContext ( ) ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.updateCommandExecuted ( getCommandId ( ) ) ; } } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
public static boolean isOsTypeSupportedForVirtioScsi ( int osId , org.ovirt.engine.core.compat.Version clusterVersion , java.util.List < java.lang.String > reasons ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( osId , clusterVersion , DiskInterface.VirtIO_SCSI ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI.name ( ) ) ; } return result ; }

Target:
public static boolean isGraphicsAndDisplaySupported ( int osId , java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphics , org.ovirt.engine.core.common.businessentities.DisplayType displayType , java.util.List < java.lang.String > reasons , org.ovirt.engine.core.compat.Version clusterVersion ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isGraphicsAndDisplaySupported ( osId , clusterVersion , graphics , displayType ) ; if ( ! result ) { reasons.add ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS.name ( ) ) ; } return result ; }
Source:
public void canDoActionFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void canDoActionFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }
Source:
private static org.ovirt.engine.core.common.job.Job getJob ( org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.action.VdcActionParametersBase params = command.getParameters ( ) ; org.ovirt.engine.core.common.job.Job job ; if ( ( params.getJobId ( ) ) != null ) { job = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getJobDao ( ) . get ( params.getJobId ( ) ) ; } else { job = org.ovirt.engine.core.bll.job.ExecutionHandler.createJob ( actionType , command ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . saveJob ( job ) ; } return job ; }

Target:
private org.ovirt.engine.core.common.job.Job getJob ( org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.action.VdcActionParametersBase params = command.getParameters ( ) ; org.ovirt.engine.core.common.job.Job job ; if ( ( params.getJobId ( ) ) != null ) { job = jobDao.get ( params.getJobId ( ) ) ; } else { job = org.ovirt.engine.core.bll.job.ExecutionHandler.createJob ( actionType , command ) ; jobRepository.saveJob ( job ) ; } return job ; }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.tags tag ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "description" , tag.getdescription ( ) ) . addValue ( "tag_id" , tag.gettag_id ( ) ) . addValue ( "tag_name" , tag.gettag_name ( ) ) . addValue ( "parent_id" , tag.getparent_id ( ) ) . addValue ( "readonly" , tag.getIsReadonly ( ) ) . addValue ( "type" , tag.gettype ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatetags" , parameterSource ) ; }

Target:
public void update ( org.ovirt.engine.core.common.businessentities.Tags tag ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "description" , tag.getdescription ( ) ) . addValue ( "tag_id" , tag.gettag_id ( ) ) . addValue ( "tag_name" , tag.gettag_name ( ) ) . addValue ( "parent_id" , tag.getparent_id ( ) ) . addValue ( "readonly" , tag.getIsReadonly ( ) ) . addValue ( "type" , tag.gettype ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatetags" , parameterSource ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageServerConnectionLunMapDao ( ) ; storageServerConnectionDao = dbFacade.getStorageServerConnectionDao ( ) ; existingConnection = storageServerConnectionDao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ; newServerConnection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newServerConnection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAOTest.EXISTING_DOMAIN_STORAGE_NAME ) ; existingLUNStorageMap = dao.get ( new org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map_id ( "1IET_00180001" , existingConnection.getid ( ) ) ) ; newLUNStorageMap = new org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAOTest.FREE_LUN_ID , existingConnection.getid ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageServerConnectionLunMapDao ( ) ; storageServerConnectionDao = dbFacade.getStorageServerConnectionDao ( ) ; existingConnection = storageServerConnectionDao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; newServerConnection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newServerConnection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAOTest.EXISTING_DOMAIN_STORAGE_NAME ) ; existingLUNStorageMap = dao.get ( new org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map_id ( "1IET_00180001" , existingConnection.getid ( ) ) ) ; newLUNStorageMap = new org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAOTest.FREE_LUN_ID , existingConnection.getid ( ) ) ; }
Source:
protected void initUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUser ( ) ; if ( ( user != null ) && ( ( user.getId ( ) ) == null ) ) { user.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUserDao ( ) . save ( user ) ; } }

Target:
protected void initPoolUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUser ( ) ; if ( ( user != null ) && ( ( user.getId ( ) ) == null ) ) { user.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUserDao ( ) . save ( user ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { New ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { Edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { newEntity ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }
Source:
private void updateOptionsPostData ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > disks ) { org.ovirt.engine.ui.uicommonweb.UICommand addDiskAction = new org.ovirt.engine.ui.uicommonweb.UICommand ( "AddDisk" , this ) ; if ( disks.isEmpty ( ) ) { addDiskAction.setTitle ( VmConfigureVirtualDisksAction ) ; getCompulsoryActions ( ) . add ( addDiskAction ) ; } else { addDiskAction.setTitle ( VmAddAnotherVirtualDiskAction ) ; getOptionalActions ( ) . add ( addDiskAction ) ; } stopProgress ( ) ; }

Target:
public void updateOptions ( boolean containsDisks ) { getCompulsoryActions ( ) . clear ( ) ; getOptionalActions ( ) . clear ( ) ; startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.UICommand addDiskAction = new org.ovirt.engine.ui.uicommonweb.UICommand ( "AddDisk" , this ) ; if ( ! containsDisks ) { addDiskAction.setTitle ( VmConfigureVirtualDisksAction ) ; getCompulsoryActions ( ) . add ( addDiskAction ) ; } else { addDiskAction.setTitle ( VmAddAnotherVirtualDiskAction ) ; getOptionalActions ( ) . add ( addDiskAction ) ; } stopProgress ( ) ; }
Source:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getGuestLastLoginTime ( ) ) != null ) && ( ( ( getGuestLastLogoutTime ( ) ) == null ) || ( ( getGuestLastLoginTime ( ) . compareTo ( getGuestLastLogoutTime ( ) ) ) > 0 ) ) ) { setGuestLastLogoutTime ( new java.util.Date ( ) ) ; } }

Target:
public void setGraphicsInfos ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos ) { vmDynamic.setGraphicsInfos ( graphicsInfos ) ; }
Source:
public static void GetDiskList ( 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.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private static void injectCopyrightHeader ( java.io.File file ) throws java.io.IOException { java.util.List < java.lang.String > lines = new java.util.ArrayList < > ( org.ovirt.engine.sdk.codegen.xsd.XsdCodegen.copyrightLines ) ; lines.addAll ( org.apache.commons.io.FileUtils.readLines ( file ) ) ; lines = org.ovirt.engine.sdk.codegen.utils.StringUtils.removeTrailingWhitespace ( lines ) ; org.apache.commons.io.FileUtils.writeLines ( file , lines ) ; }

Target:
private static void injectCopyrightHeader ( java.io.File file ) throws java.io.IOException { java.util.List < java.lang.String > lines = new java.util.ArrayList < > ( org.ovirt.engine.sdk.codegen.xsd.XsdCodegen.COPYRIGHT_LINES ) ; lines.addAll ( org.apache.commons.io.FileUtils.readLines ( file ) ) ; lines = org.ovirt.engine.sdk.codegen.utils.StringUtils.removeTrailingWhitespace ( lines ) ; org.apache.commons.io.FileUtils.writeLines ( file , lines ) ; }
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 : getDisksList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , disk.getActualSize ( ) ) ) ; } return list ; }

Target:
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 < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : getDisksList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , disk.getActualSize ( ) ) ) ; } return list ; }
Source:
public void getFreeVfOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 1 , 4 , 3 , 2 , 1 ) ; org.junit.Assert.assertEquals ( 1 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic , null ) ) ) ; }

Target:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic ) ) ) ; }
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.addBrick" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "brickList" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( bricks ) ) ) . withParameter ( "replicaCount" , replicaCount ) . withParameter ( "stripeCount" , stripeCount ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc isolateVolume ( java.lang.String sdUUID , java.lang.String srcImageID , java.lang.String dstImageID , java.lang.String volumeID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.isolateVolume" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "srcImageID" , srcImageID ) . withParameter ( "dstImageID" , dstImageID ) . withParameter ( "volumeID" , volumeID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertTrue ( result.contains ( existingVds ) ) ; }

Target:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( result.contains ( existingVds ) ) ; }
Source:
private void Reset ( ) { setSelectedItems ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > ( ) ) ; if ( ( getItems ( ) ) != null ) { for ( java.lang.Object item : getItems ( ) ) { ResetInternal ( ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( item ) ) ) ; } } getResetRequestedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
private void reset ( ) { setSelectedItems ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > ( ) ) ; if ( ( getItems ( ) ) != null ) { for ( java.lang.Object item : getItems ( ) ) { resetInternal ( ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( item ) ) ) ; } } getResetRequestedEvent ( ) . raise ( this , EventArgs.Empty ) ; }