auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , commandStatus ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.permissions > getAllForEntity ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsByEntityId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.permissions > getAllForEntity ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered , boolean allUsersWithPermission ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; java.lang.String functionName = "GetPermissionsByEntityId" ; if ( allUsersWithPermission ) { functionName = "GetAllUsersWithPermissionsOnEntityByEntityId" ; } return getCallsHandler ( ) . executeReadList ( functionName , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }
Source:
public void getStorageDomainList ( 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.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getClustersHavingHosts ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void SetupNetworks ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel setupNetworksWindowModel = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel ( this ) ; setupNetworksWindowModel.setEntity ( ( ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > ) ( getSelectedItem ( ) ) ) . getSecond ( ) ) ; setWindow ( setupNetworksWindowModel ) ; }

Target:
public void setupNetworks ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel setupNetworksWindowModel = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel ( this ) ; setupNetworksWindowModel.setEntity ( ( ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > ) ( getSelectedItem ( ) ) ) . getSecond ( ) ) ; setWindow ( setupNetworksWindowModel ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
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 ) ; } }

Target:
public java.lang.String getAdUserName ( ) { if ( ( adUserName ) == null ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUserDao ( ) . get ( getAdUserId ( ) ) ; if ( user != null ) { adUserName = user.getLoginName ( ) ; } } return adUserName ; }
Source:
public void testConflictedUpdate ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.api.model.Template model = getRestModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.api.model.Template model = getRestModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void setUp ( ) { setUpQuota ( ) ; params = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( quota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateQuotaCommand ( params ) ) ; org.mockito.Mockito.doReturn ( quotaDAO ) . when ( command ) . getQuotaDAO ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaFromCache ( ) ; }

Target:
public void setUp ( ) { setUpQuota ( ) ; params = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( quota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateQuotaCommand ( params ) ) ; org.mockito.Mockito.doReturn ( quotaDAO ) . when ( command ) . getQuotaDAO ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaFromCache ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . afterUpdate ( ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.ad_groups mapRow ( final java.sql.ResultSet rs , final int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.ad_groups entity = new org.ovirt.engine.core.common.businessentities.ad_groups ( ) ; entity.setid ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "id" ) ) ) ; entity.setname ( rs.getString ( "name" ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.AdRefStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setdomain ( rs.getString ( "domain" ) ) ; entity.setDistinguishedName ( rs.getString ( "distinguishedname" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.LdapGroup mapRow ( final java.sql.ResultSet rs , final int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.LdapGroup entity = new org.ovirt.engine.core.common.businessentities.LdapGroup ( ) ; entity.setid ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "id" ) ) ) ; entity.setname ( rs.getString ( "name" ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.AdRefStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setdomain ( rs.getString ( "domain" ) ) ; entity.setDistinguishedName ( rs.getString ( "distinguishedname" ) ) ; return entity ; }
Source:
public void clusterWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }

Target:
public void clusterWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.Disk getDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.compat.Guid id ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( disk.getId ( ) . equals ( id ) ) { return disk ; } } return null ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskVmElement getDiskVmElement ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.compat.Guid diskId ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( disk.getId ( ) . equals ( diskId ) ) { return disk.getDiskVmElementForVm ( vm.getId ( ) ) ; } } return null ; }
Source:
public org.ovirt.engine.core.common.businessentities.Quota getQuotaByQuotaName ( java.lang.String quotaName ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "quota_name" , quotaName ) ; org.ovirt.engine.core.common.businessentities.Quota quotaEntity = getCallsHandler ( ) . executeRead ( "GetQuotaByQuotaName" , getQuotaFromResultSet ( ) , quotaParameterSource ) ; return quotaEntity ; }

Target:
public org.ovirt.engine.core.common.businessentities.Quota getQuotaByQuotaName ( java.lang.String quotaName , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "quota_name" , quotaName ) ; quotaParameterSource.addValue ( "storage_pool_id" , storagePoolId ) ; org.ovirt.engine.core.common.businessentities.Quota quotaEntity = getCallsHandler ( ) . executeRead ( "GetQuotaByQuotaName" , getQuotaFromResultSet ( ) , quotaParameterSource ) ; return quotaEntity ; }
Source:
public int getAvailableMacsCount ( ) { org.ovirt.engine.core.bll.network.MacPoolManager.log.infoFormat ( "MacPoolManager::getAvailableMacsCount - entered" ) ; lockObj.readLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to get available Macs count." ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } int availableMacsSize = availableMacs.size ( ) ; org.ovirt.engine.core.bll.network.MacPoolManager.log.infoFormat ( "MacPoolManager:: AvailableMacsCount = {0}" , availableMacsSize ) ; return availableMacsSize ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }

Target:
public int getAvailableMacsCount ( ) { lockObj.readLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to get available Macs count." ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } int availableMacsSize = availableMacs.size ( ) ; org.ovirt.engine.core.bll.network.MacPoolManager.log.debugFormat ( "Number of available Mac addresses = {0}" , availableMacsSize ) ; return availableMacsSize ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel userPortalListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.storage_pool [ ] { ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( result ) ) } ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel unitModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( userPortalListModel.getWindow ( ) ) ) ; unitModel.getDataCenter ( ) . setItems ( list ) ; unitModel.getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( list ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel userPortalListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StoragePool [ ] { ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( result ) ) } ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel unitModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( userPortalListModel.getWindow ( ) ) ) ; unitModel.getDataCenter ( ) . setItems ( list ) ; unitModel.getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( list ) ) ; }
Source:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { if ( ! ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . isRemoveDuringExecution ( ) ) ) { removeImageFromDB ( true ) ; } } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.unLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }

Target:
public java.lang.Void runInTransaction ( ) { getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( getParameters ( ) . getImageId ( ) , getParameters ( ) . getStorageDomainId ( ) ) ) ; unLockImage ( ) ; return null ; }
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public void testInvalidNumberOfMonitors ( ) { prepareVmToPassCanDoAction ( ) ; vmStatic.setNumOfMonitors ( 99 ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid number of monitors." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_NUM_OF_MONITORS ) ; }

Target:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassValidate ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.Matchers.any ( java.util.ArrayList.class ) ) ; vmStatic.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "validate should have failed with invalid dedicated host." , command.validate ( ) ) ; }
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 testCanDoActionNonExistingStorageDomain ( ) { org.mockito.Mockito.doReturn ( null ) . when ( storageDomainDaoMock ) . get ( storageDomain.getId ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( storageDomainDaoMock ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( "canDoAction shouldn't be possible for a non-existent storage domain" , command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }

Target:
public void testCanDoActionNonExistingStorageDomain ( ) { org.mockito.Mockito.doReturn ( null ) . when ( storageDomainDaoMock ) . get ( storageDomain.getId ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( storageDomainDaoMock ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( "canDoAction shouldn't be possible for a non-existent storage domain" , command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }
Source:
private void updateDiskVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.bll.AttachDiskToVmCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ; if ( disk.getDiskStorageType ( ) . isSupportsSnapshots ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; org.ovirt.engine.core.bll.AttachDiskToVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , snapshotId ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.StorageException , "update of snapshot id was initiated for unsupported disk type" ) ; } }

Target:
private void updateDiskVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.bll.AttachDiskToVmCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ; if ( disk.getDiskStorageType ( ) . isInternal ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; org.ovirt.engine.core.bll.AttachDiskToVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , snapshotId ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.StorageException , "update of snapshot id was initiated for unsupported disk type" ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.qos.QosBase createQosEntity ( java.sql.ResultSet rs ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.qos.QosType qosType = org.ovirt.engine.core.common.businessentities.qos.QosType.forValue ( rs.getInt ( "qos_type" ) ) ; switch ( qosType ) { case STORAGE : return StorageQosDaoDbFacadeImpl.StorageDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; case CPU : return CpuQosDaoDbFacadeImpl.CpuDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; case NETWORK : return NetworkQoSDaoFacadeImpl.NetworkQosDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; default : org.ovirt.engine.core.dao.qos.AllQosBaseDaoFacadeImpl.log.debugFormat ( "not handled/missing qos_type" , qosType ) ; break ; } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.qos.QosBase createQosEntity ( java.sql.ResultSet rs ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.qos.QosType qosType = org.ovirt.engine.core.common.businessentities.qos.QosType.forValue ( rs.getInt ( "qos_type" ) ) ; switch ( qosType ) { case STORAGE : return StorageQosDaoDbFacadeImpl.StorageDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; case CPU : return CpuQosDaoDbFacadeImpl.CpuDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; case NETWORK : return NetworkQoSDaoFacadeImpl.NetworkQosDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; default : org.ovirt.engine.core.dao.qos.AllQosBaseDaoFacadeImpl.log.debug ( "not handled/missing qos_type '{}'" , qosType ) ; break ; } return null ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpEntityQueryExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.HostNIC nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; hostNicsResource.verifyModelSpecific ( nic , org.ovirt.engine.api.restapi.resource.BackendHostNicResourceTest.NIC_IDX ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpEntityQueryExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.HostNic nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; hostNicsResource.verifyModelSpecific ( nic , org.ovirt.engine.api.restapi.resource.BackendHostNicResourceTest.NIC_IDX ) ; } finally { accepts.clear ( ) ; } }
Source:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel ( ) ) ; setDetailModels ( list ) ; }
Source:
private org.ovirt.engine.api.model.Action mapTargets ( org.ovirt.engine.api.model.Action action , java.util.List < org.ovirt.engine.core.common.businessentities.storage_server_connections > targets ) { if ( targets != null ) { for ( org.ovirt.engine.core.common.businessentities.storage_server_connections cnx : targets ) { action.getIscsiTargets ( ) . add ( map ( cnx ) . getTarget ( ) ) ; } } return action ; }

Target:
private org.ovirt.engine.api.model.Action mapTargets ( org.ovirt.engine.api.model.Action action , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > targets ) { if ( targets != null ) { for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx : targets ) { action.getIscsiTargets ( ) . add ( map ( cnx ) . getTarget ( ) ) ; } } return action ; }
Source:
public org.ovirt.engine.core.common.businessentities.VDS getUpServer ( org.ovirt.engine.core.compat.Guid clusterId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > servers = getVdsDao ( ) . getAllForVdsGroupWithStatus ( clusterId , VDSStatus.Up ) ; if ( ( servers == null ) || ( servers.isEmpty ( ) ) ) { return null ; } return org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( servers ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllUpServers ( org.ovirt.engine.core.compat.Guid clusterId ) { return getVdsDao ( ) . getAllForVdsGroupWithStatus ( clusterId , VDSStatus.Up ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Disk add ( org.ovirt.engine.sdk.decorators.Disk disk ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; return getProxy ( ) . add ( url , disk , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.Disk.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Disk add ( org.ovirt.engine.sdk.decorators.Disk disk ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; 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 ( ) . add ( url , disk , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.Disk.class , headers ) ; }
Source:
public void template_SelectedItemChanged ( ) { getModel ( ) . setIsDisksAvailable ( true ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; updateRngDevice ( template.getId ( ) ) ; getModel ( ) . getCustomPropertySheet ( ) . deserialize ( template.getCustomProperties ( ) ) ; }

Target:
public void activated ( ) { getInstanceTypeManager ( ) . updateAll ( ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { boolean nicActuallyExistsOrReferencesNewBond = isNicActuallyExistsOrReferencesNewBond ( attachment.getNicName ( ) , attachment.getNicId ( ) ) ; if ( nicActuallyExistsOrReferencesNewBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { java.lang.String targetNicName = attachment.getNicName ( ) ; boolean attachmentReferencesExistingNic = ( existingInterfacesMap.get ( attachment.getNicId ( ) , targetNicName ) ) != null ; if ( attachmentReferencesExistingNic ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentReferencesNewlyCreatedBond = ( targetNicName != null ) && ( ( bondsMap.get ( targetNicName ) ) != null ) ; if ( attachmentReferencesNewlyCreatedBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }
Source:
protected org.ovirt.engine.api.model.Nic deprecatedPopulate ( org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; addReportedDevices ( model , entity ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.Nic deprecatedPopulate ( org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; org.ovirt.engine.api.restapi.resource.BackendNicHelper.addReportedDevices ( this , model , entity ) ; if ( details.contains ( "statistics" ) ) { org.ovirt.engine.api.restapi.resource.BackendNicHelper.addStatistics ( this , model , entity ) ; } return model ; }
Source:
public void validateVmMemoryCanRunOnVdsHighMem ( ) { vm.setMinAllocatedMem ( 10000 ) ; vm.setVmMemSizeMb ( 10000 ) ; vds.setPhysicalMemMb ( 15000 ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCanRunOnVdsHighMem ( ) { vm.setMinAllocatedMem ( 10000 ) ; vm.setVmMemSizeMb ( 10000 ) ; vds.setPhysicalMemMb ( 15000 ) ; boolean vmPassedMemoryRequirement = slaValidator.hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getClustersByServiceAndCompatibilityVersion ( boolean glusterService , boolean virtService , java.lang.String compatibilityVersion ) { return getCallsHandler ( ) . executeReadList ( "GetVdsGroupsByServiceAndCompatibilityVersion" , org.ovirt.engine.core.dao.VdsGroupDaoImpl.VdsGroupRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "gluster_service" , glusterService ) . addValue ( "virt_service" , virtService ) . addValue ( "compatibility_version" , compatibilityVersion ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > getClustersByServiceAndCompatibilityVersion ( boolean glusterService , boolean virtService , java.lang.String compatibilityVersion ) { return getCallsHandler ( ) . executeReadList ( "GetClustersByServiceAndCompatibilityVersion" , org.ovirt.engine.core.dao.ClusterDaoImpl.ClusterRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "gluster_service" , glusterService ) . addValue ( "virt_service" , virtService ) . addValue ( "compatibility_version" , compatibilityVersion ) ) ; }
Source:
public void canMigrateMacsToAnotherMacPoolWhenTheresDuplicityAmongMacToBeMigrated ( ) { macsToMigrate.add ( macsToMigrate.get ( 0 ) ) ; org.mockito.Mockito.when ( vmNicDao.getAllMacsByClusterId ( cluster.getId ( ) ) ) . thenReturn ( macsToMigrate ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_CANNOT_MIGRATE_MACS_DUE_TO_DUPLICATES ; java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.getListVariableAssignmentString ( engineMessage , java.util.Collections.singleton ( macsToMigrate.get ( 0 ) ) ) ; org.junit.Assert.assertThat ( underTest.canMigrateMacsToAnotherMacPool ( cluster , targetMacPoolId ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , replacements ) ) ; }

Target:
public void canMigrateMacsToAnotherMacPoolWhenTheresDuplicityAmongMacToBeMigrated ( ) { macsToMigrate.add ( macsToMigrate.get ( 0 ) ) ; org.mockito.Mockito.when ( vmNicDao.getAllMacsByClusterId ( cluster.getId ( ) ) ) . thenReturn ( macsToMigrate ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_CANNOT_MIGRATE_MACS_DUE_TO_DUPLICATES ; java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.getListVariableAssignmentString ( engineMessage , java.util.Collections.singleton ( macsToMigrate.get ( 0 ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( underTest.canMigrateMacsToAnotherMacPool ( cluster , targetMacPoolId ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , replacements ) ) ; }
Source:
private void InitSpmPriorities ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.maxSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; InitSpmPriorities1 ( ) ; } } ) ) ; }

Target:
private void initSpmPriorities ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.maxSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; initSpmPriorities1 ( ) ; } } ) ) ; }
Source:
private void doUpdateTimeZone ( final java.lang.String selectedTimeZone ) { final java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel > timeZones = org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel.getTimeZones ( getTimeZoneType ( ) ) ; getModel ( ) . getTimeZone ( ) . setItems ( timeZones ) ; getModel ( ) . getTimeZone ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( timeZones , new org.ovirt.engine.ui.uicommonweb.Linq.TimeZonePredicate ( selectedTimeZone ) ) ) ; }

Target:
private void doUpdateTimeZone ( final java.lang.String selectedTimeZone ) { final java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel > timeZones = org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel.getTimeZones ( getTimeZoneType ( ) ) ; getModel ( ) . getTimeZone ( ) . setItems ( timeZones ) ; getModel ( ) . getTimeZone ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( timeZones , new org.ovirt.engine.ui.uicommonweb.Linq.TimeZonePredicate ( selectedTimeZone ) ) ) ; }
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.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 getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.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 ) ; }
Source:
public boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > messages ) { java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > validationErrors = getVmPropertiesUtils ( ) . validateVMProperties ( vm.getVdsGroupCompatibilityVersion ( ) , vm.getStaticData ( ) ) ; if ( ! ( validationErrors.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.VmHandler.handleCustomPropertiesError ( validationErrors , messages ) ; return false ; } return true ; }

Target:
public boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > messages ) { java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > validationErrors = getVmPropertiesUtils ( ) . validateVMProperties ( vm.getVdsGroupCompatibilityVersion ( ) , vm.getStaticData ( ) ) ; if ( ! ( validationErrors.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.getInstance ( ) . handleCustomPropertiesError ( validationErrors , messages ) ; return false ; } return true ; }
Source:
public int hashCode ( ) { int result = ( ( driverVolumeType ) != null ) ? driverVolumeType.hashCode ( ) : 0 ; result = ( 31 * result ) + ( ( data ) != null ? data.hashCode ( ) : 0 ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( driverVolumeType , data ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > RunMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > multipleParams , boolean isRunOnlyIfAllCanDoPass , boolean isWaitForResult ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( ( ( "Server: RunMultipleAction invoked! [amount of actions: " + ( multipleParams.size ( ) ) ) + "]" ) ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase params : multipleParams ) { params.setSessionId ( getSession ( ) . getId ( ) ) ; } java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues = getBackend ( ) . runMultipleActions ( actionType , multipleParams , isRunOnlyIfAllCanDoPass , isWaitForResult ) ; return returnValues ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > multipleParams , boolean isRunOnlyIfAllCanDoPass , boolean isWaitForResult ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( ( ( "Server: RunMultipleAction invoked! [amount of actions: " + ( multipleParams.size ( ) ) ) + "]" ) ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase params : multipleParams ) { params.setSessionId ( getEngineSessionId ( ) ) ; } java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues = getBackend ( ) . runMultipleActions ( actionType , multipleParams , isRunOnlyIfAllCanDoPass , isWaitForResult ) ; return returnValues ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void testCheckIfRoleIsReadOnlyTrue ( ) { getRole ( ) . setReadonly ( true ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( 1 ) ; org.junit.Assert.assertTrue ( "Role should be read only" , getCommand ( ) . checkIfRoleIsReadOnly ( messages ) ) ; org.junit.Assert.assertEquals ( "Wrong validate message" , EngineMessage.ACTION_TYPE_FAILED_ROLE_IS_READ_ONLY.toString ( ) , messages.get ( 0 ) ) ; }

Target:
public void testCheckIfRoleIsReadOnlyTrue ( ) { getRole ( ) . setReadonly ( true ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( 1 ) ; org.junit.jupiter.api.Assertions.assertTrue ( getCommand ( ) . checkIfRoleIsReadOnly ( messages ) , "Role should be read only" ) ; org.junit.jupiter.api.Assertions.assertEquals ( EngineMessage.ACTION_TYPE_FAILED_ROLE_IS_READ_ONLY.toString ( ) , messages.get ( 0 ) , "Wrong validate message" ) ; }
Source:
protected void setUpGetGraphicsMultipleExpectations ( int times ) throws java.lang.Exception { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > > vmDevices = new java.util.HashMap < > ( ) ; for ( int i = 0 ; i < times ; i ++ ) { vmDevices.put ( GUIDS [ i ] , java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevicesMultiple , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , vmDevices ) ; }

Target:
protected void setUpGetGraphicsMultipleExpectations ( int times ) throws java.lang.Exception { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > > vmDevices = new java.util.HashMap < > ( ) ; for ( int i = 0 ; i < times ; i ++ ) { vmDevices.put ( GUIDS [ i ] , java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } setUpGetEntityExpectations ( QueryType.GetGraphicsDevicesMultiple , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , vmDevices ) ; }