auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase removeCinderDisk ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RemoveCinderDisk , buildChildCommandParameters ( cinderDisk ) , org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.cloneContextAndDetachFromParent ( ) ) ; try { return future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { e.printStackTrace ( ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase removeCinderDisk ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RemoveCinderDisk , buildChildCommandParameters ( cinderDisk ) , org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.cloneContextAndDetachFromParent ( ) ) ; try { return future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { log.error ( "Error removing Cinder disk" , e ) ; } return null ; }
Source:
public void validateEnums ( org.ovirt.engine.api.model.Host host ) { if ( host.isSetPowerManagement ( ) ) { if ( host.getPowerManagement ( ) . isSetPmProxies ( ) ) { for ( org.ovirt.engine.api.model.PmProxy proxy : host.getPowerManagement ( ) . getPmProxies ( ) . getPmProxy ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.PmProxyType.class , proxy.getType ( ) , true ) ; } } } }

Target:
public void validateEnums ( org.ovirt.engine.api.model.Host host ) { if ( host.isSetPowerManagement ( ) ) { if ( host.getPowerManagement ( ) . isSetPmProxies ( ) ) { for ( org.ovirt.engine.api.model.PmProxy proxy : host.getPowerManagement ( ) . getPmProxies ( ) . getPmProxy ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.PmProxyType.class , proxy.getType ( ) , true ) ; } } } if ( host.isSetSsh ( ) ) { sshValidator.validateEnums ( host.getSsh ( ) ) ; } }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails details = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ) ( result ) ) ; setActualServiceList ( details.getServiceInfo ( ) ) ; filterServices ( ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails details = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ) ( result ) ) ; if ( ( details.getServiceInfo ( ) ) != null ) { setActualServiceList ( details.getServiceInfo ( ) ) ; } else { setActualServiceList ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.ServiceInfo > ( ) ) ; } filterServices ( ) ; }
Source:
public void testUpdate ( ) { addVmInit ( ) ; org.ovirt.engine.core.common.businessentities.VmInit init = dao.get ( org.ovirt.engine.core.dao.VmInitDaoTest.EXISTING_VM ) ; init.setHostname ( "newhostname" ) ; dao.update ( init ) ; org.ovirt.engine.core.common.businessentities.VmInit result = dao.get ( init.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( "newhostname" , result.getHostname ( ) ) ; }

Target:
public void testUpdate ( ) { addVmInit ( ) ; org.ovirt.engine.core.common.businessentities.VmInit init = dao.get ( org.ovirt.engine.core.dao.VmInitDaoTest.EXISTING_VM ) ; init.setHostname ( "newhostname" ) ; dao.update ( init ) ; org.ovirt.engine.core.common.businessentities.VmInit result = dao.get ( init.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( "newhostname" , result.getHostname ( ) ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , getEntityList ( ) ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmReportedDeviceResourceTest.VM_ID } , getEntityList ( ) ) ; } }
Source:
public org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel createNewLineModel ( java.lang.String key ) { org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel lineModel = new org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel ( ) ; lineModel.getKeys ( ) . setItems ( ( key == null ? getAvailableKeys ( ) : getAvailableKeys ( key ) ) ) ; lineModel.getKeys ( ) . getSelectedItemChangedEvent ( ) . addListener ( keyChangedListener ) ; initLineModel ( lineModel , key ) ; return lineModel ; }

Target:
public abstract M createNewLineModel ( java.lang.String key ) ;
Source:
public void perform ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime ) . perform ( ) ; } }

Target:
private org.ovirt.engine.core.vdsbroker.VmsMonitoring getVmsMonitoring ( org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher , long fetchTime ) { return new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime , getRefreshStatistics ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.errors.VdcBllErrors getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.VdcBllErrors bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.forValue ( xmlRpcStatus.mCode ) ; if ( bllErrors == null ) { log.warn ( ( "Unexpected return value: " + xmlRpcStatus ) ) ; bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } }

Target:
protected org.ovirt.engine.core.common.errors.VdcBllErrors getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.VdcBllErrors bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.forValue ( xmlRpcStatus.mCode ) ; if ( bllErrors == null ) { log.warn ( "Unexpected return value: {}" , xmlRpcStatus ) ; bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } }
Source:
public static void GetDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public static void GetMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public void invokeClient ( ) { org.ovirt.engine.ui.frontend.AsyncQuery signCallback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; signCallback.setModel ( this ) ; signCallback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryRetVal = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; java.lang.String signedTicket = queryRetVal.getReturnValue ( ) ; invokeClientNative ( signedTicket ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.SignString , new org.ovirt.engine.core.common.queries.SignStringParameters ( org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker.createConnectionString ( host , port , useSsl ) ) , signCallback ) ; }

Target:
private void openingWindowFailed ( ) { final org.ovirt.engine.ui.uicommonweb.ErrorPopupManager popupManager = ( ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager.class ) ) ) ; popupManager.show ( org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker.constants.openingNewConsoleWindowFailed ( ) ) ; }
Source:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; }

Target:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; }
Source:
private void addDefaultNetworks ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; net.setName ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ) ; net.setDescription ( AddVdsGroupCommand.DefaultNetworkDescription ) ; net.setDataCenterId ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getId ( ) ) ; net.setVmNetwork ( true ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getNetworkDAO ( ) . save ( net ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissions ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getCurrentUser ( ) . getUserId ( ) , net.getId ( ) , true ) ; }

Target:
private void addDefaultNetworks ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; net.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; net.setName ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ) ; net.setDescription ( AddVdsGroupCommand.DefaultNetworkDescription ) ; net.setDataCenterId ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getId ( ) ) ; net.setVmNetwork ( true ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getNetworkDAO ( ) . save ( net ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissions ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getCurrentUser ( ) . getUserId ( ) , net.getId ( ) , true ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VDS vds : getServersInCluster ( ) ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { setVdsName ( vds.getName ( ) ) ; addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP ) ; addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "VdsName" , vds.getName ( ) ) ) ; return false ; } } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VDS vds : getServersInCluster ( ) ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { setVdsName ( vds.getName ( ) ) ; addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP ) ; addValidationMessage ( java.lang.String.format ( "$%1$s %2$s" , "VdsName" , vds.getName ( ) ) ) ; return false ; } } return true ; }
Source:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getStorageDomainList ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult networkNotAttachedToCluster ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { return org.ovirt.engine.core.bll.network.dc.NetworkCommon.getNetworkClusterDAO ( ) . getAllForNetwork ( network.getId ( ) ) . isEmpty ( ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_CLUSTER_NETWORK_IN_USE ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByHost ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsWithNetwork = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVdsDAO ( ) . getAllForNetwork ( network.getId ( ) ) ; if ( hostsWithNetwork.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "ENTITIES_USING_NETWORK" , hostsWithNetwork ) ; replacements.add ( VdcBllMessages.VAR__ENTITIES__HOSTS.name ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE , replacements ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS createServer ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String hostname ) { org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; vdsStatic.setId ( serverId ) ; vdsStatic.sethost_name ( hostname ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; vdsDynamic.setstatus ( VDSStatus.Up ) ; return new org.ovirt.engine.core.common.businessentities.VDS ( vdsStatic , vdsDynamic , new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS createServer ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String hostname ) { org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; vdsStatic.setId ( serverId ) ; vdsStatic.setHostName ( hostname ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; vdsDynamic.setstatus ( VDSStatus.Up ) ; return new org.ovirt.engine.core.common.businessentities.VDS ( vdsStatic , vdsDynamic , new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ) ; }
Source:
public void isUSBEnabledByDefault ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getUserMessageOfTheDayViaPublic ( 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.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void FailedToRunVm ( ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { 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 ) ; }

Target:
protected void failedToRunVm ( ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { 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 ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ) == null ) && ( ! ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImages ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ; }

Target:
private org.ovirt.engine.core.compat.Guid getSnapshotId ( ) { return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public static void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
public javax.ws.rs.core.Response move ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; return doAction ( VdcActionType.MoveVm , new org.ovirt.engine.core.common.action.MoveVmParameters ( guid , getStorageDomainId ( action ) ) , action ) ; }

Target:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveVmParameters params = new org.ovirt.engine.core.common.action.MoveVmParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } if ( ( action.isSetDiscardSnapshots ( ) ) && ( action.isDiscardSnapshots ( ) ) ) { params.setCopyCollapse ( true ) ; } return doAction ( VdcActionType.ExportVm , params , action ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > object ) { return ( ( object.getFirst ( ) ) != null ) && ( getDetailModel ( ) . isInterfaceAttachedByLabel ( object.getFirst ( ) ) ) ? com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( getDetailModel ( ) . getEntity ( ) . getLabel ( ) ) : null ; }

Target:
public java.lang.String getTooltip ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > object ) { return ( ( object.getFirst ( ) ) != null ) && ( getDetailModel ( ) . isInterfaceAttachedByLabel ( object.getFirst ( ) ) ) ? getDetailModel ( ) . getEntity ( ) . getLabel ( ) : "" ; }
Source:
public void tJDBCOutput_30_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.configurationsync_4_0.ConfigurationSync.TalendException { end_Hash.put ( errorComponent , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tJDBCInput_52_onSubJobError ( exception , errorComponent , globalMap ) ; }

Target:
public void tJDBCInput_10_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.configurationsync_4_0.ConfigurationSync.TalendException { end_Hash.put ( errorComponent , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tJDBCInput_10_onSubJobError ( exception , errorComponent , globalMap ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper createHelper ( org.ovirt.engine.core.common.action.SetupNetworksParameters params ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( vds.getId ( ) ) . thenReturn ( Guid.Empty ) ; return createHelper ( params , vds ) ; }

Target:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper createHelper ( org.ovirt.engine.core.common.action.SetupNetworksParameters params , org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( vds.getId ( ) ) . thenReturn ( Guid.Empty ) ; return createHelper ( params , vds , compatibilityVersion ) ; }
Source:
protected void verifyRemoveAllDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface ) { org.mockito.Mockito.verify ( macPoolManager , org.mockito.Mockito.times ( 1 ) ) . freeMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceDAO ) . remove ( iface.getId ( ) ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . remove ( iface.getId ( ) ) ; }

Target:
protected void verifyRemoveAllDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.mockito.Mockito.verify ( macPoolManager , org.mockito.Mockito.times ( 1 ) ) . freeMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceDAO ) . remove ( iface.getId ( ) ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . remove ( iface.getId ( ) ) ; }
Source:
protected void onRunOnce ( ) { StartProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RunVmOnce , createRunVmOnceParams ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { StopProgress ( ) ; commandTarget.executeCommand ( runOnceCommand ) ; } } , this ) ; }

Target:
protected void onRunOnce ( ) { startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RunVmOnce , createRunVmOnceParams ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; commandTarget.executeCommand ( runOnceCommand ) ; } } , this ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.compat.Guid > fetchDomainsReportedAsProblematic ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainsData ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { return proxy.obtainDomainsReportedAsProblematic ( vdsDomainsData ) ; } return java.util.Collections.emptyList ( ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.compat.Guid > fetchDomainsReportedAsProblematic ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainsData , org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePool.getId ( ) ) ; if ( proxy != null ) { return proxy.obtainDomainsReportedAsProblematic ( vdsDomainsData , storagePool ) ; } return java.util.Collections.emptyList ( ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return model.getIsPool ( ) ? model.getTakeVmCommand ( ) : model.getRunCommand ( ) ; }

Target:
public com.google.gwt.event.dom.client.HasClickHandlers addRunButton ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( ( model.getIsPool ( ) ? constants.takeVm ( ) : constants.runVm ( ) ) , resources.playIcon ( ) , resources.playDisabledIcon ( ) , style.runButtonAdditionalStyle ( ) ) ; button.setElementId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , "runButton" ) ) ; addButtonToPanel ( button ) ; updateButton ( button , command ) ; return button ; }
Source:
public void getNetworkConnectivityCheckTimeoutInSeconds ( 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 ) ) : 120 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.NetworkConnectivityCheckTimeoutInSeconds , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 0 ) ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VolumeFormat GetDiskVolumeFormat ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( storageType.isFileDomain ( ) ) { return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; } else if ( storageType.isBlockDomain ( ) ) { switch ( volumeType ) { case Sparse : return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; case Preallocated : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } } else { return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } }

Target:
public static org.ovirt.engine.core.common.businessentities.VolumeFormat getDiskVolumeFormat ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( storageType.isFileDomain ( ) ) { return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; } else if ( storageType.isBlockDomain ( ) ) { switch ( volumeType ) { case Sparse : return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; case Preallocated : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } } else { return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } }
Source:
public void testGetRelevantVdsGroupQuotaForUserWithoutPrivileges ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForVdsGroup ( FixturesTool.VDS_GROUP_RHEL6_NFS , org.ovirt.engine.core.dao.UNPRIVILEGED_USER_SESSION_ID , true ) ; org.junit.Assert.assertEquals ( "Unprivileged user is not allowed to fetch for quota" , 0 , quotas.size ( ) ) ; }

Target:
public void testGetRelevantVdsGroupQuotaForUserWithoutPrivileges ( ) throws java.lang.Exception { org.junit.Assert.assertNotNull ( unprivilegedUserSession ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForVdsGroup ( FixturesTool.VDS_GROUP_RHEL6_NFS , unprivilegedUserSession.getId ( ) , true ) ; org.junit.Assert.assertEquals ( "Unprivileged user is not allowed to fetch for quota" , 0 , quotas.size ( ) ) ; }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertFalse ( model.isSetVm ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; assertEquals ( model.getStorageDomain ( ) . getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.STORAGE_DOMAIN_ID.toString ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertFalse ( model.isSetVm ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; assertEquals ( model.getStorageDomains ( ) . getStorageDomains ( ) . get ( 0 ) . getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.STORAGE_DOMAIN_ID.toString ( ) ) ; }
Source:
private void _setVdsStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { _vds.setStatus ( status ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . update ( _vds.getDynamicData ( ) ) ; return null ; } } ) ; }

Target:
public java.lang.Object call ( ) throws java.lang.Exception { if ( ( _managementNetwork ) != null ) { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , _managementNetwork ) ; } else if ( _isNode ) { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ) ; } else { _parser.cliNoop ( ) ; } return null ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "IsAvailable" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ) ) { getView ( ) . toggleProfilesVisibility ( model.getProfiles ( ) . getIsAvailable ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "IsAvailable" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ) ) { getView ( ) . toggleProfilesVisibility ( model.getProfiles ( ) . getIsAvailable ( ) ) ; } }
Source:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.network.Network getNetwork ( ) { if ( ( network ) == null ) { network = getDbFacade ( ) . getNetworkDao ( ) . get ( attachment.getNetworkId ( ) ) ; } return network ; }

Target:
private boolean networkAttachedToHost ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsAttachedToNetwork = vdsDao.getAllForNetwork ( attachment.getNetworkId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS hostAttachedToNetwork : hostsAttachedToNetwork ) { if ( hostAttachedToNetwork.getId ( ) . equals ( host.getId ( ) ) ) { return true ; } } return false ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String remoteUserName , java.lang.String remoteGroupName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepMountBrokerSetup ( remoteUserName , remoteGroupName , remoteVolumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String userName , java.lang.String remoteGroupName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepMountBrokerSetup ( userName , remoteGroupName , remoteVolumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void validateVmMemoryCanRunOnVdsHighMemLowOverhead ( ) { vm.setMinAllocatedMem ( 10000 ) ; vm.setVmMemSizeMb ( 10000 ) ; vds.setGuestOverhead ( ( - 1200 ) ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCanRunOnVdsHighMemLowOverhead ( ) { vm.setMinAllocatedMem ( 10000 ) ; vm.setVmMemSizeMb ( 10000 ) ; vds.setGuestOverhead ( ( - 1200 ) ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
public static java.lang.Integer map ( org.ovirt.engine.api.model.NicInterface type ) { switch ( type ) { case RTL8139_VIRTIO : return 0 ; case RTL8139 : return 1 ; case E1000 : return 2 ; case VIRTIO : return 3 ; case SPAPR_VLAN : return 4 ; default : return - 1 ; } }

Target:
public static java.lang.Integer map ( org.ovirt.engine.api.model.NicInterface type ) { switch ( type ) { case RTL8139_VIRTIO : return 0 ; case RTL8139 : return 1 ; case E1000 : return 2 ; case VIRTIO : return 3 ; case SPAPR_VLAN : return 4 ; case PCI_PASSTHROUGH : return 5 ; default : return - 1 ; } }
Source:
public void testExecuteQueryWithNotExistingIscsiBond ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( iscsiBondId ) ; getQuery ( ) . executeQueryCommand ( ) ; org.ovirt.engine.core.common.businessentities.IscsiBond result = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testExecuteQueryWithNotExistingIscsiBond ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( iscsiBondId ) ; getQuery ( ) . executeQueryCommand ( ) ; org.ovirt.engine.core.common.businessentities.IscsiBond result = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.jupiter.api.Assertions.assertNull ( result ) ; }
Source:
protected void verifyUpdate ( org.ovirt.engine.api.model.Network model , int index ) { assertTrue ( model.isSetDisplay ( ) ) ; assertEquals ( model.isDisplay ( ) , true ) ; }

Target:
protected void verifyUpdate ( org.ovirt.engine.api.model.Network model , int index ) { assertTrue ( model.isSetDisplay ( ) ) ; assertEquals ( model.isDisplay ( ) , true ) ; assertTrue ( model.isSetUsages ( ) ) ; assertNotNull ( model.getUsages ( ) . getUsages ( ) ) ; assertTrue ( model.getUsages ( ) . getUsages ( ) . contains ( NetworkUsage.DISPLAY.name ( ) ) ) ; assertTrue ( model.isSetRequired ( ) ) ; assertEquals ( model.isRequired ( ) , true ) ; }
Source:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getVmTemplate ( ) , true ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }

Target:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) , true ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }
Source:
protected org.ovirt.engine.api.model.ReportedDevice postPopulate ( org.ovirt.engine.api.model.ReportedDevice model ) { model.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ReportedDeviceType.class ) ) ; for ( org.ovirt.engine.api.model.Ip ip : model.getIps ( ) . getIps ( ) ) { ip.setVersion ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.restapi.types.IpVersion.class ) . value ( ) ) ; ip.setGateway ( null ) ; ip.setNetmask ( null ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.ReportedDevice postPopulate ( org.ovirt.engine.api.model.ReportedDevice model ) { model.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ReportedDeviceType.class ) ) ; for ( org.ovirt.engine.api.model.Ip ip : model.getIps ( ) . getIps ( ) ) { ip.setVersion ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.IpVersion.class ) ) ; ip.setGateway ( null ) ; ip.setNetmask ( null ) ; } return model ; }