auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void removeSnapshots ( org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getSnapshotDao ( ) . getAll ( vmId ) ) { getSnapshotDao ( ) . remove ( snapshot.getId ( ) ) ; } }

Target:
public java.util.Set < java.lang.String > removeSnapshots ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.Set < java.lang.String > memoryVolumes = new java.util.HashSet < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getSnapshotDao ( ) . getAll ( vmId ) ) { memoryVolumes.add ( snapshot.getMemoryVolume ( ) ) ; getSnapshotDao ( ) . remove ( snapshot.getId ( ) ) ; } return memoryVolumes ; }
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
private static org.ovirt.engine.api.model.Display extractDisplayFromResource ( org.ovirt.engine.api.model.BaseResource res ) { if ( res instanceof org.ovirt.engine.api.model.VM ) { return ( ( org.ovirt.engine.api.model.VM ) ( res ) ) . getDisplay ( ) ; } if ( res instanceof org.ovirt.engine.api.model.Template ) { return ( ( org.ovirt.engine.api.model.Template ) ( res ) ) . getDisplay ( ) ; } return null ; }

Target:
private static org.ovirt.engine.api.model.Display extractDisplayFromResource ( org.ovirt.engine.api.model.BaseResource res ) { if ( res instanceof org.ovirt.engine.api.model.Vm ) { return ( ( org.ovirt.engine.api.model.Vm ) ( res ) ) . getDisplay ( ) ; } if ( res instanceof org.ovirt.engine.api.model.Template ) { return ( ( org.ovirt.engine.api.model.Template ) ( res ) ) . getDisplay ( ) ; } return null ; }
Source:
protected org.ovirt.engine.core.common.errors.EngineError getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.EngineError bllErrors = org.ovirt.engine.core.common.errors.EngineError.forValue ( xmlRpcStatus.code ) ; if ( bllErrors == null ) { log.warn ( "Unexpected return value: {}" , xmlRpcStatus ) ; bllErrors = org.ovirt.engine.core.common.errors.EngineError.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.EngineError.unexpected ; } }

Target:
protected org.ovirt.engine.core.common.errors.EngineError getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.Status status ) { try { org.ovirt.engine.core.common.errors.EngineError bllErrors = org.ovirt.engine.core.common.errors.EngineError.forValue ( status.code ) ; if ( bllErrors == null ) { log.warn ( "Unexpected return value: {}" , status ) ; bllErrors = org.ovirt.engine.core.common.errors.EngineError.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.EngineError.unexpected ; } }
Source:
private boolean isExceedMaxBlockDiskSize ( ) { org.ovirt.engine.core.common.businessentities.StorageType storageType = org.ovirt.engine.core.bll.AddDiskCommand.getStorageDomain ( ) . getStorageType ( ) ; boolean isBlockStorageDomain = ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ) || ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.FCP ) ) ; boolean isRequestedLargerThanMaxSize = ( getRequestDiskSpace ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxBlockDiskSize ) ) ; return isBlockStorageDomain && isRequestedLargerThanMaxSize ; }

Target:
private boolean isExceedMaxBlockDiskSize ( ) { if ( org.ovirt.engine.core.bll.AddDiskCommand.getStorageDomain ( ) . getStorageType ( ) . isBlockDomain ( ) ) { return ( getRequestDiskSpace ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxBlockDiskSize ) ) ; } return false ; }
Source:
protected void InitializeVds ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.RemoveVds , new org.ovirt.engine.core.common.vdscommands.RemoveVdsVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.AddVds , new org.ovirt.engine.core.common.vdscommands.AddVdsVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) ) ) ; }

Target:
protected void initializeVds ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.RemoveVds , new org.ovirt.engine.core.common.vdscommands.RemoveVdsVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.AddVds , new org.ovirt.engine.core.common.vdscommands.AddVdsVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters createParameters ( org.ovirt.engine.core.compat.Guid storageDomainId , java.util.List < org.ovirt.engine.api.model.LogicalUnit > newLuns ) { org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters params = new org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters ( ) ; params.setStorageDomainId ( storageDomainId ) ; java.util.ArrayList < java.lang.String > lunIds = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.api.model.LogicalUnit newLun : newLuns ) { lunIds.add ( newLun.getId ( ) ) ; } params.setLunIds ( lunIds ) ; return params ; }

Target:
private org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters createParameters ( org.ovirt.engine.core.compat.Guid storageDomainId , java.util.List < org.ovirt.engine.api.model.LogicalUnit > newLuns , boolean force ) { org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters params = new org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters ( ) ; params.setStorageDomainId ( storageDomainId ) ; java.util.ArrayList < java.lang.String > lunIds = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.api.model.LogicalUnit newLun : newLuns ) { lunIds.add ( newLun.getId ( ) ) ; } params.setLunIds ( lunIds ) ; params.setForce ( force ) ; return params ; }
Source:
public void getStorageDomainMaxNameLength ( 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 ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public 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 ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
protected void executeCommand ( ) { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( ! ( hasSnappableDisks ( vm ) ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( ! ( hasSnappableDisks ( vm ) ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }
Source:
public void OnSuccess ( org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult result ) { if ( ( ( result != null ) && ( ( result.getReturnValue ( ) ) != null ) ) && ( ( result.getReturnValue ( ) . getReturnValue ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( result.getReturnValue ( ) . getReturnValue ( ) ) ) ; java.lang.String message = fenceStatusReturnValue.toString ( ) ; setMessage ( message ) ; getTestCommand ( ) . setIsExecutionAllowed ( true ) ; } }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { UpdateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }
Source:
public void onSuccess ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > resultObject ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from runMultipleQueries!" ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , resultObject ) ; callback.executed ( f ) ; raiseQueryCompleteEvent ( queryTypeList , state ) ; }

Target:
public void onSuccess ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > resultObject ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from runMultipleQueries!" ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , resultObject ) ; callback.executed ( f ) ; fireAsyncOperationCompleteEvent ( state ) ; raiseQueryCompleteEvent ( queryTypeList , state ) ; }
Source:
public void testGetAllForStoragePoolWithPermissionsUnprivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAllForStoragePool ( org.ovirt.engine.core.dao.StorageDomainDaoTest.EXISTING_STORAGE_POOL_ID , org.ovirt.engine.core.dao.UNPRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }

Target:
public void testGetPermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getPermittedStorageDomainsByStoragePool ( FixturesTool.USER_EXISTING_ID , ActionGroup.CONFIGURE_VM_STORAGE , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) . getId ( ) , existingDomain.getId ( ) ) ; }
Source:
public org.ovirt.engine.sdk.decorators.VM update ( 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 ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.VM.class , org.ovirt.engine.sdk.decorators.VM.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VM update ( ) 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 ( ) . update ( url , this , org.ovirt.engine.sdk.entities.VM.class , org.ovirt.engine.sdk.decorators.VM.class , headers ) ; }
Source:
public void testGetDeviceListWithDeviceListAndLunsIds ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setId ( "lun1" ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setId ( "lun2" ) ; parameters.setDeviceList ( java.util.Arrays.asList ( lun1 , lun2 ) ) ; java.util.Set < java.lang.String > lunsIds = java.util.Collections.singleton ( "lun2" ) ; org.junit.Assert.assertEquals ( command.getDeviceList ( lunsIds ) , java.util.Collections.singletonList ( lun2 ) ) ; }

Target:
public void testGetDeviceListWithDeviceListAndLunsIds ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setId ( "lun1" ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setId ( "lun2" ) ; parameters.setDeviceList ( java.util.Arrays.asList ( lun1 , lun2 ) ) ; java.util.Set < java.lang.String > lunsIds = java.util.Collections.singleton ( "lun2" ) ; org.junit.jupiter.api.Assertions.assertEquals ( command.getDeviceList ( lunsIds ) , java.util.Collections.singletonList ( lun2 ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.Cluster , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( getEntity ( ) . getId ( ) ) ; params.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersAndNetworksByNetworkId , params , new org.ovirt.engine.ui.uicommonweb.models.networks.SetItemsAsyncQuery ( ) ) ; }
Source:
private java.lang.Integer integerOrNull ( java.lang.Object o ) { if ( o instanceof java.lang.Integer ) { return ( ( java.lang.Integer ) ( o ) ) ; } else if ( o instanceof java.lang.String ) { try { return java.lang.Integer.parseInt ( ( ( java.lang.String ) ( o ) ) ) ; } catch ( java.lang.Exception e ) { } } return null ; }

Target:
private java.lang.Integer integerOrNull ( java.lang.Object o ) { if ( o instanceof java.lang.Integer ) { return ( ( java.lang.Integer ) ( o ) ) ; } else if ( o instanceof java.lang.String ) { try { return java.lang.Integer.parseInt ( ( ( java.lang.String ) ( o ) ) ) ; } catch ( java.lang.Exception ignore ) { } } return null ; }
Source:
public void addToCallBackMap ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { if ( ! ( cmdCallBackMap.containsKey ( cmdEntity.getId ( ) ) ) ) { org.ovirt.engine.core.bll.CommandBase < ? > cmd = coco.retrieveCommand ( cmdEntity.getId ( ) ) ; if ( ( cmd != null ) && ( ( cmd.getCallBack ( ) ) != null ) ) { cmdCallBackMap.put ( cmdEntity.getId ( ) , cmd.getCallBack ( ) ) ; } } }

Target:
public void addToCallBackMap ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { if ( ! ( cmdCallBackMap.containsKey ( cmdEntity.getId ( ) ) ) ) { org.ovirt.engine.core.bll.CommandBase < ? > cmd = coco.retrieveCommand ( cmdEntity.getId ( ) ) ; if ( ( cmd != null ) && ( ( cmd.getCallback ( ) ) != null ) ) { cmdCallBackMap.put ( cmdEntity.getId ( ) , cmd.getCallback ( ) ) ; } } }
Source:
public void diskPluggedToVmsThatAreNotDownFail ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmsInfo = prepareForCheckingIfDiskPluggedToVmsThatAreNotDown ( ) ; vmsInfo.get ( 0 ) . getFirst ( ) . setStatus ( VMStatus.Up ) ; org.junit.Assert.assertThat ( validator.isDiskPluggedToVmsThatAreNotDown ( false , vmsInfo ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) ; }

Target:
public void diskPluggedToVmsThatAreNotDownFail ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmsInfo = prepareForCheckingIfDiskPluggedToVmsThatAreNotDown ( ) ; vmsInfo.get ( 0 ) . getFirst ( ) . setStatus ( VMStatus.Up ) ; org.junit.Assert.assertThat ( validator.isDiskPluggedToVmsThatAreNotDown ( false , vmsInfo ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult vmNotDuringMigration ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingTo ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult vmNotDuringMigration ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingTo ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( ( succeeded ? ( ( org.ovirt.engine.core.compat.Guid ) ( retVal.getActionReturnValue ( ) ) ) : null ) , succeeded ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { newModel.getName ( ) . setEntity ( getName ( ) . getEntity ( ) ) ; }
Source:
private void initListBoxEditors ( ) { volumeTypeEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelLabelEditor ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) , new org.ovirt.engine.ui.common.widget.parser.EntityModelParser ( ) ) ; serverEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( object ) ) . getHostName ( ) ; } } ) ; }

Target:
private void initEditors ( ) { volumeTypeEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelLabelEditor ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) , new org.ovirt.engine.ui.common.widget.parser.EntityModelParser ( ) ) ; forceEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; serverEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( object ) ) . getHostName ( ) ; } } ) ; }
Source:
public void canDoActionFailsOnSnapshotNotExists ( ) { org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( false ) ; junit.framework.Assert.assertFalse ( spyCommand.canDoAction ( ) ) ; junit.framework.Assert.assertTrue ( spyCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnSnapshotNotExists ( ) { org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( spyCommand.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( spyCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
private void updateSnapshotsFromExport ( ) { if ( ( getVm ( ) . getSnapshots ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshot.getId ( ) ) ) { getSnapshotDao ( ) . update ( snapshot ) ; } else { getSnapshotDao ( ) . save ( snapshot ) ; } } } }

Target:
protected void updateActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { getSnapshotDao ( ) . update ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE , "Active VM snapshot" , new java.util.Date ( ) , null ) ) ; }
Source:
public void testGetNextConfiguration ( ) throws java.lang.Exception { setUriInfo ( addMatrixParameterExpectations ( setUpBasicUriExpectations ( ) , BackendVmResource.NEXT_RUN ) ) ; setUpGetEntityNextRunExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }

Target:
public void testGetNextConfiguration ( ) throws java.lang.Exception { setUriInfo ( addMatrixParameterExpectations ( setUpBasicUriExpectations ( ) , BackendVmResource.NEXT_RUN ) ) ; setUpGetEntityNextRunExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }
Source:
private void initChildHierarchy ( ) { if ( ! ( childHierarchyInitialized ) ) { synchronized ( LOCK ) { if ( ! ( childHierarchyInitialized ) ) { childHierarchy.clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmd : getCommandsWithCallBackEnabled ( ) ) { buildCmdHierarchy ( cmd ) ; } } childHierarchyInitialized = true ; } } }

Target:
private void initChildHierarchy ( ) { if ( ! ( childHierarchyInitialized ) ) { synchronized ( LOCK ) { if ( ! ( childHierarchyInitialized ) ) { childHierarchy.clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmd : getCommandsWithCallbackEnabled ( ) ) { buildCmdHierarchy ( cmd ) ; } } childHierarchyInitialized = true ; } } }
Source:
public static java.lang.Long determineImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.Image sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid srcDomain , org.ovirt.engine.core.compat.Guid dstDomain , org.ovirt.engine.core.compat.Guid imageGroupID ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage imageInfoFromStorage = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getVolumeInfoFromVdsm ( storagePoolId , srcDomain , imageGroupID , sourceImage.getId ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( imageInfoFromStorage.getActualSizeInBytes ( ) ) ; } return null ; }

Target:
public static java.lang.Long determineImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.Image sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid srcDomain , org.ovirt.engine.core.compat.Guid dstDomain , org.ovirt.engine.core.compat.Guid imageGroupID ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage imageInfoFromStorage = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getVolumeInfoFromVdsm ( storagePoolId , srcDomain , imageGroupID , sourceImage.getId ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , imageInfoFromStorage.getActualSizeInBytes ( ) ) ; } return null ; }
Source:
private void addLinksIncludingUser ( org.ovirt.engine.api.model.Session session ) { java.lang.String domainName = session.getUser ( ) . getDomain ( ) . getName ( ) ; addLinks ( session , org.ovirt.engine.core.common.businessentities.VM.class ) ; session.getUser ( ) . setDomain ( new org.ovirt.engine.api.model.Domain ( ) ) ; session.getUser ( ) . getDomain ( ) . setName ( domainName ) ; setSessionUser ( session ) ; }

Target:
private void addLinksIncludingUser ( org.ovirt.engine.api.model.Session session ) { java.lang.String domainName = session.getUser ( ) . getDomain ( ) . getName ( ) ; addLinks ( session , org.ovirt.engine.api.model.Vm.class ) ; session.getUser ( ) . setDomain ( new org.ovirt.engine.api.model.Domain ( ) ) ; session.getUser ( ) . getDomain ( ) . setName ( domainName ) ; setSessionUser ( session ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand , java.lang.Object ... params ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand command = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand ) ( uiCommand ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 = command.getOp1 ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 = command.getOp2 ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = command.getAllNics ( ) ; ExecuteNetworkCommand ( op1 , op2 , allNics , params ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand , java.lang.Object ... params ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand command = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand ) ( uiCommand ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 = command.getOp1 ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 = command.getOp2 ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = command.getAllNics ( ) ; executeNetworkCommand ( op1 , op2 , allNics , params ) ; }
Source:
private static void addSoundCard ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Version vdsGroupCompatibilityVersion ) { java.lang.String soundDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.getSoundDevice ( vmBase.getOsId ( ) , vdsGroupCompatibilityVersion ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) , VmDeviceGeneralType.SOUND , org.ovirt.engine.core.common.utils.VmDeviceType.getSoundDeviceType ( soundDevice ) , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , true , null ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addSoundDevice ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSoundDevice ( vmBase.getId ( ) , vmBase.getOsId ( ) , org.ovirt.engine.core.bll.utils.ClusterUtils.getCompatibilityVersion ( vmBase ) ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpChangeCdUriQueryExpectations ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; javax.ws.rs.core.MultivaluedMap < java.lang.String , java.lang.String > queries = control.createMock ( javax.ws.rs.core.MultivaluedMap.class ) ; org.easymock.EasyMock.expect ( queries.containsKey ( "current" ) ) . andReturn ( true ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( queries.getFirst ( "current" ) ) . andReturn ( "true" ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( uriInfo.getQueryParameters ( ) ) . andReturn ( queries ) . anyTimes ( ) ; return uriInfo ; }

Target:
protected javax.ws.rs.core.UriInfo setUpChangeCdUriQueryExpectations ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; javax.ws.rs.core.MultivaluedMap < java.lang.String , java.lang.String > queries = org.mockito.Mockito.mock ( javax.ws.rs.core.MultivaluedMap.class ) ; org.mockito.Mockito.when ( queries.containsKey ( "current" ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( queries.getFirst ( "current" ) ) . thenReturn ( "true" ) ; org.mockito.Mockito.when ( uriInfo.getQueryParameters ( ) ) . thenReturn ( queries ) ; return uriInfo ; }
Source:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; queryReturnValue.setReturnValue ( returnValue ) ; org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.ArgumentMatchers.eq ( queryType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( queryReturnValue ) ; }

Target:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; queryReturnValue.setReturnValue ( returnValue ) ; org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.ArgumentMatchers.eq ( queryType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.QueryParametersBase.class ) ) ) . thenReturn ( queryReturnValue ) ; }
Source:
public void reuseSession ( ) { if ( ( getSessionId ( ) ) != null ) { processSessionId ( getSessionId ( ) ) ; } else { getSessionId ( new org.ovirt.engine.ui.frontend.communication.StorageCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { if ( result != null ) { restApiSessionId = result ; processSessionId ( result ) ; } else { processSessionIdException ( ) ; } } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { processSessionIdException ( ) ; } } ) ; } }

Target:
public void reuseSession ( ) { if ( ( restApiSessionId ) != null ) { processSessionId ( restApiSessionId ) ; } else { getSessionIdFromHttpSession ( new org.ovirt.engine.ui.frontend.communication.StorageCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { if ( result != null ) { setSessionId ( result , false ) ; processSessionId ( result ) ; } else { processSessionIdException ( ) ; } } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { processSessionIdException ( ) ; } } ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( model.getSpecificStorageQuota ( ) . getEntity ( ) ) ) ) { quotaStorageTable.insertColumn ( 0 , isStorageInQuotaColumn ) ; quotaStorageTable.setColumnWidth ( isStorageInQuotaColumn , "30px" ) ; quotaStorageTable.edit ( model.getAllDataCenterStorages ( ) ) ; } else { quotaStorageTable.removeColumn ( isStorageInQuotaColumn ) ; quotaStorageTable.edit ( model.getQuotaStorages ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( model.getSpecificStorageQuota ( ) . getEntity ( ) ) ) ) { quotaStorageTable.insertColumn ( 0 , isStorageInQuotaColumn ) ; quotaStorageTable.setColumnWidth ( isStorageInQuotaColumn , "30px" ) ; quotaStorageTable.asEditor ( ) . edit ( model.getAllDataCenterStorages ( ) ) ; } else { quotaStorageTable.removeColumn ( isStorageInQuotaColumn ) ; quotaStorageTable.asEditor ( ) . edit ( model.getQuotaStorages ( ) ) ; } }
Source:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetCustomPropertiesList ( 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.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain populate ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.core.common.businessentities.storage_domains entity ) { if ( StorageDomainSharedStatus.Unattached.equals ( entity.getstorage_domain_shared_status ( ) ) ) { model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( StorageDomainStatus.UNATTACHED ) ) ; } else { model.setStatus ( null ) ; } return super . populate ( model , entity ) ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain deprecatedPopulate ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.core.common.businessentities.storage_domains entity ) { if ( StorageDomainSharedStatus.Unattached.equals ( entity.getstorage_domain_shared_status ( ) ) ) { model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( StorageDomainStatus.UNATTACHED ) ) ; } else { model.setStatus ( null ) ; } return super . deprecatedPopulate ( model , entity ) ; }
Source:
public java.util.Set < java.lang.String > getConsumedEvents ( ) { java.util.Set < java.lang.String > set = new java.util.HashSet ( super . getConsumedEvents ( ) ) ; set.add ( BrowserEvents.CLICK ) ; set.add ( BrowserEvents.MOUSEMOVE ) ; set.add ( BrowserEvents.CHANGE ) ; return set ; }

Target:
public java.util.Set < java.lang.String > getConsumedEvents ( ) { java.util.Set < java.lang.String > set = new java.util.HashSet ( super . getConsumedEvents ( ) ) ; set.add ( BrowserEvents.CLICK ) ; set.add ( BrowserEvents.MOUSEMOVE ) ; set.add ( BrowserEvents.CHANGE ) ; set.add ( BrowserEvents.MOUSEDOWN ) ; return set ; }
Source:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void prepareVmToPassCanDoAction ( ) { vmStatic.setName ( "vm1" ) ; vmStatic.setMemSizeMb ( 256 ) ; vmStatic.setSingleQxlPci ( false ) ; mockVmDaoGetVm ( ) ; mockSameNameQuery ( false ) ; mockValidateCustomProperties ( ) ; mockValidatePciAndIdeLimit ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; mockGraphicsDevice ( ) ; }

Target:
private void prepareVmToPassValidate ( ) { vmStatic.setName ( "vm1" ) ; vmStatic.setMemSizeMb ( 256 ) ; vmStatic.setSingleQxlPci ( false ) ; mockVmDaoGetVm ( ) ; mockSameNameQuery ( false ) ; mockValidateCustomProperties ( ) ; mockValidatePciAndIdeLimit ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; mockGraphicsDevice ( ) ; }
Source:
public void testQueryWithFilter ( ) { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < > ( ) ; filterValue.add ( "true" ) ; org.mockito.Mockito.reset ( httpHeaders ) ; org.mockito.Mockito.when ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . thenReturn ( filterValue ) ; resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; resource.get ( ) ; }

Target:
public void testQueryWithFilter ( ) { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < > ( ) ; filterValue.add ( "true" ) ; org.mockito.Mockito.reset ( httpHeaders ) ; org.mockito.Mockito.when ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . thenReturn ( filterValue ) ; resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> resource.get ( ) ) ; }
Source:
public void getStorageDomainMaxNameLength ( 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 ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public void testGetVolumesByOption ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByOption ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_KEY_NFS_DISABLE , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_VALUE_OFF ) ; org.junit.Assert.assertNotNull ( volumes ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingReplVol ) ) ; org.junit.Assert.assertTrue ( volumes.get ( 0 ) . isNfsEnabled ( ) ) ; }

Target:
public void testGetVolumesByOption ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByOption ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_KEY_NFS_DISABLE , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_VALUE_OFF ) ; org.junit.jupiter.api.Assertions.assertNotNull ( volumes ) ; org.junit.jupiter.api.Assertions.assertTrue ( volumes.contains ( existingReplVol ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( volumes.get ( 0 ) . isNfsEnabled ( ) ) ; }
Source:
public int compareTo ( ovirt_engine_dwh.configurationsync_3_2.ConfigurationSync.delete_vm_device_connectionStruct other ) { int returnValue = - 1 ; return returnValue ; }

Target:
public void copyDataTo ( ovirt_engine_dwh.configurationsync_3_2.ConfigurationSync.delete_vm_device_connectionStruct other ) { other.vm_id = this . vm_id ; other.device_id = this . device_id ; other.type = this . type ; other.address = this . address ; other.is_managed = this . is_managed ; other.is_plugged = this . is_plugged ; other.is_readonly = this . is_readonly ; other.vm_configuration_version = this . vm_configuration_version ; other.device_configuration_version = this . device_configuration_version ; other.create_date = this . create_date ; other.update_date = this . update_date ; other.delete_date = this . delete_date ; }
Source:
private void init ( ) { int autoStartVmsRunnerIntervalInSeconds = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AutoStartVmsRunnerIntervalInSeconds ) ; schedulerUtil.scheduleAFixedDelayJob ( this , "startFailedAutoStartVms" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , autoStartVmsRunnerIntervalInSeconds , autoStartVmsRunnerIntervalInSeconds , java.util.concurrent.TimeUnit.SECONDS ) ; }

Target:
private void init ( ) { initAutoStartVmsToRestart ( ) ; int autoStartVmsRunnerIntervalInSeconds = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AutoStartVmsRunnerIntervalInSeconds ) ; schedulerUtil.scheduleAFixedDelayJob ( this , "startFailedAutoStartVms" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , autoStartVmsRunnerIntervalInSeconds , autoStartVmsRunnerIntervalInSeconds , java.util.concurrent.TimeUnit.SECONDS ) ; }