auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVdsInterface ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.lang.Boolean bonded , java.lang.String bondName , java.lang.Integer vlanId , java.lang.String networkName , boolean bridged ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setId ( id ) ; iface.setName ( name ) ; iface.setBonded ( bonded ) ; iface.setBondName ( bondName ) ; iface.setVlanId ( vlanId ) ; iface.setNetworkName ( networkName ) ; iface.setBridged ( bridged ) ; return iface ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVdsInterface ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.lang.Boolean bonded , java.lang.String bondName , java.lang.Integer vlanId , java.lang.String networkName , boolean bridged , java.lang.String address ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setId ( id ) ; iface.setName ( name ) ; iface.setBonded ( bonded ) ; iface.setBondName ( bondName ) ; iface.setVlanId ( vlanId ) ; iface.setNetworkName ( networkName ) ; iface.setBridged ( bridged ) ; iface.setAddress ( address ) ; return iface ; }
Source:
public static void UpdateVdsDomainsData ( org.ovirt.engine.core.compat.Guid vdsId , java.lang.String vdsName , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainData ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { proxy.UpdateVdsDomainsData ( vdsId , vdsName , vdsDomainData ) ; } }

Target:
public static void UpdateVdsDomainsData ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainData ) { if ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { proxy.UpdateVdsDomainsData ( vds.getId ( ) , vds.getName ( ) , vdsDomainData ) ; } } }
Source:
protected boolean canDoAction ( ) { boolean returnValue = super . canDoAction ( ) ; if ( returnValue && ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getVmtGuid ( ) ) ) ) { returnValue = false ; addCanDoActionMessage ( VdcBllMessages.VM_POOL_CANNOT_CREATE_FROM_BLANK_TEMPLATE ) ; } return returnValue ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getVmtGuid ( ) ) ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_CREATE_FROM_BLANK_TEMPLATE ) ; } return true ; }
Source:
private void checkEntityForRollback ( org.ovirt.engine.core.common.businessentities.BusinessEntity < ? > entity ) { if ( entity == null ) { throw new java.lang.IllegalArgumentException ( "Can not create snapshot from a null entity" ) ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Class < org.ovirt.engine.core.common.businessentities.BusinessEntity < java.io.Serializable > > entityClass = ( ( java.lang.Class < org.ovirt.engine.core.common.businessentities.BusinessEntity < java.io.Serializable > > ) ( entity.getClass ( ) ) ) ; boolean verifyDaoExistence = ! ( entity instanceof org.ovirt.engine.core.common.businessentities.TransientCompensationBusinessEntity ) ; if ( verifyDaoExistence ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDaoForEntity ( entityClass ) ; } }

Target:
private void checkEntityForRollback ( org.ovirt.engine.core.common.businessentities.BusinessEntity < ? > entity ) { if ( entity == null ) { throw new java.lang.IllegalArgumentException ( "Can not create snapshot from a null entity" ) ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Class < org.ovirt.engine.core.common.businessentities.BusinessEntity < java.io.Serializable > > entityClass = ( ( java.lang.Class < org.ovirt.engine.core.common.businessentities.BusinessEntity < java.io.Serializable > > ) ( entity.getClass ( ) ) ) ; boolean verifyDaoExistence = ! ( entity instanceof org.ovirt.engine.core.common.businessentities.TransientCompensationBusinessEntity ) ; if ( verifyDaoExistence ) { org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) . getDaoForEntity ( entityClass ) ; } }
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 getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute sync getIsUserLoggedIn: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.onFailure ( null ) ; }

Target:
public static void RunAction ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , final boolean showErrorDialog ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( actionType , parameters , org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK , null , showErrorDialog ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue removeImage ( org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters parameters ) { try { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DeleteImageGroup , parameters ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { if ( ( e.getErrorCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.ImageDoesNotExistInDomainError ) ) { return createImageDoesNotExistInDomainReturnValue ( ) ; } throw e ; } }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue removeImage ( org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters parameters ) { try { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DeleteImageGroup , parameters ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { if ( ( e.getErrorCode ( ) ) == ( org.ovirt.engine.core.common.errors.EngineError.ImageDoesNotExistInDomainError ) ) { return createImageDoesNotExistInDomainReturnValue ( ) ; } throw e ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { setEnumTitle ( diskImage.getImageStatus ( ) ) ; switch ( diskImage.getImageStatus ( ) ) { case OK : return getCommonResources ( ) . upImage ( ) ; case LOCKED : return getCommonResources ( ) . waitImage ( ) ; case ILLEGAL : return getCommonResources ( ) . logErrorImage ( ) ; default : return null ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { switch ( diskImage.getImageStatus ( ) ) { case OK : return org.ovirt.engine.ui.common.widget.table.column.DiskImageStatusColumn.resources.upImage ( ) ; case LOCKED : return org.ovirt.engine.ui.common.widget.table.column.DiskImageStatusColumn.resources.waitImage ( ) ; case ILLEGAL : return org.ovirt.engine.ui.common.widget.table.column.DiskImageStatusColumn.resources.logErrorImage ( ) ; default : return null ; } }
Source:
protected void removeOvfForTemplatesAndVmsOfStoragePool ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { org.ovirt.engine.core.compat.Guid poolId = pool.getId ( ) ; removedOvfIdsInfo = org.ovirt.engine.core.bll.ProcessOvfUpdateForStoragePoolCommand.getVmAndTemplatesGenerationsDAO ( ) . getIdsForOvfDeletion ( poolId ) ; if ( ! ( ovfOnAnyDomainSupported ( pool ) ) ) { for ( org.ovirt.engine.core.compat.Guid id : removedOvfIdsInfo ) { getOvfUpdateProcessHelper ( ) . executeRemoveVmInSpm ( poolId , id , Guid.Empty ) ; } } markDomainsWithOvfsForOvfUpdate ( removedOvfIdsInfo ) ; org.ovirt.engine.core.bll.ProcessOvfUpdateForStoragePoolCommand.getVmAndTemplatesGenerationsDAO ( ) . deleteOvfGenerations ( removedOvfIdsInfo ) ; }

Target:
protected void removeOvfForTemplatesAndVmsOfStoragePool ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { org.ovirt.engine.core.compat.Guid poolId = pool.getId ( ) ; removedOvfIdsInfo = org.ovirt.engine.core.bll.ProcessOvfUpdateForStoragePoolCommand.getVmAndTemplatesGenerationsDao ( ) . getIdsForOvfDeletion ( poolId ) ; if ( ! ( ovfOnAnyDomainSupported ( pool ) ) ) { for ( org.ovirt.engine.core.compat.Guid id : removedOvfIdsInfo ) { getOvfUpdateProcessHelper ( ) . executeRemoveVmInSpm ( poolId , id , Guid.Empty ) ; } } markDomainsWithOvfsForOvfUpdate ( removedOvfIdsInfo ) ; org.ovirt.engine.core.bll.ProcessOvfUpdateForStoragePoolCommand.getVmAndTemplatesGenerationsDao ( ) . deleteOvfGenerations ( removedOvfIdsInfo ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > getRepoListForStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType fileType ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_domain_id" , storageDomainId ) ; if ( ( fileType == null ) || ( fileType == ( org.ovirt.engine.core.common.businessentities.ImageFileType.All ) ) ) { parameterSource.addValue ( "file_type" , null ) ; } else { parameterSource.addValue ( "file_type" , fileType.getValue ( ) ) ; } return getCallsHandler ( ) . executeReadList ( "GetRepo_files_by_storage_domain" , org.ovirt.engine.core.dao.RepoFileMetaDataDAODbFacadeImpl.RepoImageMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getRepoListForStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType fileType ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_domain_id" , storageDomainId ) ; if ( ( fileType == null ) || ( fileType == ( org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All ) ) ) { parameterSource.addValue ( "file_type" , null ) ; } else { parameterSource.addValue ( "file_type" , fileType.getValue ( ) ) ; } return getCallsHandler ( ) . executeReadList ( "GetRepo_files_by_storage_domain" , org.ovirt.engine.core.dao.RepoFileMetaDataDAODbFacadeImpl.RepoImageMapper.instance , parameterSource ) ; }
Source:
private javax.ws.rs.core.Response handleConfigureConsoleError ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue configuredOptionsReturnValue ) { org.ovirt.engine.api.restapi.resource.BackendVmGraphicsConsoleResource.log.error ( localize ( Messages.BACKEND_FAILED_TEMPLATE , configuredOptionsReturnValue.getExceptionString ( ) ) ) ; if ( EngineMessage.USER_CANNOT_FORCE_RECONNECT_TO_VM.name ( ) . equals ( configuredOptionsReturnValue.getExceptionString ( ) ) ) { return javax.ws.rs.core.Response.status ( Response.Status.FORBIDDEN ) . build ( ) ; } return javax.ws.rs.core.Response.serverError ( ) . build ( ) ; }

Target:
private javax.ws.rs.core.Response handleConfigureConsoleError ( java.lang.String exceptionMessage ) { org.ovirt.engine.api.restapi.resource.BackendVmGraphicsConsoleResource.log.error ( localize ( Messages.BACKEND_FAILED_TEMPLATE , exceptionMessage ) ) ; if ( EngineMessage.USER_CANNOT_FORCE_RECONNECT_TO_VM.name ( ) . equals ( exceptionMessage ) ) { return javax.ws.rs.core.Response.status ( Response.Status.FORBIDDEN ) . build ( ) ; } return javax.ws.rs.core.Response.serverError ( ) . build ( ) ; }
Source:
private void assertFailsWith ( java.lang.String errorMessage , org.ovirt.engine.core.bll.ValidationResult validationResult , org.ovirt.engine.core.common.errors.EngineMessage engineMessage ) { org.assertj.core.api.Assertions.assertThat ( validationResult.isValid ( ) ) . isFalse ( ) . as ( errorMessage ) ; org.assertj.core.api.Assertions.assertThat ( validationResult.getMessage ( ) ) . isEqualTo ( engineMessage ) . as ( errorMessage ) ; }

Target:
private void assertFailsWith ( java.lang.String errorMessage , org.ovirt.engine.core.bll.ValidationResult validationResult , org.ovirt.engine.core.common.errors.EngineMessage engineMessage ) { org.junit.Assert.assertThat ( errorMessage , validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage ) ) ; }
Source:
protected void updateMigrateOnError ( ) { if ( ( ( getVdsGroup ( ) ) != null ) && ( ( getVdsGroup ( ) . getMigrateOnError ( ) ) == null ) ) { boolean isMigrationSupported = org.ovirt.engine.core.common.FeatureSupported.isMigrationSupported ( getArchitecture ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions migrateOnError = ( isMigrationSupported ) ? org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.YES : org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.NO ; getVdsGroup ( ) . setMigrateOnError ( migrateOnError ) ; } }

Target:
protected void updateMigrateOnError ( ) { if ( ( ( getCluster ( ) ) != null ) && ( ( getCluster ( ) . getMigrateOnError ( ) ) == null ) ) { boolean isMigrationSupported = org.ovirt.engine.core.common.FeatureSupported.isMigrationSupported ( getArchitecture ( ) , getCluster ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions migrateOnError = ( isMigrationSupported ) ? org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.YES : org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.NO ; getCluster ( ) . setMigrateOnError ( migrateOnError ) ; } }
Source:
public void testGetEventNotificationMethodsByType ( ) { java.lang.String target = "Email" ; java.util.List < org.ovirt.engine.core.common.businessentities.event_notification_methods > result = dao.getEventNotificationMethodsByType ( target ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.event_notification_methods method : result ) { assertEquals ( EventNotificationMethods.EMAIL , method.getmethod_type ( ) ) ; } }

Target:
public void testGetEventNotificationMethodsByType ( ) { java.lang.String target = "Email" ; java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > result = dao.getEventNotificationMethodsByType ( target ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.EventNotificationMethod method : result ) { assertEquals ( EventNotificationMethods.EMAIL , method.getmethod_type ( ) ) ; } }
Source:
public void testMigrateWithHostName ( ) throws java.lang.Exception { setUpGetHostByNameExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVmToServer , org.ovirt.engine.core.common.action.MigrateVmToServerParameters.class , new java.lang.String [ ] { "VmId" , "VdsId" , "ForceMigrationForNonMigratableVm" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 1 ] , java.lang.Boolean.FALSE } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; action.getHost ( ) . setName ( NAMES [ 1 ] ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }

Target:
public void testMigrateWithHostName ( ) throws java.lang.Exception { setUpGetHostByNameExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.MigrateVmToServer , org.ovirt.engine.core.common.action.MigrateVmToServerParameters.class , new java.lang.String [ ] { "VmId" , "VdsId" , "ForceMigrationForNonMigratableVm" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 1 ] , java.lang.Boolean.FALSE } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; action.getHost ( ) . setName ( NAMES [ 1 ] ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }
Source:
private void initializeMacPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { java.util.List < java.lang.String > macsForMacPool = macPoolDao.getAllMacsForMacPool ( macPool.getId ( ) ) ; final org.ovirt.engine.core.bll.network.macpool.MacPool pool = createPoolWithoutLocking ( macPool ) ; for ( java.lang.String mac : macsForMacPool ) { pool.forceAddMac ( mac ) ; } }

Target:
private void initializeMacPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { java.util.List < java.lang.String > macsForMacPool = macPoolDao.getAllMacsForMacPool ( macPool.getId ( ) ) ; final org.ovirt.engine.core.bll.network.macpool.MacPool pool = createPoolInternal ( macPool ) ; for ( java.lang.String mac : macsForMacPool ) { pool.forceAddMac ( mac ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.Snapshot getActiveSnapshot ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) return snapshot ; } org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "VM '{}' doesn't have active snapshot in export domain" , getVmId ( ) ) ; return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromExportDomain ( org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : getVmsFromExportDomain ( ) ) { if ( vmId.equals ( vm.getId ( ) ) ) { return vm ; } } return null ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Quota quota ) { validateParameters ( quota , "name" ) ; org.ovirt.engine.api.model.Quota entity = map ( quota ) ; entity.setStoragePoolId ( dataCenterId ) ; return performCreation ( VdcActionType.AddQuota , new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetQuotaByQuotaId , org.ovirt.engine.core.common.queries.GetQuotaByQuotaIdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Quota quota ) { validateParameters ( quota , "name" ) ; org.ovirt.engine.api.model.Quota entity = map ( quota ) ; entity.setStoragePoolId ( dataCenterId ) ; return performCreate ( VdcActionType.AddQuota , new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetQuotaByQuotaId , org.ovirt.engine.core.common.queries.GetQuotaByQuotaIdQueryParameters.class ) ) ; }
Source:
public void executeCommand ( ) { setUpMocksForRemove ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . remove ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_REMOVED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommand ( ) { setUpMocksForRemove ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . remove ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( AuditLogType.GLUSTER_HOOK_REMOVED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVm ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolDAO ( ) . getVmPoolMapByVmGuid ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmId ( ) ) ) == null ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL ) ; } if ( org.ovirt.engine.core.bll.RemoveVmCommand.isVmRunning ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getParameters ( ) . getVmId ( ) ) ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVm ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolId ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL ) ; } if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVm ( ) . isRunningOrPaused ( ) ) || ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL ) ; } return true ; }
Source:
public void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }

Target:
public void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }
Source:
public void rollback ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object runInTransaction ( ) { if ( ! ( getParameters ( ) . isLeaveLocked ( ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getImage ( ) ; if ( diskImage != null ) { getImageDao ( ) . updateStatus ( diskImage.getImage ( ) . getId ( ) , ImageStatus.OK ) ; } unLockImage ( ) ; } return null ; } } ) ; }

Target:
public void onRollback ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object runInTransaction ( ) { if ( ! ( getParameters ( ) . isLeaveLocked ( ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getImage ( ) ; if ( diskImage != null ) { getImageDao ( ) . updateStatus ( diskImage.getImage ( ) . getId ( ) , ImageStatus.OK ) ; } unLockImage ( ) ; } return null ; } } ) ; }
Source:
public void prepareParams ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; parameters.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters ) ) ; }

Target:
public void prepareParams ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; parameters.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters ) ) ; }
Source:
public void testUrlWithPaginationAndTypes ( ) { org.ovirt.engine.core.common.queries.ErrataFilter errataFilter = new org.ovirt.engine.core.common.queries.ErrataFilter ( ) ; errataFilter.setErrataTypes ( java.util.EnumSet.of ( Erratum.ErrataType.BUGFIX , Erratum.ErrataType.SECURITY ) ) ; errataFilter.setPageSize ( 20 ) ; errataFilter.setPageNumber ( 3 ) ; org.ovirt.engine.core.bll.host.provider.foreman.FilteredErrataRelativeUrlBuilder underTest = new org.ovirt.engine.core.bll.host.provider.foreman.FilteredErrataRelativeUrlBuilder ( org.ovirt.engine.core.bll.host.provider.foreman.FilteredErrataRelativeUrlBuilderTest.HOST_ID , errataFilter ) ; org.junit.Assert.assertEquals ( "/katello/api/v2/systems/xxx/errata?search=type+%3D+bugfix+or+type+%3D+security&page=3&per_page=20" , underTest.build ( ) ) ; }

Target:
public void testUrlWithPaginationAndTypes ( ) { org.ovirt.engine.core.common.queries.ErrataFilter errataFilter = new org.ovirt.engine.core.common.queries.ErrataFilter ( ) ; errataFilter.setErrataTypes ( java.util.EnumSet.of ( Erratum.ErrataType.BUGFIX , Erratum.ErrataType.SECURITY ) ) ; errataFilter.setPageSize ( 20 ) ; errataFilter.setPageNumber ( 3 ) ; org.ovirt.engine.core.bll.host.provider.foreman.FilteredErrataRelativeUrlBuilder underTest = createFilteredErrataRelativeUrlBuilder ( errataFilter ) ; org.junit.Assert.assertEquals ( "/katello/api/v2/systems/xxx/errata?search=type+%3D+bugfix+or+type+%3D+security&page=3&per_page=20" , underTest.build ( ) ) ; }
Source:
public void testUpdate ( ) { existingAuditLog.setmessage ( existingAuditLog.getmessage ( ) . toUpperCase ( ) ) ; existingAuditLog.setseverity ( AuditLogSeverity.ERROR ) ; dao.update ( existingAuditLog ) ; org.ovirt.engine.core.common.businessentities.AuditLog result = dao.get ( existingAuditLog.getaudit_log_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingAuditLog , result ) ; }

Target:
private static void assertGetByNameValidResults ( java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > results ) { org.ovirt.engine.core.dao.AuditLogDAOTest.assertGetByNameResults ( results , org.ovirt.engine.core.dao.AuditLogDAOTest.FILTERED_COUNT ) ; }
Source:
public 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 java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNetworkQos > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNetworkQos > qosList = ( returnValue == null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.HostNetworkQos > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNetworkQos > ) ( returnValue ) ) ; qosList.add ( 0 , NetworkModel.EMPTY_HOST_NETWORK_QOS ) ; return qosList ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetStepsWithSubjectEntitiesByJobId , org.ovirt.engine.core.common.queries.GetStepsWithSubjectEntitiesByJobIdQueryParameters.class , new java.lang.String [ ] { "JobId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpSteps ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.jupiter.api.Assertions.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetStepsWithSubjectEntitiesByJobId , org.ovirt.engine.core.common.queries.GetStepsWithSubjectEntitiesByJobIdQueryParameters.class , new java.lang.String [ ] { "JobId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpSteps ( ) , failure ) ; }
Source:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public void getVmNextRunConfiguration ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void setUpManagementNetworkExpectation ( ) throws java.lang.Exception { setUpPopulateExpectation ( ) ; final org.ovirt.engine.core.common.businessentities.network.Network mockNetwork = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.network.Network.class ) ; org.mockito.Mockito.when ( mockNetwork.getId ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendClusterResourceTest.MANAGEMENT_NETWORK_ID ) ; setUpGetEntityExpectations ( VdcQueryType.GetManagementNetwork , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , mockNetwork ) ; }

Target:
private void setUpManagementNetworkExpectation ( ) throws java.lang.Exception { setUpPopulateExpectation ( ) ; final org.ovirt.engine.core.common.businessentities.network.Network mockNetwork = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.network.Network.class ) ; org.mockito.Mockito.when ( mockNetwork.getId ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendClusterResourceTest.MANAGEMENT_NETWORK_ID ) ; setUpGetEntityExpectations ( QueryType.GetManagementNetwork , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , mockNetwork ) ; }
Source:
public void testIsNetworkInSyncWhenStaticBootProtocolNetmaskEqual ( ) throws java.lang.Exception { initIpConfigurationBootProtocolNetmask ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL , true ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolNetmaskDifferent ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocolNetmask ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public void SaveDefaultValues ( ) { if ( ( getSelectionAlgorithm ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.EvenlyDistribute ) ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel.highLimitEvenlyDistributed = getOverCommitHighLevel ( ) ; } else if ( ( getSelectionAlgorithm ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.PowerSave ) ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel.lowLimitPowerSaving = getOverCommitLowLevel ( ) ; org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel.highLimitPowerSaving = getOverCommitHighLevel ( ) ; } }

Target:
public void SaveDefaultValues ( ) { if ( ( getSelectionAlgorithm ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.EvenlyDistribute ) ) { ClusterGeneralModel.highLimitEvenlyDistributed = getOverCommitHighLevel ( ) ; } else if ( ( getSelectionAlgorithm ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.PowerSave ) ) { ClusterGeneralModel.lowLimitPowerSaving = getOverCommitLowLevel ( ) ; ClusterGeneralModel.highLimitPowerSaving = getOverCommitHighLevel ( ) ; } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public boolean IsMacInUse ( java.lang.String mac ) { lockObj.readLock ( ) . lock ( ) ; try { return ( allocatedMacs.contains ( mac ) ) || ( allocatedCustomMacs.contains ( mac ) ) ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }

Target:
public boolean isMacInUse ( java.lang.String mac ) { lockObj.readLock ( ) . lock ( ) ; try { return ( allocatedMacs.contains ( mac ) ) || ( allocatedCustomMacs.contains ( mac ) ) ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }
Source:
public void testGetAllEventNotificationMethods ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > result = dao.getAllEventNotificationMethods ( ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; assertEquals ( org.ovirt.engine.core.dao.EventDAOTest.NOTIFICATION_METHOD_COUNT , result.size ( ) ) ; }

Target:
public void testGetEventNotificationMethodsById ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > result = dao.getEventNotificationMethodsById ( 1 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; }
Source:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveOrCopyParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } return doAction ( ActionType.ExportVmTemplate , params , action , PollingType.JOB ) ; }

Target:
public javax.ws.rs.core.Response exportToPathOnHost ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.core.common.action.ExportOvaParameters params = new org.ovirt.engine.core.common.action.ExportOvaParameters ( ) ; params.setEntityType ( VmEntityType.TEMPLATE ) ; params.setEntityId ( guid ) ; params.setProxyHostId ( getHostId ( action ) ) ; params.setDirectory ( action.getDirectory ( ) ) ; params.setName ( action.getFilename ( ) ) ; return doAction ( ActionType.ExportVmTemplateToOva , params , action ) ; }
Source:
public void initMigrationPolicies ( boolean isEdit ) { java.util.List < org.ovirt.engine.core.common.migration.MigrationPolicy > policies = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMigrationPolicies ( ) ; getMigrationPolicies ( ) . setItems ( policies ) ; if ( isEdit ) { for ( org.ovirt.engine.core.common.migration.MigrationPolicy policy : policies ) { if ( java.util.Objects.equals ( policy.getId ( ) , getEntity ( ) . getMigrationPolicyId ( ) ) ) { getMigrationPolicies ( ) . setSelectedItem ( policy ) ; break ; } } } }

Target:
private org.ovirt.engine.core.common.migration.MigrationPolicy findMigrationPolicyById ( org.ovirt.engine.core.compat.Guid id , java.util.List < org.ovirt.engine.core.common.migration.MigrationPolicy > policies ) { for ( org.ovirt.engine.core.common.migration.MigrationPolicy policy : policies ) { if ( java.util.Objects.equals ( policy.getId ( ) , id ) ) { return policy ; } } return null ; }
Source:
private org.ovirt.engine.core.common.action.VdcActionParametersBase createUpgradeParameters ( org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters parameters ) { org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters upgradeParams = new org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters ( parameters.getVdsId ( ) ) ; upgradeParams.setSessionId ( parameters.getSessionId ( ) ) ; upgradeParams.setCorrelationId ( parameters.getCorrelationId ( ) ) ; upgradeParams.setInitialStatus ( parameters.getInitialStatus ( ) ) ; upgradeParams.setoVirtIsoFile ( parameters.getoVirtIsoFile ( ) ) ; upgradeParams.setParentCommand ( VdcActionType.UpgradeHost ) ; upgradeParams.setParentParameters ( parameters ) ; return upgradeParams ; }

Target:
private org.ovirt.engine.core.common.action.ActionParametersBase createUpgradeParameters ( org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters parameters ) { org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters upgradeParams = new org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters ( parameters.getVdsId ( ) ) ; upgradeParams.setSessionId ( parameters.getSessionId ( ) ) ; upgradeParams.setCorrelationId ( parameters.getCorrelationId ( ) ) ; upgradeParams.setInitialStatus ( parameters.getInitialStatus ( ) ) ; upgradeParams.setoVirtIsoFile ( parameters.getoVirtIsoFile ( ) ) ; upgradeParams.setParentCommand ( ActionType.UpgradeHost ) ; upgradeParams.setParentParameters ( parameters ) ; return upgradeParams ; }
Source:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > > 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.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; 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 java.lang.Object FindOne ( org.ovirt.engine.core.bll.adbroker.LdapQueryData ldapQueryData ) { java.util.List < ? > userObjects = find ( ldapQueryData , 1 ) ; if ( ( userObjects == null ) || ( ( userObjects.size ( ) ) == 0 ) ) { return null ; } return userObjects.get ( 0 ) ; }

Target:
public java.lang.Object findOne ( org.ovirt.engine.core.bll.adbroker.LdapQueryData ldapQueryData ) { java.util.List < ? > userObjects = find ( ldapQueryData , 1 ) ; if ( ( userObjects == null ) || ( ( userObjects.size ( ) ) == 0 ) ) { return null ; } return userObjects.get ( 0 ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid findImageForSameDrive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType ) { return findImageForSameDrive ( getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.BaseImagesCommand.getVmDAO ( ) . getVmsListForDisk ( getImage ( ) . getId ( ) , false ) . get ( 0 ) . getId ( ) , snapshotType ) ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid findImageForSameDrive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType ) { return findImageForSameDrive ( org.ovirt.engine.core.bll.BaseImagesCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.BaseImagesCommand.getVmDao ( ) . getVmsListForDisk ( getImage ( ) . getId ( ) , false ) . get ( 0 ) . getId ( ) , snapshotType ) ) ; }
Source:
private org.ovirt.engine.core.common.mode.ApplicationMode findApplicationMode ( java.lang.String sessionId ) { org.ovirt.engine.core.common.queries.GetConfigurationValueParameters parameters = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.config.ConfigValues.ApplicationMode , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ; parameters.setSessionId ( sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( VdcQueryType.GetConfigurationValue , parameters ) ; return org.ovirt.engine.core.common.mode.ApplicationMode.from ( result.getReturnValue ( ) ) ; }

Target:
private org.ovirt.engine.core.common.mode.ApplicationMode findApplicationMode ( java.lang.String sessionId ) { org.ovirt.engine.core.common.queries.GetConfigurationValueParameters parameters = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.config.ConfigValues.ApplicationMode , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ; parameters.setSessionId ( sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( QueryType.GetConfigurationValue , parameters ) ; return org.ovirt.engine.core.common.mode.ApplicationMode.from ( result.getReturnValue ( ) ) ; }
Source:
public void testValidUpdateOfHostedEngineEditableFieldOnRunningVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; src.setDescription ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; dest.setDescription ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; boolean updateIsValid = org.ovirt.engine.core.bll.VmHandler.isUpdateValid ( src , dest , VMStatus.Up , false ) ; org.junit.Assert.assertTrue ( "Update should be valid for different descriptions on a running, hosted engine VM" , updateIsValid ) ; }

Target:
public void testValidUpdateOfHostedEngineEditableFieldOnRunningVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; src.setDescription ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; dest.setDescription ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; boolean updateIsValid = vmHandler.isUpdateValid ( src , dest , VMStatus.Up , false ) ; org.junit.Assert.assertTrue ( "Update should be valid for different descriptions on a running, hosted engine VM" , updateIsValid ) ; }