auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , 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 ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
protected void processImages ( ) { processImages ( ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.isImagesAlreadyOnTarget ( ) ) ) ) ; if ( org.ovirt.engine.core.bll.ImportVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } }

Target:
protected void moveOrCopyAllImageGroups ( ) { moveOrCopyAllImageGroups ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) , false , false , true ) ) ; copyAllMemoryImages ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getId ( ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { com.google.gwt.safehtml.shared.SafeHtml separatorImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( imageResources.separator ( ) ) . getHTML ( ) ) ; sb.append ( separatorImageHtml ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( isVisible ( value ) ) { com.google.gwt.safehtml.shared.SafeHtml separatorImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( imageResources.separator ( ) ) . getHTML ( ) ) ; sb.append ( separatorImageHtml ) ; } }
Source:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StoragePoolUnknown : case SpmStatusError : break ; case TaskInProgress : org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) . mMessage ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StoragePoolUnknown : case SpmStatusError : break ; case TaskInProgress : org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) . mMessage ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }
Source:
protected final boolean failCanDoAction ( org.ovirt.engine.core.dal.VdcBllMessages message ) { addCanDoActionMessage ( message ) ; return false ; }

Target:
private void clearAsyncTasksWithOutVdsmId ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = org.ovirt.engine.core.bll.CommandBase.getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.failTaskWithoutVdsmId ( task ) ; } } }
Source:
protected final void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmId ( ) ) != null ) { setVmId ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmId ( ) ) ; } else { setVm ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVm ( ) ) ; } if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) ) != null ) { setVmNumaNodesForValidation ( getVmNumaNodeDao ( ) . getAllVmNumaNodeByVmId ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getId ( ) ) ) ; doInit ( ) ; } }

Target:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( validate ( getNumaValidator ( ) . checkVmNumaIndexDuplicates ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmNumaNodeList ( ) ) ) ) ) { return false ; } return validate ( getNumaValidator ( ) . checkVmNumaNodesIntegrity ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) , getVmNumaNodesForValidation ( ) ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.CommandEntity getCommandEntity ( org.ovirt.engine.core.bll.tasks.interfaces.CommandCoordinator coco , org.ovirt.engine.core.compat.Guid cmdId ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( cmdId ) ; if ( cmdEntity == null ) { cmdEntity = coco.createCommandEntity ( cmdId , VdcActionType.Unknown , new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) ) ; } return cmdEntity ; }

Target:
private static org.ovirt.engine.core.common.businessentities.CommandEntity getCommandEntity ( org.ovirt.engine.core.bll.tasks.interfaces.CommandCoordinator coco , org.ovirt.engine.core.compat.Guid cmdId ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( cmdId ) ; if ( cmdEntity == null ) { cmdEntity = coco.createCommandEntity ( cmdId , ActionType.Unknown , new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) ) ; } return cmdEntity ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.AlignmentScanReturn getDiskAlignment ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > driveSpecs ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getDiskAlignment" ) . withParameter ( "vmID" , vmId ) . withParameter ( "disk" , driveSpecs ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "alignment" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.AlignmentScanReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterVolumeResetBrickCommitForce ( java.lang.String volumeName , java.lang.String existingBrickDir ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.resetBrickCommitForce" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "existingBrick" , existingBrickDir ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturn changeFloppy ( java.lang.String vmId , java.lang.String imageLocation ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.changeFloppy" ) . withParameter ( "vmID" , vmId ) . withParameter ( "driveSpec" , imageLocation ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn sealDisks ( java.lang.String templateId , java.lang.String jobId , java.lang.String storagePoolId , java.util.List < java.util.Map < java.lang.String , java.lang.Object > > images ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.seal" ) . withParameter ( "vmID" , templateId ) . withParameter ( "job_id" , jobId ) . withParameter ( "sp_id" , storagePoolId ) . withOptionalParameterAsList ( "images" , images ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; postGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; vmListModel.postGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }
Source:
private void fetchImageTemplates ( ) { if ( ( imageTemplates ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > allImages = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) ) ; imageTemplates = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( allImages , false , false , true ) ; imageTemplates.addAll ( org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( allImages , true ) ) ; } }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getImageTemplates ( ) { if ( ( imageTemplates ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > allImages = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) ) ; imageTemplates = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( allImages , false , false , true ) ; imageTemplates.addAll ( org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( allImages , true ) ) ; } return imageTemplates ; }
Source:
protected boolean acquireLock ( ) { org.ovirt.engine.core.bll.LockIdNameAttribute annotation = getClass ( ) . getAnnotation ( org.ovirt.engine.core.bll.LockIdNameAttribute.class ) ; boolean returnValue = true ; if ( annotation != null ) { releaseLocksAtEndOfExecute = annotation.isReleaseAtEndOfExecute ( ) ; if ( ! ( annotation.isWait ( ) ) ) { returnValue = acquireLockInternal ( ) ; } else { acquireLockAndWait ( ) ; } } return returnValue ; }

Target:
protected org.ovirt.engine.core.common.action.LockProperties getLockProperties ( ) { org.ovirt.engine.core.common.action.LockProperties lockProperties = _parameters.getLockProperties ( ) ; if ( lockProperties == null ) { lockProperties = applyLockProperties ( getLockingPropertiesSettings ( ) ) ; _parameters.setLockProperties ( lockProperties ) ; } return lockProperties ; }
Source:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.Watchdog > collection ) throws java.lang.Exception { assertNotNull ( collection ) ; assertEquals ( 1 , collection.size ( ) ) ; if ( ! ( collection.isEmpty ( ) ) ) { verifyModel ( collection.get ( 0 ) ) ; } }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.Watchdog > collection ) throws java.lang.Exception { org.junit.Assert.assertNotNull ( collection ) ; org.junit.Assert.assertEquals ( 1 , collection.size ( ) ) ; if ( ! ( collection.isEmpty ( ) ) ) { verifyModel ( collection.get ( 0 ) ) ; } }
Source:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getAttachedTagsToVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTagsByVmId , new org.ovirt.engine.core.common.queries.GetTagsByVmIdParameters ( id.toString ( ) ) , aQuery ) ; }
Source:
public void testPayloadMapToVmPaylod ( ) { org.ovirt.engine.api.model.Payload payload = new org.ovirt.engine.api.model.Payload ( ) ; payload.setType ( "CDROM" ) ; payload.setVolumeId ( "CD-VOL" ) ; org.ovirt.engine.core.common.businessentities.VmPayload vmPayload = org.ovirt.engine.api.restapi.types.VmMapper.map ( payload , null ) ; assertEquals ( payload.getType ( ) , vmPayload.getType ( ) . name ( ) ) ; assertEquals ( payload.getVolumeId ( ) , vmPayload.getVolumeId ( ) ) ; }

Target:
public void testVmPayloadMapToPaylod ( ) { org.ovirt.engine.core.common.businessentities.VmPayload vmPayload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; vmPayload.setDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType.CDROM ) ; vmPayload.setVolumeId ( "CD-VOL" ) ; org.ovirt.engine.api.model.Payload payload = org.ovirt.engine.api.restapi.types.VmMapper.map ( vmPayload , null ) ; assertEquals ( vmPayload.getDeviceType ( ) . name ( ) . toLowerCase ( ) , payload.getType ( ) ) ; assertEquals ( vmPayload.getVolumeId ( ) , payload.getVolumeId ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mapToVM ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.core.common.businessentities.VmTemplate template ) { org.ovirt.engine.core.common.businessentities.VM vm = getMapper ( org.ovirt.engine.api.model.VmPool.class , org.ovirt.engine.core.common.businessentities.VM.class ) . map ( model , null ) ; vm.getStaticData ( ) . setmem_size_mb ( template.getmem_size_mb ( ) ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mapToVM ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.core.common.businessentities.VmTemplate template ) { org.ovirt.engine.core.common.businessentities.VM vm = getMapper ( org.ovirt.engine.api.model.VmPool.class , org.ovirt.engine.core.common.businessentities.VM.class ) . map ( model , null ) ; vm.getStaticData ( ) . setMemSizeMb ( template.getMemSizeMb ( ) ) ; return vm ; }
Source:
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 ) { if ( glusterStorageModel.getLinkGlusterVolume ( ) . getEntity ( ) ) { glusterVolumesEditor.setVisible ( true ) ; pathEditor.setVisible ( false ) ; } else { glusterVolumesEditor.setVisible ( false ) ; pathEditor.setVisible ( true ) ; } }

Target:
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 ) { boolean showEditor = ! ( glusterStorageModel.getLinkGlusterVolume ( ) . getEntity ( ) ) ; pathEditorRow.setVisible ( showEditor ) ; pathExampleLabel.setVisible ( showEditor ) ; glusterVolumesRow.setVisible ( ( ! showEditor ) ) ; }
Source:
private boolean validateCanUpdateReadOnly ( ) { if ( ( shouldUpdateReadOnly ( ) ) && ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return true ; }

Target:
private boolean validateCanUpdateReadOnly ( ) { if ( ( ( shouldUpdateReadOnly ( ) ) && ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return true ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { _defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { _defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }
Source:
public void testTypedString ( ) throws java.lang.Exception { java.io.File file = writeConf ( "a=b" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; junit.framework.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; junit.framework.Assert.assertNotNull ( view ) ; junit.framework.Assert.assertEquals ( "b" , view.getA ( ) ) ; }

Target:
public void testTypedString ( ) throws java.lang.Exception { java.io.File file = writeConf ( "a=b" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.Assert.assertNotNull ( view ) ; org.junit.Assert.assertEquals ( "b" , view.getA ( ) ) ; }
Source:
public static java.lang.String getIpAddress ( ) { final java.lang.String ip = ( ( "10.34." + ( org.ovirt.vdsmfake.Utils.getRandIntegerAsString ( 1 , 253 ) ) ) + "." ) + ( org.ovirt.vdsmfake.Utils.getRandIntegerAsString ( 1 , 253 ) ) ; return ip ; }

Target:
public static java.lang.String ipGenerator ( ) { return ( ( ( ( ( ( org.ovirt.vdsmfake.Utils.RND.nextInt ( 256 ) ) + "." ) + ( org.ovirt.vdsmfake.Utils.RND.nextInt ( 256 ) ) ) + "." ) + ( org.ovirt.vdsmfake.Utils.RND.nextInt ( 256 ) ) ) + "." ) + ( org.ovirt.vdsmfake.Utils.RND.nextInt ( 256 ) ) ; }
Source:
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 ) { lockInteractionManager.hideLoadingIndicator ( ) ; formatAndSetErrorMessage ( loginModel.getMessage ( ) ) ; org.ovirt.engine.ui.common.presenter.AbstractLoginPresenterWidget.logger.warning ( ( ( "Login failed for user [" + ( loginModel.getUserName ( ) . getEntity ( ) ) ) + "]" ) ) ; }

Target:
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 ) { lockInteractionManager.hideLoadingIndicator ( ) ; formatAndSetErrorMessage ( loginModel.getMessages ( ) ) ; org.ovirt.engine.ui.common.presenter.AbstractLoginPresenterWidget.logger.warning ( ( ( "Login failed for user [" + ( loginModel.getUserName ( ) . getEntity ( ) ) ) + "]" ) ) ; }
Source:
public void testMissingListSubFields ( ) throws java.lang.Exception { org.ovirt.engine.api.model.HostNIC bond = new org.ovirt.engine.api.model.HostNIC ( ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( bond , "name" , "network.id|name" , "bonding.slaves.id|name" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostNIC" , "name, network.id|name, bonding.slaves.id|name" ) ; } }

Target:
public void testMissingListSubFields ( ) throws java.lang.Exception { org.ovirt.engine.api.model.HostNic bond = new org.ovirt.engine.api.model.HostNic ( ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( bond , "name" , "network.id|name" , "bonding.slaves.id|name" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostNic" , "name, network.id|name, bonding.slaves.id|name" ) ; } }
Source:
private boolean updateFloppyListFromVDSM ( org.ovirt.engine.core.compat.Guid repoStoragePoolId , org.ovirt.engine.core.compat.Guid repoStorageDomainId ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue fileStats = getFileStats ( repoStoragePoolId , repoStorageDomainId , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FLOPPY_FILE_PATTERN , VDSCommandType.GetFloppyList ) ; return refreshVdsmFileList ( repoStoragePoolId , repoStorageDomainId , null , ImageFileType.Floppy , fileStatsFromVDSReturnValue ( fileStats ) ) ; }

Target:
private boolean updateIsoListFromVDSM ( org.ovirt.engine.core.compat.Guid repoStoragePoolId , org.ovirt.engine.core.compat.Guid repoStorageDomainId , java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > fileStats ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed fileListRefreshed = new org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed ( ) { @ java.lang.Override public void onFileListRefreshed ( org.ovirt.engine.core.compat.Guid poolId , java.util.Set < java.lang.String > isoList ) { org.ovirt.engine.core.bll.VmHandler.refreshVmsToolsVersion ( poolId , isoList ) ; } } ; return refreshVdsmFileList ( repoStoragePoolId , repoStorageDomainId , ImageFileType.ISO , fileStats , fileListRefreshed ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockVMDAO ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_1 ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockVMDAO ( vm ) ; return vm ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult hostStatusLegalForSetupNetworks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSStatus > supportedStatuses = java.util.Arrays.asList ( VDSStatus.Maintenance , VDSStatus.Up , VDSStatus.NonOperational ) ; boolean hostStatusLegalForSetupNetworks = ( supportedStatuses.contains ( host.getStatus ( ) ) ) || ( ( ( host.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Installing ) ) && ( internalExecution ) ) ; if ( ! hostStatusLegalForSetupNetworks ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , host.getName ( ) , host.getStatus ( ) . name ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult hostStatusLegalForSetupNetworks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSStatus > supportedStatuses = java.util.Arrays.asList ( VDSStatus.Maintenance , VDSStatus.Up , VDSStatus.NonOperational ) ; boolean hostStatusLegalForSetupNetworks = ( supportedStatuses.contains ( host.getStatus ( ) ) ) || ( ( ( host.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Installing ) ) && ( internalExecution ) ) ; if ( ! hostStatusLegalForSetupNetworks ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , host.getName ( ) , host.getStatus ( ) . name ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void initEditors ( ) { volumeTypeEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( ) ) ; forceEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; serverEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.VDS > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.common.businessentities.VDS > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return vds.getHostName ( ) ; } } ) ; }

Target:
private void initEditors ( ) { volumeTypeEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( ) ) ; forceEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; showBricksListEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; serverEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.VDS > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.common.businessentities.VDS > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return vds.getHostName ( ) ; } } ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult hasSpaceForAllDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > newDiskImages , java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > clonedDiskImages ) { double availableSize = storageDomain.getAvailableDiskSizeInBytes ( ) ; double totalSizeForNewDisks = getTotalSizeForNewDisks ( newDiskImages ) ; double totalSizeForClonedDisks = getTotalSizeForClonedDisks ( clonedDiskImages ) ; double totalSizeForDisks = totalSizeForNewDisks + totalSizeForClonedDisks ; return validateRequiredSpace ( availableSize , totalSizeForDisks ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hasSpaceForAllDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > newDiskImages , java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > clonedDiskImages ) { java.lang.Long availableSize = storageDomain.getAvailableDiskSizeInBytes ( ) ; double totalSizeForNewDisks = getTotalSizeForNewDisks ( newDiskImages ) ; double totalSizeForClonedDisks = getTotalSizeForClonedDisks ( clonedDiskImages ) ; double totalSizeForDisks = totalSizeForNewDisks + totalSizeForClonedDisks ; return validateRequiredSpace ( availableSize , totalSizeForDisks ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "IsAvailable" . equals ( pcArgs.PropertyName ) ) { boolean isAvailable = modelProvider.getModel ( ) . getIsAvailable ( ) ; setAccessible ( isAvailable ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "IsAvailable" . equals ( pcArgs.propertyName ) ) { boolean isAvailable = modelProvider.getModel ( ) . getIsAvailable ( ) ; setAccessible ( isAvailable ) ; } }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( emptyParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getRemovedNetworkAttachments ( ) ) == null ) { parameters.setRemovedNetworkAttachments ( new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ) ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { parameters.getRemovedNetworkAttachments ( ) . add ( networkAttachment.getId ( ) ) ; } return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( nullParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getRemovedNetworkAttachments ( ) ) == null ) { parameters.setRemovedNetworkAttachments ( new java.util.HashSet < > ( ) ) ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { parameters.getRemovedNetworkAttachments ( ) . add ( networkAttachment.getId ( ) ) ; } return this ; }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , 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 ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static 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 ) , aQuery ) ; }
Source:
public void validateNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void validateNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initVmForSpace ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
private void SetIsExpandedRecursively ( boolean value , org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel root ) { root.setIsExpanded ( value ) ; for ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel model : root.getChildren ( ) ) { SetIsExpandedRecursively ( value , model ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getResetCommand ( ) ) ) { reset ( ) ; } else if ( command == ( getExpandAllCommand ( ) ) ) { expandAll ( ) ; } else if ( command == ( getCollapseAllCommand ( ) ) ) { collapseAll ( ) ; } }
Source:
public java.sql.Connection getConnection ( ) throws java.sql.SQLException { try { checkConnection ( ) ; } catch ( java.sql.SQLException exception ) { org.ovirt.engine.core.tools.common.db.StandaloneDataSource.log.warn ( "Can't check the connection, will close it and open a new one." , exception ) ; closeConnection ( ) ; openConnection ( ) ; } return wrapper ; }

Target:
public java.sql.Connection getConnection ( ) throws java.sql.SQLException { try { if ( ( connection ) == null ) { openConnection ( ) ; } checkConnection ( ) ; } catch ( java.sql.SQLException exception ) { org.ovirt.engine.core.tools.common.db.StandaloneDataSource.log.warn ( "Can't check the connection, will close it and open a new one." , exception ) ; closeConnection ( ) ; openConnection ( ) ; } return wrapper ; }
Source:
private void IsAutoAssign_EntityChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getIsAutoAssign ( ) . getEntity ( ) ) ) == true ) { getRunVMOnSpecificHost ( ) . setEntity ( false ) ; getRunVMOnSpecificHost ( ) . setIsChangable ( false ) ; } else { getRunVMOnSpecificHost ( ) . setIsChangable ( true ) ; } }

Target:
private void IsAutoAssign_EntityChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getIsAutoAssign ( ) . getEntity ( ) ) ) == true ) { clearAndDisable ( getRunVMOnSpecificHost ( ) ) ; clearAndDisable ( getHostCpu ( ) ) ; } else { getRunVMOnSpecificHost ( ) . setIsChangable ( true ) ; } }
Source:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }

Target:
public void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsNonEmptyCollectionConverter ( ) ; getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }
Source:
public static void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.compat.Version clusterVersion ) { if ( org.ovirt.engine.core.common.FeatureSupported.antiMacSpoofing ( clusterVersion ) ) { struct.put ( VdsProperties.NW_FILTER , NetworkFilters.NO_MAC_SPOOFING.getFilterName ( ) ) ; } }

Target:
public static void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.compat.Version clusterVersion ) { if ( ( org.ovirt.engine.core.common.FeatureSupported.antiMacSpoofing ( clusterVersion ) ) && ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableMACAntiSpoofingFilterRules ) ) ) { struct.put ( VdsProperties.NW_FILTER , NetworkFilters.NO_MAC_SPOOFING.getFilterName ( ) ) ; } }
Source:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.addCpuProfileCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( 1 , permissions.size ( ) ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CLUSTER_ID , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.Cluster , permissionSubject.getObjectType ( ) ) ; }

Target:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = addCpuProfileCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( 1 , permissions.size ( ) ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CLUSTER_ID , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.Cluster , permissionSubject.getObjectType ( ) ) ; }
Source:
public void testSyncWhenNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( true , 0 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . save ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }

Target:
public void testDiscoverGeoRepData ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( true , 2 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . save ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }
Source:
protected void runningFailed ( ) { try { decreasePendingVms ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }

Target:
protected void runningFailed ( ) { try { decreasePendingVms ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.RunVmCommandBase.setCommandShouldBeLogged ( false ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
public void testGetEntityNameByIdAndTypeForVM ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = dbFacade.getVmStaticDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_ID ) ; org.junit.Assert.assertNotNull ( vmStatic ) ; java.lang.String name = vmStatic.getvm_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_STATIC_GUID , VdcObjectType.VM ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForVM ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = dbFacade.getVmStaticDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_ID ) ; org.junit.Assert.assertNotNull ( vmStatic ) ; java.lang.String name = vmStatic.getVmName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_STATIC_GUID , VdcObjectType.VM ) ) ) ; }
Source:
protected void log ( ) { final javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { try { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this ) ; } catch ( final java.lang.RuntimeException ex ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.error ( "Error during log command: {}. Exception {}" , getClass ( ) . getName ( ) , ex.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.debug ( "Exception" , ex ) ; } } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
protected void log ( ) { final javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { try { auditLogDirector.log ( this ) ; } catch ( final java.lang.RuntimeException ex ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.error ( "Error during log command: {}. Exception {}" , getClass ( ) . getName ( ) , ex.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.debug ( "Exception" , ex ) ; } } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }
Source:
public void shouldMigrateMoreThanOneHost ( ) { affinityGroups.add ( createAffinityGroup ( vdsGroup , true , vm1 , vm2 , vm3 , vm4 , vm5 , vm6 ) ) ; org.junit.Assert.assertEquals ( vm4 , enforcer.chooseNextVmToMigrate ( vdsGroup ) ) ; vm4.setRunOnVds ( host1.getId ( ) ) ; org.junit.Assert.assertTrue ( java.util.Arrays.asList ( vm5 , vm6 ) . contains ( enforcer.chooseNextVmToMigrate ( vdsGroup ) ) ) ; }

Target:
public void shouldMigrateMoreThanOneHost ( ) { affinityGroups.add ( createAffinityGroup ( vdsGroup , true , vm1 , vm2 , vm3 , vm4 , vm5 , vm6 ) ) ; org.assertj.core.api.Assertions.assertThat ( enforcer.chooseNextVmToMigrate ( vdsGroup ) ) . isEqualTo ( vm4 ) ; vm4.setRunOnVds ( host1.getId ( ) ) ; org.assertj.core.api.Assertions.assertThat ( enforcer.chooseNextVmToMigrate ( vdsGroup ) ) . isIn ( vm5 , vm6 ) ; }
Source:
protected boolean isSourceAndDestTheSame ( ) { if ( ( ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) && ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getSourceDomainId ( ) . equals ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; } return true ; }

Target:
protected boolean isSourceAndDestTheSame ( ) { if ( ( ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) && ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getSourceDomainId ( ) . equals ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; } return true ; }