auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private boolean deviceCanBeRemoved ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { if ( ! ( vmDevice.getDevice ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) ) { return true ; } if ( ( vmDevice.getSnapshotId ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.Disk disk = getDiskDao ( ) . get ( vmDevice.getDeviceId ( ) ) ; return ( disk != null ) && ( disk.isAllowSnapshot ( ) ) ; } return false ; }

Target:
private boolean deviceCanBeRemoved ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { if ( ( ! ( vmDevice.getDevice ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) ) || ( ! ( vmDevice.getIsManaged ( ) ) ) ) { return true ; } return ( ( vmDevice.getSnapshotId ( ) ) == null ) && ( getDiskDao ( ) . get ( vmDevice.getDeviceId ( ) ) . isAllowSnapshot ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBaseInterface ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseInterface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; baseInterface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; baseInterface.setNetworkName ( networkName ) ; baseInterface.setName ( "eth" ) ; baseInterface.setQos ( qos ) ; return baseInterface ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBaseInterface ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseInterface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; baseInterface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; baseInterface.setNetworkName ( networkName ) ; baseInterface.setName ( "eth" ) ; baseInterface.setQos ( qos ) ; baseInterface.setVdsId ( VDS_ID ) ; return baseInterface ; }
Source:
public java.lang.String getText ( java.lang.Object image ) { if ( image instanceof org.ovirt.engine.core.common.businessentities.RepoImage ) { return ( ( org.ovirt.engine.core.common.businessentities.RepoImage ) ( image ) ) . getRepoImageTitle ( ) ; } else if ( image instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( image ) ) . getDiskAlias ( ) ; } return constants.unknown ( ) ; }

Target:
public java.lang.String getText ( java.lang.Object image ) { if ( image instanceof org.ovirt.engine.core.common.businessentities.storage.RepoImage ) { return ( ( org.ovirt.engine.core.common.businessentities.storage.RepoImage ) ( image ) ) . getRepoImageTitle ( ) ; } else if ( image instanceof org.ovirt.engine.core.common.businessentities.storage.DiskImage ) { return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( image ) ) . getDiskAlias ( ) ; } return constants.unknown ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMInfoListReturnForXmlRpc getAllVmStats ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getAllVmStats" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "statsList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMInfoListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMInfoListReturn getAllVmStats ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getAllVmStats" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "statsList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMInfoListReturn ( response ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmFromScratchCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmFromScratchCommand.getActionType ( ) . getActionGroup ( ) ) ) ; addPermissionSubjectForCustomProperties ( permissionList ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmFromScratchCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmFromScratchCommand.getActionType ( ) . getActionGroup ( ) ) ) ; addPermissionSubjectForAdminLevelProperties ( permissionList ) ; return permissionList ; }
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 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 org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Cluster incoming , org.ovirt.engine.core.common.businessentities.VDSGroup entity ) { final org.ovirt.engine.core.common.businessentities.VDSGroup cluster = map ( incoming , entity ) ; final org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters managementNetworkOnClusterOperationParameters ; final org.ovirt.engine.core.compat.Guid dcId = getDataCenterId ( cluster ) ; if ( dcId == null ) { managementNetworkOnClusterOperationParameters = new org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters ( cluster ) ; } else { final org.ovirt.engine.core.compat.Guid managementNetworkId = managementNetworkFinder.getManagementNetworkId ( incoming , dcId ) ; managementNetworkOnClusterOperationParameters = new org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters ( cluster , managementNetworkId ) ; } return managementNetworkOnClusterOperationParameters ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.core.common.businessentities.Cluster incoming , org.ovirt.engine.core.common.businessentities.Cluster entity ) { final org.ovirt.engine.core.common.businessentities.Cluster cluster = map ( incoming , entity ) ; final org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters managementNetworkOnClusterOperationParameters ; final org.ovirt.engine.core.compat.Guid dcId = getDataCenterId ( cluster ) ; if ( dcId == null ) { managementNetworkOnClusterOperationParameters = new org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters ( cluster ) ; } else { final org.ovirt.engine.core.compat.Guid managementNetworkId = managementNetworkFinder.getManagementNetworkId ( incoming , dcId ) ; managementNetworkOnClusterOperationParameters = new org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters ( cluster , managementNetworkId ) ; } return managementNetworkOnClusterOperationParameters ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosValuesTest ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { return qosValuesTest ( createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) , qos ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
private void testConnectionMountOptionsValidations ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String mountOptions , boolean shouldSucceed ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createConnection ( storageType , mountOptions ) ; params.setStorageServerConnection ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidationResult result = command.validateMountOptions ( ) ; if ( shouldSucceed ) { org.junit.Assert.assertTrue ( result.isValid ( ) ) ; } else { org.junit.Assert.assertThat ( result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) ; } }

Target:
private void testConnectionMountOptionsValidations ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String mountOptions , boolean shouldSucceed ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createConnection ( storageType , mountOptions ) ; params.setStorageServerConnection ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidationResult result = command.validateMountOptions ( ) ; if ( shouldSucceed ) { org.junit.jupiter.api.Assertions.assertTrue ( result.isValid ( ) ) ; } else { org.hamcrest.MatcherAssert.assertThat ( result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) ; } }
Source:
public void canDoActionVmInPreview ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Down , null , diskImageId ) ; setVmInPreview ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW.toString ( ) ) ) ; }

Target:
public void moveDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Down , null , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( ( ( command.getMoveDiskParametersList ( ) . size ( ) ) == 1 ) ) ; }
Source:
public org.ovirt.engine.sdk.entities.Response delete ( org.ovirt.engine.sdk.entities.Action action , java.lang.Boolean async , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . add ( "async" , async , UrlParameterType.MATRIX ) . build ( ) ; return getProxy ( ) . delete ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Response.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.entities.Response delete ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . delete ( url , org.ovirt.engine.sdk.entities.Response.class , headers ) ; }
Source:
protected boolean shouldCheckSpaceInStorageDomains ( ) { return ( ! ( getImagesToCheckDestinationStorageDomains ( ) . isEmpty ( ) ) ) && ( ! ( org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( getImagesToCheckDestinationStorageDomains ( ) , new org.ovirt.engine.core.utils.linq.All < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) . getImageId ( ) . equals ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) ) ) ; }

Target:
protected boolean shouldCheckSpaceInStorageDomains ( ) { return ! ( getImagesToCheckDestinationStorageDomains ( ) . stream ( ) . map ( DiskImage :: getImageId ) . findFirst ( ) . orElse ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) . equals ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) ) ; }
Source:
private boolean canRunOnDestinationVds ( java.util.List < java.lang.String > messages , boolean isMigrate ) { boolean returnValue = false ; if ( ( getDestinationVdsId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDS target_vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getDestinationVdsId ( ) ) ; org.ovirt.engine.core.bll.VdsSelector.log.infoFormat ( "Checking for a specific VDS only - id:{0}, name:{1}, host_name(ip):{2}" , getDestinationVdsId ( ) , target_vds.getvds_name ( ) , target_vds.gethost_name ( ) ) ; returnValue = canFindVdsToRun ( messages , isMigrate , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( java.util.Arrays.asList ( target_vds ) ) ) ; } return returnValue ; }

Target:
private boolean canRunOnDestinationVds ( java.util.List < java.lang.String > messages , boolean isMigrate ) { boolean returnValue = false ; if ( ( getDestinationVdsId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDS target_vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getDestinationVdsId ( ) ) ; org.ovirt.engine.core.bll.VdsSelector.log.infoFormat ( "Checking for a specific VDS only - id:{0}, name:{1}, host_name(ip):{2}" , getDestinationVdsId ( ) , target_vds.getVdsName ( ) , target_vds.getHostName ( ) ) ; returnValue = canFindVdsToRun ( messages , isMigrate , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( java.util.Arrays.asList ( target_vds ) ) ) ; } return returnValue ; }
Source:
public void testUpdate ( ) { existingTemplate.setdescription ( "This is an updated description" ) ; dao.update ( existingTemplate ) ; org.ovirt.engine.core.common.businessentities.VmTemplate result = dbFacade.getVmTemplateDao ( ) . get ( existingTemplate.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingTemplate , result ) ; }

Target:
public void testUpdate ( ) { existingTemplate.setDescription ( "This is an updated description" ) ; dao.update ( existingTemplate ) ; org.ovirt.engine.core.common.businessentities.VmTemplate result = dbFacade.getVmTemplateDao ( ) . get ( existingTemplate.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingTemplate , result ) ; }
Source:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void updateVolumeStatusByName ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus status ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterVolumeStatusByName" , getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , clusterId ) . addValue ( "vol_name" , volumeName ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( status ) ) ) ; }

Target:
public void updateVolumeStatusByName ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus status ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterVolumeStatusByName" , getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , clusterId ) . addValue ( "vol_name" , volumeName ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( status ) ) ) ; }
Source:
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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
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:
public void testGetByOriginAndCustomEventId ( ) { org.ovirt.engine.core.common.businessentities.AuditLog result = dao.getByOriginAndCustomEventId ( "EMC" , 1 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( externalAuditLog , result ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { _isoList = org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.getIrsProxy ( ) . getFloppyList ( org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.ProceedProxyReturnValue ( ) ; if ( ( ( _isoList.mVMList ) != null ) && ( ( _isoList.mVMList.length ) > 0 ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.setReturnValue ( new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( _isoList.mVMList ) ) ) ; } else { org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.setReturnValue ( new java.util.ArrayList < java.lang.String > ( ) ) ; } }

Target:
protected void ExecuteIrsBrokerCommand ( ) { _isoList = org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.getIrsProxy ( ) . getFloppyList ( org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.proceedProxyReturnValue ( ) ; if ( ( ( _isoList.mVMList ) != null ) && ( ( _isoList.mVMList.length ) > 0 ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.setReturnValue ( new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( _isoList.mVMList ) ) ) ; } else { org.ovirt.engine.core.vdsbroker.irsbroker.GetFloppyListVDSCommand.setReturnValue ( new java.util.ArrayList < java.lang.String > ( ) ) ; } }
Source:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalConsolePopupModel model ) { this . model = model ; initView ( model ) ; initListeners ( model ) ; java.lang.String vmName = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( model.getModel ( ) . getSelectedItem ( ) ) ) . getName ( ) ; getView ( ) . setVmName ( vmName ) ; super . init ( model ) ; }

Target:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { if ( model.getModel ( ) . isPool ( ) ) { throw new java.lang.IllegalArgumentException ( "The console popup can not be used with pool, only with VM" ) ; } this . model = model ; initView ( model ) ; initListeners ( model ) ; java.lang.String vmName = model.getModel ( ) . getVM ( ) . getName ( ) ; getView ( ) . setVmName ( vmName ) ; super . init ( model ) ; }
Source:
protected void gatherChangedVms ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , vdsmVm ) ) ; }

Target:
protected void gatherChangedVms ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , vdsmVm ) ) ; logBuilder.append ( java.lang.String.format ( " %s:%s" , vdsmVm.getVmDynamic ( ) . getId ( ) . toString ( ) . substring ( 0 , 8 ) , vdsmVm.getVmDynamic ( ) . getStatus ( ) ) ) ; }
Source:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( createVdsGroup ( ) ) . when ( cmd ) . getVdsGroup ( ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO_SCSI" ) ) ) ; org.junit.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }

Target:
public void testBeanValidations ( ) { org.junit.Assert.assertTrue ( createCommand ( initializeMock ( 1 ) ) . validateInputs ( ) ) ; }
Source:
private void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; }

Target:
private void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertTrue ( model.isSparse ( ) ) ; org.junit.Assert.assertTrue ( model.isPropagateErrors ( ) ) ; }
Source:
protected void UpdateTasksWithActionParameters ( ) { for ( org.ovirt.engine.core.compat.Guid taskID : getReturnValue ( ) . getTaskIdList ( ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . UpdateTaskWithActionParameters ( taskID , getParameters ( ) ) ; } }

Target:
protected org.ovirt.engine.core.bll.SPMAsyncTask ConcreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parametersForTask = getParametersForTask ( parentCommand , getParameters ( ) ) ; org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , new org.ovirt.engine.core.common.businessentities.async_tasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getTaskID ( ) , parametersForTask , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) ) ) ; p.setEntityId ( getParameters ( ) . getEntityId ( ) ) ; return org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CreateTask ( getTaskType ( ) , p ) ; }
Source:
public static void GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
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.VDSGroup > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; }
Source:
public static void GetClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , 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.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }
Source:
public void succeedWhenProxyHostAvailable ( ) { org.mockito.Mockito.when ( proxyLocator.isProxyHostAvailable ( ) ) . thenReturn ( true ) ; java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isProxyHostAvailable ( new org.ovirt.engine.core.common.businessentities.VDS ( ) , messages ) ; org.junit.Assert.assertTrue ( result ) ; org.junit.Assert.assertTrue ( messages.isEmpty ( ) ) ; }

Target:
public void succeedWhenProxyHostAvailable ( ) { org.mockito.Mockito.when ( proxyLocator.isProxyHostAvailable ( ) ) . thenReturn ( true ) ; java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isProxyHostAvailable ( new org.ovirt.engine.core.common.businessentities.VDS ( ) , messages ) ; org.junit.jupiter.api.Assertions.assertTrue ( result ) ; org.junit.jupiter.api.Assertions.assertTrue ( messages.isEmpty ( ) ) ; }
Source:
public void testIsFieldsUpdated ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; boolean changed = oic.isFieldsUpdated ( jedi1 , jedi2 , java.util.Collections.singletonList ( "name" ) ) ; org.junit.Assert.assertFalse ( "No Change" , changed ) ; changed = oic.isFieldsUpdated ( jedi1 , jedi2 , java.util.Collections.singletonList ( "saberColor" ) ) ; org.junit.Assert.assertTrue ( "1 Change" , changed ) ; }

Target:
public void testIsFieldsUpdated ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; boolean changed = oic.isFieldsUpdated ( jedi1 , jedi2 , java.util.Collections.singletonList ( "name" ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( changed , "No Change" ) ; changed = oic.isFieldsUpdated ( jedi1 , jedi2 , java.util.Collections.singletonList ( "saberColor" ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( changed , "1 Change" ) ; }
Source:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.junit.Assert.assertThat ( validator.ipConfiguredForStaticBootProtocol ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkExistWhenOnlyNetworkIdIsSet ( ) { org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkId ( networkId ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( networkAttachment ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_HAVING_ID_NOT_EXISTS ; org.junit.Assert.assertThat ( validator.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , networkId.toString ( ) ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( getParameters ( ) . getStoragePoolId ( ) , memoryDisksList , getVmDisksDummies ( ) , getVm ( ) ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( getParameters ( ) . getStoragePoolId ( ) , memoryDisksList , getVmDisksDummies ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }
Source:
private boolean isVnicProfilePermitted ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.VnicProfile profile , boolean portMirroring ) { return ( portMirroring == ( profile.isPortMirroring ( ) ) ) && ( ( getPermissionDAO ( ) . getEntityPermissions ( userId , ActionGroup.CONFIGURE_VM_NETWORK , profile.getId ( ) , VdcObjectType.VnicProfile ) ) != null ) ; }

Target:
private boolean isVnicProfilePermitted ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.VnicProfile profile , boolean portMirroringRequired ) { return ( portMirroringRequired == ( profile.isPortMirroring ( ) ) ) && ( ( getPermissionDAO ( ) . getEntityPermissions ( userId , ActionGroup.CONFIGURE_VM_NETWORK , profile.getId ( ) , VdcObjectType.VnicProfile ) ) != null ) ; }
Source:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.bll.context.CommandContext cmdContext , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) , cmdContext ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.bll.context.CommandContext cmdContext , boolean enableCallback ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.common.businessentities.CommandEntity commandEntity = buildCommandEntity ( getParentParameters ( parentCommand ) . getCommandId ( ) , enableCallback ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.persistCommand ( commandEntity , cmdContext ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetVnicProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetVnicProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; verifyNotFoundException ( org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.resource.remove ( ) ) ) ; }
Source:
org.ovirt.engine.core.bll.ValidationResult labelBeingAttachedToNonVlanNonSlaveInterface ( org.ovirt.engine.core.common.businessentities.network.NicLabel nicLabel ) { java.lang.String interfaceName = nicLabel.getNicName ( ) ; boolean isBondSlave = shouldBeConfigureAsBondSlave ( interfaceName ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingNic = existingInterfacesMap.get ( interfaceName ) ; boolean isVlanDevice = ( existingNic == null ) ? false : org.ovirt.engine.core.utils.NetworkUtils.isVlan ( existingNic ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.LABEL_ATTACH_TO_IMPROPER_INTERFACE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "LABEL_ATTACH_TO_IMPROPER_INTERFACE_ENTITY" , interfaceName ) ) . when ( ( isBondSlave || isVlanDevice ) ) ; }

Target:
org.ovirt.engine.core.bll.ValidationResult labelBeingAttachedToNonVlanNonSlaveInterface ( org.ovirt.engine.core.common.businessentities.network.NicLabel nicLabel ) { java.lang.String interfaceName = nicLabel.getNicName ( ) ; boolean isBondSlave = shouldBeConfigureAsBondSlave ( interfaceName ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingNic = existingInterfacesMap.get ( interfaceName ) ; boolean isVlanDevice = ( existingNic == null ) ? false : org.ovirt.engine.core.common.utils.NetworkCommonUtils.isVlan ( existingNic ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.LABEL_ATTACH_TO_IMPROPER_INTERFACE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "LABEL_ATTACH_TO_IMPROPER_INTERFACE_ENTITY" , interfaceName ) ) . when ( ( isBondSlave || isVlanDevice ) ) ; }
Source:
protected boolean validate ( ) { boolean result = true ; if ( ( ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) == null ) || ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) . getOrigin ( ) . equalsIgnoreCase ( org.ovirt.engine.core.bll.AddExternalEventCommand.OVIRT ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; result = false ; } if ( ! result ) { addValidationMessage ( EngineMessage.VAR__ACTION__ADD ) ; addValidationMessage ( EngineMessage.VAR__TYPE__EXTERNAL_EVENT ) ; } return result ; }

Target:
protected boolean validate ( ) { if ( ( ( getEvent ( ) ) == null ) || ( AuditLog.OVIRT_ORIGIN.equalsIgnoreCase ( getEvent ( ) . getOrigin ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; } return true ; }
Source:
private void init ( ) { this . setIsAnimated ( TooltipConfig.IS_ANIMATED ) ; this . setPlacement ( TooltipConfig.PLACEMENT ) ; this . setIsHtml ( TooltipConfig.IS_HTML ) ; this . setTrigger ( TooltipConfig.TRIGGER ) ; this . setShowDelayMs ( TooltipConfig.SHOW_DELAY_MS ) ; this . setHideDelayMs ( TooltipConfig.HIDE_DELAY_MS ) ; this . setContainer ( TooltipConfig.CONTAINER ) ; }

Target:
public void onAttachOrDetach ( com.google.gwt.event.logical.shared.AttachEvent event ) { this . widgetAttached = event.isAttached ( ) ; scheduleTooltipUpdate ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc sendHcCmdToDesktop ( java.lang.String vmId , java.lang.String hcCommand ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.sendHcCmdToDesktop ( vmId , hcCommand ) ; 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 ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterHookUpdate ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName , java.lang.String content , java.lang.String checksum ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookUpdate ( glusterCommand , stage , hookName , content , checksum ) ; 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 void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( result.getState ( ) ) ; cancel ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; } } , this ) ; }
Source:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }

Target:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setPlugged ( plugged ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }