auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsSpmIdMap > vdsSpmIdMapList = vdsSpmIdMapDao.getAll ( org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getVds ( ) . getStoragePoolId ( ) ) ; if ( ( vdsSpmIdMapList.size ( ) ) >= ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumberOfHostsInStoragePool ) ) ) { buildFaultResult ( ) ; return ; } insertSpmIdToDb ( vdsSpmIdMapList ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsSpmIdMap > vdsSpmIdMapList = vdsSpmIdMapDao.getAll ( getDcId ( ) ) ; if ( ( vdsSpmIdMapList.size ( ) ) >= ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumberOfHostsInStoragePool ) ) ) { buildFaultResult ( ) ; return ; } insertSpmIdToDb ( vdsSpmIdMapList ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.api.model.CdRom update ( org.ovirt.engine.api.model.CdRom resource ) { if ( org.ovirt.engine.api.common.util.QueryHelper.hasCurrentConstraint ( getUriInfo ( ) ) ) { validateParameters ( resource , requiredUpdateFields ) ; performAction ( VdcActionType.ChangeDisk , new org.ovirt.engine.core.common.action.ChangeDiskCommandParameters ( getEntity ( entityResolver , true ) . getId ( ) , resource.getFile ( ) . getId ( ) ) ) ; return resource ; } else { return super . update ( resource ) ; } }

Target:
public org.ovirt.engine.api.model.Cdrom update ( org.ovirt.engine.api.model.Cdrom resource ) { if ( org.ovirt.engine.api.common.util.QueryHelper.hasCurrentConstraint ( getUriInfo ( ) ) ) { validateParameters ( resource , requiredUpdateFields ) ; performAction ( VdcActionType.ChangeDisk , new org.ovirt.engine.core.common.action.ChangeDiskCommandParameters ( getEntity ( entityResolver , true ) . getId ( ) , resource.getFile ( ) . getId ( ) ) ) ; return resource ; } else { return super . update ( resource ) ; } }
Source:
public static void getDefaultTimeZone ( 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 ) { return ( ( java.util.Map.Entry < java.lang.String , java.lang.String > ) ( source ) ) . getKey ( ) ; } return "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefualtTimeZone , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefualtTimeZone , params , aQuery ) ; }
Source:
public void testListFailure ( ) { setUpMacPoolsQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; org.junit.Assert.assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }

Target:
public void testListFailure ( ) { setUpMacPoolsQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc validateStorageServerConnection ( int serverType , java.lang.String spUUID , java.util.Map < java.lang.String , java.lang.String > [ ] args ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.validateStorageServerConnection ( serverType , spUUID , args ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc vmUpdateDevice ( java.lang.String vmId , java.util.Map device ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.vmUpdateDevice ( vmId , device ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getGuidListFromStringArray ( java.util.List < java.lang.String > strings ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guidList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; if ( ( strings != null ) && ( ! ( strings.isEmpty ( ) ) ) ) { for ( java.lang.String guidString : strings ) { guidList.add ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( guidString ) ) ; } } return guidList ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getGuidListFromStringArray ( java.util.List < java.lang.String > strings ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guidList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; if ( ( strings != null ) && ( ! ( strings.isEmpty ( ) ) ) ) { for ( java.lang.String guidString : strings ) { guidList.add ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( guidString ) ) ; } } return guidList ; }
Source:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { super . onLogin ( loginModel ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { commonModelProvider.get ( ) . updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }

Target:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . setSsoToken ( user.getEngineSessionId ( ) ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { commonModelProvider.get ( ) . updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > retval = vmTemplateDao.getAll ( org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getParameters ( ) . isFiltered ( ) , entityType ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : retval ) { org.ovirt.engine.core.bll.VmTemplateHandler.updateDisksFromDb ( template ) ; } org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getQueryReturnValue ( ) . setReturnValue ( retval ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > retval = vmTemplateDao.getAll ( org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getParameters ( ) . isFiltered ( ) , entityType ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : retval ) { vmTemplateHandler.updateDisksFromDb ( template ) ; } org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getQueryReturnValue ( ) . setReturnValue ( retval ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( ( ( "SIZE" . equals ( fieldName ) ) || ( "USED" . equals ( fieldName ) ) ) || ( "COMMITTED" . equals ( fieldName ) ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }

Target:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( ( ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.SIZE.equals ( fieldName ) ) || ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.USED.equals ( fieldName ) ) ) || ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.COMMITTED.equals ( fieldName ) ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }
Source:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testMapping ( ) { org.ovirt.engine.api.model.StorageFormat storageFormat = org.ovirt.engine.api.restapi.types.StorageFormatMapper.map ( StorageFormatType.V1 , null ) ; org.junit.Assert.assertEquals ( StorageFormat.V1 , storageFormat ) ; org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormatType = org.ovirt.engine.api.restapi.types.StorageFormatMapper.map ( storageFormat , null ) ; org.junit.Assert.assertEquals ( StorageFormatType.V1 , storageFormatType ) ; storageFormat = org.ovirt.engine.api.restapi.types.StorageFormatMapper.map ( StorageFormatType.V2 , null ) ; org.junit.Assert.assertEquals ( StorageFormat.V2 , storageFormat ) ; storageFormatType = org.ovirt.engine.api.restapi.types.StorageFormatMapper.map ( storageFormat , null ) ; org.junit.Assert.assertEquals ( StorageFormatType.V2 , storageFormatType ) ; }

Target:
public void testMapping ( ) { org.ovirt.engine.api.model.StorageFormat storageFormat = org.ovirt.engine.api.restapi.types.StorageFormatMapper.map ( StorageFormatType.V1 , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( StorageFormat.V1 , storageFormat ) ; org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormatType = org.ovirt.engine.api.restapi.types.StorageFormatMapper.map ( storageFormat , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( StorageFormatType.V1 , storageFormatType ) ; storageFormat = org.ovirt.engine.api.restapi.types.StorageFormatMapper.map ( StorageFormatType.V2 , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( StorageFormat.V2 , storageFormat ) ; storageFormatType = org.ovirt.engine.api.restapi.types.StorageFormatMapper.map ( storageFormat , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( StorageFormatType.V2 , storageFormatType ) ; }
Source:
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.storage.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
protected java.lang.String transform ( java.util.ArrayList < java.lang.String > fileNameList , org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ISO_PREFIX ) + ( super . transform ( fileNameList , repoImage ) ) ; }
Source:
private void refresh ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo ) { int softLimitValue = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.UserSessionTimeOutInterval ) ; if ( softLimitValue > 0 ) { sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SOFT_LIMIT_PARAMETER_NAME , org.apache.commons.lang.time.DateUtils.addMinutes ( new java.util.Date ( ) , softLimitValue ) ) ; } }

Target:
protected final void setData ( java.lang.String sessionId , java.lang.String key , java.lang.Object value ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo == null ) { sessionInfo = new org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo ( ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID , sessionId ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SOFT_LIMIT_INTERVAL_PARAMETER_NAME , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.UserSessionTimeOutInterval ) ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo oldSessionInfo = sessionInfoMap.putIfAbsent ( sessionId , sessionInfo ) ; if ( oldSessionInfo != null ) { sessionInfo = oldSessionInfo ; } } sessionInfo.contentOfSession.put ( key , value ) ; }
Source:
private static void updateCdInVmDevice ( org.ovirt.engine.core.common.businessentities.VmBase newVmBase ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( newVmBase.getiso_path ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmDevice cd = new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , newVmBase.getId ( ) ) , VmDeviceType.DISK.getName ( ) , VmDeviceType.CDROM.getName ( ) , "" , 0 , java.util.Collections.< java.lang.String , java.lang.Object > singletonMap ( VdsProperties.Path , newVmBase.getiso_path ( ) ) , true , null , false , "" ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.save ( cd ) ; } }

Target:
private static void updateCdInVmDevice ( org.ovirt.engine.core.common.businessentities.VmBase newVmBase ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( newVmBase.getIsoPath ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmDevice cd = new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , newVmBase.getId ( ) ) , VmDeviceType.DISK.getName ( ) , VmDeviceType.CDROM.getName ( ) , "" , 0 , java.util.Collections.< java.lang.String , java.lang.Object > singletonMap ( VdsProperties.Path , newVmBase.getIsoPath ( ) ) , true , null , false , "" ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.save ( cd ) ; } }
Source:
private boolean changesAreClusterCompatible ( ) { if ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) == false ) { boolean isSupported = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) . getValue ( ) ) ; if ( ! isSupported ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }

Target:
private boolean changesAreClusterCompatible ( ) { if ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) == false ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }
Source:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; 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.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void run ( ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryResult discoveryResult = org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerFactory.getInstance ( ) . runDiscover ( ) ; if ( discoveryResult != null ) { updateDB ( discoveryResult ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread.log.info ( "PolicyUnits updated" ) ; } else { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread.log.warn ( "Discovery returned empty result, not updating policyunits" ) ; } }

Target:
public void run ( ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryResult discoveryResult = org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerFactory.getInstance ( ) . runDiscover ( ) ; if ( discoveryResult != null ) { updateDB ( discoveryResult ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread.log.info ( "PolicyUnits updated" ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase loggable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( loggable , AuditLogType.FAILED_TO_CONNECT_TO_SCHEDULER_PROXY ) ; } }
Source:
public void testGetWithDiskId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregisteredDisk = dao.getByDiskIdAndStorageDomainId ( FixturesTool.UNREGISTERED_DISK , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( "Disk should exists in the UnregisteredDisks table" , ( ! ( unregisteredDisk.isEmpty ( ) ) ) ) ; org.junit.Assert.assertTrue ( "Vms id should be empty list in the UnregisteredDisks table" , unregisteredDisk.get ( 0 ) . getVms ( ) . isEmpty ( ) ) ; }

Target:
public void testGetWithDiskId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregisteredDisk = dao.getByDiskIdAndStorageDomainId ( FixturesTool.UNREGISTERED_DISK , FixturesTool.STORAGE_DOMAIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( "Disk should exists in the UnregisteredDisks table" , ( ! ( unregisteredDisk.isEmpty ( ) ) ) ) ; org.junit.Assert.assertTrue ( "Vms id should be empty list in the UnregisteredDisks table" , unregisteredDisk.get ( 0 ) . getVms ( ) . isEmpty ( ) ) ; }
Source:
public void validateEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private void storeVncData ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel model , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel consoleModel = asVncConsoleModel ( model ) ; if ( consoleModel != null ) { clientStorage.setLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) , consoleModel.getClientConsoleMode ( ) . toString ( ) ) ; } }

Target:
private void storeVncData ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles vmConsoles , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel consoleModel = vmConsoles.getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel.class ) ; if ( consoleModel != null ) { clientStorage.setLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) , consoleModel.getClientConsoleMode ( ) . toString ( ) ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.stopProgress ( ) ; boolean isAllCanDoPassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllCanDoPassed = isAllCanDoPassed && ( returnValueBase.getCanDoAction ( ) ) ; if ( ! isAllCanDoPassed ) { break ; } } if ( isAllCanDoPassed ) { updateAlerts ( ) ; cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.stopProgress ( ) ; boolean isAllValidatePassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllValidatePassed = isAllValidatePassed && ( returnValueBase.isValid ( ) ) ; if ( ! isAllValidatePassed ) { break ; } } if ( isAllValidatePassed ) { updateAlerts ( ) ; cancel ( ) ; } }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getDbFacade ( ) . getVmDao ( ) . getAllForUserWithGroupsAndUserRoles ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getUserID ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { updateVmGuestAgentVersion ( vm ) ; if ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getParameters ( ) . getIncludeDiskData ( ) ) { updateDisksFromDB ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; fillImagesBySnapshots ( vm ) ; } } setReturnValue ( vmList ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getDbFacade ( ) . getVmDao ( ) . getAllForUserWithGroupsAndUserRoles ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getUserID ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { updateVmGuestAgentVersion ( vm ) ; if ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getParameters ( ) . getIncludeDiskData ( ) ) { updateDisksFromDB ( vm ) ; updateVmInit ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; fillImagesBySnapshots ( vm ) ; } } setReturnValue ( vmList ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . save ( org.ovirt.engine.core.bll.storage.AddNetworkCommand.getParameters ( ) . getNetwork ( ) ) ; addPermissions ( ) ; org.ovirt.engine.core.bll.storage.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.storage.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.storage.AddNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . getNetwork ( ) ) ; addPermissions ( ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }
Source:
public java.lang.String getStorageDomainId ( ) { return storageDomainId ; }

Target:
protected org.ovirt.engine.api.model.Disk addParents ( org.ovirt.engine.api.model.Disk disk ) { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( storageDomainId.toString ( ) ) ; org.ovirt.engine.api.model.StorageDomains storageDomains = new org.ovirt.engine.api.model.StorageDomains ( ) ; storageDomains.getStorageDomains ( ) . add ( storageDomain ) ; disk.setStorageDomain ( storageDomain ) ; disk.setStorageDomains ( storageDomains ) ; return disk ; }
Source:
protected java.util.Set < java.lang.String > extractServers ( java.lang.String serversXml ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( serversXml ) ) { throw new java.lang.RuntimeException ( "Could not get the peer list!" ) ; } try { return getServers ( org.ovirt.engine.core.utils.XmlUtils.loadXmlDoc ( serversXml ) . getElementsByTagName ( org.ovirt.engine.core.bll.utils.GlusterUtil.PEER ) ) ; } catch ( java.lang.Exception e ) { log.error ( "Error while parsing peer list xml [{}]: {}" , serversXml , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; throw new java.lang.RuntimeException ( e ) ; } }

Target:
protected java.util.Set < java.lang.String > extractServers ( java.lang.String serversXml ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( serversXml ) ) { throw new java.lang.RuntimeException ( "Could not get the peer list!" ) ; } try { return getServers ( org.ovirt.engine.core.utils.XmlUtils.loadXmlDoc ( serversXml ) . getElementsByTagName ( org.ovirt.engine.core.bll.utils.GlusterUtil.PEER ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.utils.GlusterUtil.log.error ( "Error while parsing peer list xml [{}]: {}" , serversXml , e.getMessage ( ) ) ; org.ovirt.engine.core.bll.utils.GlusterUtil.log.debug ( "Exception" , e ) ; throw new java.lang.RuntimeException ( e ) ; } }
Source:
private void retrieveMaxSpmPriority ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . 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 ) { spmMaxPriorityValue = ( ( java.lang.Integer ) ( returnValue ) ) ; retrieveDefaultSpmPriority ( ) ; } } ) ) ; }

Target:
private void retrieveMaxSpmPriority ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxSpmPriority ( new org.ovirt.engine.ui.uicommonweb.models.hosts.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Integer > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Integer returnValue ) { spmMaxPriorityValue = returnValue ; retrieveDefaultSpmPriority ( ) ; } } ) ) ; }
Source:
public void testLogReturnLogsWhenLogLevelActiveAndExpandReturnButNullReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.ovirt.engine.core.utils.log.Log log = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.log.Log.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) , null ) ; org.mockito.Mockito.verify ( log ) . debugFormat ( org.mockito.Matchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) ) ; }

Target:
public void testLogReturnLogsWhenLogLevelActiveAndExpandReturnButNullReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) , null ) ; org.mockito.Mockito.verify ( log ) . debug ( org.mockito.Matchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , new java.lang.Object [ ] { org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( "" ) } ) ; }
Source:
protected boolean validate ( ) { boolean retValue = true ; if ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { retValue = super . validate ( ) ; if ( ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) { addValidationMessage ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_STOP ) ; retValue = false ; } } org.ovirt.engine.core.bll.pm.StopVdsCommand.getReturnValue ( ) . setValid ( retValue ) ; return retValue ; }

Target:
protected boolean validate ( ) { boolean retValue = true ; if ( ! ( org.ovirt.engine.core.bll.pm.StopVdsCommand.isExecutedAsChildCommand ( ) ) ) { retValue = super . validate ( ) ; if ( ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) { addValidationMessage ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_STOP ) ; retValue = false ; } } org.ovirt.engine.core.bll.pm.StopVdsCommand.getReturnValue ( ) . setValid ( retValue ) ; return retValue ; }
Source:
protected void executeVdsBrokerCommand ( ) { vmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.getBroker ( ) . getAllVmStats ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > returnVMs = new java.util.HashMap < > ( ) ; for ( int idx = 0 ; idx < ( vmListReturn.infoList.length ) ; ++ idx ) { org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vmInternalData = createVmInternalData ( vmListReturn.infoList [ idx ] ) ; returnVMs.put ( vmInternalData.getVmDynamic ( ) . getId ( ) , vmInternalData ) ; } setReturnValue ( returnVMs ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { vmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.getBroker ( ) . getAllVmStats ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm > returnVMs = new java.util.HashMap < > ( ) ; for ( int idx = 0 ; idx < ( vmListReturn.infoList.length ) ; ++ idx ) { org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm vmInternalData = createVdsmVm ( vmListReturn.infoList [ idx ] ) ; returnVMs.put ( vmInternalData.getVmDynamic ( ) . getId ( ) , vmInternalData ) ; } setReturnValue ( returnVMs ) ; }
Source:
public void getStorageDomainList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void bridgePropertiesNonVm ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; network.setVmNetwork ( false ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void syncNetworkQosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = createQos ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( qos ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
public void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public static void GetMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , 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.storage_domains > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }
Source:
public void testAddOperationAction ( ) { org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.ActionType , org.ovirt.engine.core.common.action.ActionParametersBase > testOperation = new org.ovirt.engine.ui.frontend.communication.VdcOperation ( org.ovirt.engine.core.common.action.ActionType.AddNetworkOnProvider , new org.ovirt.engine.core.common.action.ActionParametersBase ( ) , null ) ; testManager.addOperation ( testOperation ) ; org.mockito.Mockito.verify ( mockOperationProcessor ) . processOperation ( testManager ) ; org.mockito.Mockito.verify ( mockEventBus ) . fireEvent ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( "Operations must match" , testOperation , testManager.pollOperation ( ) ) ; }

Target:
public void testAddOperationAction ( ) { org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.ActionType , org.ovirt.engine.core.common.action.ActionParametersBase > testOperation = new org.ovirt.engine.ui.frontend.communication.VdcOperation ( org.ovirt.engine.core.common.action.ActionType.AddNetworkOnProvider , new org.ovirt.engine.core.common.action.ActionParametersBase ( ) , null ) ; testManager.addOperation ( testOperation ) ; org.mockito.Mockito.verify ( mockOperationProcessor ) . processOperation ( testManager ) ; org.mockito.Mockito.verify ( mockEventBus ) . fireEvent ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( testOperation , testManager.pollOperation ( ) , "Operations must match" ) ; }
Source:
public void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public void getVmById ( 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.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
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 ) ; }