auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void assertTestNotRemovingLabeledNetworksValid ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment , org.ovirt.engine.core.common.action.HostSetupNetworksParameters params , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( params ) . setHost ( host ) . setExistingInterfaces ( java.util.Arrays.asList ( nic ) ) . setNetworkBusinessEntityMap ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Arrays.asList ( network ) ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( removedAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
private void assertTestNotRemovingLabeledNetworksValid ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment , org.ovirt.engine.core.common.action.HostSetupNetworksParameters params , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( params ) . setHost ( host ) . setExistingInterfaces ( java.util.Collections.singletonList ( nic ) ) . addNetworks ( network ) . build ( ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( removedAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void IsTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmTemlateWithSameNameExistParameters ( name ) , aQuery ) ; }

Target:
public static void GetSANWipeAfterDelete ( 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
private void RunOnce ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( vm , getCustomPropertiesKeysList ( ) . get ( vm.getVdsGroupCompatibilityVersion ( ) ) , this ) ; setWindow ( model ) ; model.init ( ) ; }

Target:
private void runOnce ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( vm , getCustomPropertiesKeysList ( ) . get ( vm.getVdsGroupCompatibilityVersion ( ) ) , this ) ; setWindow ( model ) ; model.init ( ) ; }
Source:
public void getExistingVariable ( ) { org.ovirt.engine.core.common.ExternalVariable expected = new org.ovirt.engine.core.common.ExternalVariable ( ) ; expected.setName ( "fence-kdump-listener" ) ; org.ovirt.engine.core.common.ExternalVariable found = dao.get ( expected.getName ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( expected , found ) ; org.junit.Assert.assertNotNull ( found.getUpdateDate ( ) ) ; }

Target:
public void getExistingVariable ( ) { org.ovirt.engine.core.common.ExternalVariable expected = new org.ovirt.engine.core.common.ExternalVariable ( ) ; expected.setName ( "fence-kdump-listener" ) ; org.ovirt.engine.core.common.ExternalVariable found = dao.get ( expected.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( found ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected , found ) ; org.junit.jupiter.api.Assertions.assertNotNull ( found.getUpdateDate ( ) ) ; }
Source:
public void snapshotEntityStatus ( org.ovirt.engine.core.common.businessentities.BusinessEntity < ? > entity , java.lang.Enum < ? > status ) { org.ovirt.engine.core.common.businessentities.BusinessEntitySnapshot.EntityStatusSnapshot snapshot = new org.ovirt.engine.core.common.businessentities.BusinessEntitySnapshot.EntityStatusSnapshot ( ) ; snapshot.setId ( entity.getId ( ) ) ; snapshot.setStatus ( status ) ; snapshotEntityInMemory ( entity , snapshot , SnapshotType.CHANGED_STATUS_ONLY ) ; }

Target:
public < T extends java.lang.Enum < ? > > void snapshotEntityStatus ( org.ovirt.engine.core.common.businessentities.BusinessEntityWithStatus < ? , T > entity , T status ) { org.ovirt.engine.core.common.businessentities.BusinessEntitySnapshot.EntityStatusSnapshot snapshot = new org.ovirt.engine.core.common.businessentities.BusinessEntitySnapshot.EntityStatusSnapshot ( ) ; snapshot.setId ( entity.getId ( ) ) ; snapshot.setStatus ( status ) ; snapshotEntityInMemory ( entity , snapshot , SnapshotType.CHANGED_STATUS_ONLY ) ; }
Source:
protected void buildVmVideoCards ( ) { createInfo.put ( VdsProperties.display , vm.getDisplayType ( ) . toString ( ) ) ; if ( ( vm.getDisplayType ( ) ) != ( vm.getDefaultDisplayType ( ) ) ) { addVideoCardByDisplayType ( vm.getDisplayType ( ) ) ; } else { addVideoCardsDefinedForVmInDB ( vm.getId ( ) ) ; } }

Target:
protected void buildVmVideoCards ( ) { createInfo.put ( VdsProperties.display , vm.getDisplayType ( ) . toString ( ) ) ; if ( ( vm.getDisplayType ( ) ) != ( vm.getDefaultDisplayType ( ) ) ) { addVideoCardByDisplayType ( vm.getDisplayType ( ) , vm.getNumOfMonitors ( ) ) ; } else { addVideoCardsDefinedForVmInDB ( vm.getId ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ( ( glusterVolume.getAsyncTask ( ) ) == null ) || ( ( glusterVolume.getAsyncTask ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType.REBALANCE ) ) ) || ( ( glusterVolume.getAsyncTask ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskOfType ( glusterVolume , GlusterTaskType.REBALANCE ) ) ) || ( ! ( org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.isTaskStatus ( glusterVolume , JobExecutionStatus.STARTED ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED ) ; } return true ; }
Source:
public java.lang.Object mapFromContext ( java.lang.Object ctx ) { org.springframework.ldap.core.DirContextAdapter searchResult = ( ( org.springframework.ldap.core.DirContextAdapter ) ( ctx ) ) ; javax.naming.directory.Attributes attributes = searchResult.getAttributes ( ) ; if ( attributes == null ) { return null ; } javax.naming.directory.Attribute att = attributes.get ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.IPARootDSEAttributes.namingContexts.name ( ) ) ; if ( att != null ) { try { return att.get ( 0 ) ; } catch ( javax.naming.NamingException e ) { e.printStackTrace ( ) ; return null ; } } else { return null ; } }

Target:
public java.lang.Object mapFromContext ( java.lang.Object ctx ) { org.springframework.ldap.core.DirContextAdapter searchResult = ( ( org.springframework.ldap.core.DirContextAdapter ) ( ctx ) ) ; javax.naming.directory.Attributes attributes = searchResult.getAttributes ( ) ; if ( attributes == null ) { return null ; } javax.naming.directory.Attribute att = attributes.get ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.IPARootDSEAttributes.defaultnamingcontext.name ( ) ) ; if ( att != null ) { try { return att.get ( 0 ) ; } catch ( javax.naming.NamingException e ) { e.printStackTrace ( ) ; return null ; } } else { return null ; } }
Source:
protected void gatherChangedVms ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , vdsmVm ) ) ; if ( org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher.log.isDebugEnabled ( ) ) { logBuilder.append ( java.lang.String.format ( "%s:%s" , vdsmVm.getVmDynamic ( ) . getId ( ) . toString ( ) . substring ( 0 , 8 ) , vdsmVm.getVmDynamic ( ) . getStatus ( ) ) ) ; } }

Target:
protected void gatherChangedVms ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , vdsmVm ) ) ; if ( org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher.log.isDebugEnabled ( ) ) { logBuilder.append ( java.lang.String.format ( "%s:%s " , vdsmVm.getVmDynamic ( ) . getId ( ) . toString ( ) . substring ( 0 , 8 ) , vdsmVm.getVmDynamic ( ) . getStatus ( ) ) ) ; } }
Source:
protected void onBind ( ) { super . onBind ( ) ; org.ovirt.engine.ui.common.widget.table.OrderedMultiSelectionModel < ? > tableSelectionModel = ( ( getTable ( ) ) != null ) ? getTable ( ) . getSelectionModel ( ) : null ; if ( tableSelectionModel != null ) { registerHandler ( tableSelectionModel.addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { updateDetailModelSelection ( ) ; } } ) ) ; } }

Target:
public void onUiCommonInit ( org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent event ) { initializeHandlers ( ) ; }
Source:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntityStronglyTyped ( ) , getEntityStronglyTyped ( ) . getStoragePoolId ( ) , cluster.getcompatibility_version ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntityStronglyTyped ( ) , getEntityStronglyTyped ( ) . getStoragePoolId ( ) , cluster.getCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
public boolean isSpiceFileTransferToggleSupported ( java.lang.String version ) { return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.SpiceFileTransferToggleSupported , version ) ) ) ; }

Target:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute logoff: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase attemptRollback ( org.ovirt.engine.core.common.action.VdcActionType commandType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { if ( canPerformRollbackUsingCommand ( commandType , params ) ) { params.setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; params.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; return getBackend ( ) . runInternalAction ( commandType , params , context.clone ( ) ) ; } return new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; }

Target:
protected org.ovirt.engine.core.bll.interfaces.BackendInternal getBackend ( ) { return backendInternal ; }
Source:
protected void executeVDSCommand ( ) { try { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxyData = org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getCurrentIrsProxyData ( ) ; proxyData.clearPoolTimers ( ) ; proxyData.clearCache ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.error ( "Could not change timers for pool '{}': {}" , org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getStoragePoolId ( ) , e.getMessage ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.debug ( "Exception" , e ) ; } org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getVDSReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void executeVDSCommand ( ) { try { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxy proxy = org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getCurrentIrsProxy ( ) ; proxy.clearPoolTimers ( ) ; proxy.clearCache ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.error ( "Could not change timers for pool '{}': {}" , org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getStoragePoolId ( ) , e.getMessage ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.debug ( "Exception" , e ) ; } org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getVDSReturnValue ( ) . setSucceeded ( true ) ; }
Source:
protected void listenOnConsoleModelChangeEvent ( com.google.gwt.event.shared.EventBus eventBus , final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { eventBus.addHandler ( org.ovirt.engine.ui.userportal.section.main.presenter.popup.console.ConsoleModelChangedEvent.getType ( ) , new org.ovirt.engine.ui.userportal.section.main.presenter.popup.console.ConsoleModelChangedEvent.ConsoleModelChangedHandler ( ) { @ java.lang.Override public void onConsoleModelChanged ( org.ovirt.engine.ui.userportal.section.main.presenter.popup.console.ConsoleModelChangedEvent event ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupConsole ( modelProvider ) ; } } ) ; }

Target:
protected void listenOnConsoleModelChangeEvent ( com.google.gwt.event.shared.EventBus eventBus , final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { eventBus.addHandler ( org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.getType ( ) , new org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.ConsoleModelChangedHandler ( ) { @ java.lang.Override public void onConsoleModelChanged ( org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent event ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupConsole ( modelProvider ) ; } } ) ; }
Source:
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 ( ) ) ; } memoryVolumes.remove ( StringUtils.EMPTY ) ; return memoryVolumes ; }

Target:
public java.util.Set < java.lang.String > removeSnapshots ( org.ovirt.engine.core.compat.Guid vmId ) { final java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > vmSnapshots = getSnapshotDao ( ) . getAll ( vmId ) ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : vmSnapshots ) { getSnapshotDao ( ) . remove ( snapshot.getId ( ) ) ; } return org.ovirt.engine.core.bll.memory.MemoryUtils.getMemoryVolumesFromSnapshots ( vmSnapshots ) ; }
Source:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM resultVm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; resultVm.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , resultVm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , resultVm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.DedicatedVmForVdsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.MigrationOptionsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyVmBaseToVmBaseBuilder ( ) ) ; return resultVm ; }

Target:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM resultVm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; resultVm.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , resultVm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , resultVm.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.template.VmBaseToVmBaseForTemplateCompositeBaseBuilder ( ) ) ; return resultVm ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.GetNumberOfActiveVmsInClusterByClusterIdQuery.getParameters ( ) . getId ( ) ) ; int activeVms = 0 ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ( ( vm.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) && ( ( vm.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) ) { ++ activeVms ; } } org.ovirt.engine.core.bll.GetNumberOfActiveVmsInClusterByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( activeVms ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAllForCluster ( org.ovirt.engine.core.bll.GetNumberOfActiveVmsInClusterByClusterIdQuery.getParameters ( ) . getId ( ) ) ; int activeVms = 0 ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ( ( vm.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) && ( ( vm.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) ) { ++ activeVms ; } } org.ovirt.engine.core.bll.GetNumberOfActiveVmsInClusterByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( activeVms ) ; }
Source:
private static int getNextImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
public org.ovirt.engine.core.compat.Guid persistAsyncTaskPlaceHolder ( java.lang.String taskKey ) { return super . persistAsyncTaskPlaceHolder ( getActionType ( ) , taskKey ) ; }
Source:
private boolean templateExists ( ) { if ( ( ( getVmTemplate ( ) ) == null ) && ( ! ( getParameters ( ) . getCopyCollapse ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST ) ; return false ; } return true ; }

Target:
protected boolean validateVdsCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groups = org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupDAO ( ) . getAllForStoragePool ( getParameters ( ) . getStoragePoolId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup group : groups ) { if ( group.getId ( ) . equals ( getParameters ( ) . getVdsGroupId ( ) ) ) { return true ; } } return failCanDoAction ( VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID ) ; }
Source:
public void testGetAllClustersWithoutMigratingVMs ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > migrationFreeClusters = dao.getWithoutMigratingVms ( ) ; org.junit.Assert.assertFalse ( migrationFreeClusters.isEmpty ( ) ) ; final int migrationCount = migrationFreeClusters.size ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAllRunningByCluster ( FixturesTool.CLUSTER_RHEL6_ISCSI ) ; for ( org.ovirt.engine.core.common.businessentities.VM migratingVM : vms ) { vmDynamicDao.updateStatus ( migratingVM.getId ( ) , VMStatus.Up ) ; migrationFreeClusters = dao.getWithoutMigratingVms ( ) ; } org.junit.Assert.assertEquals ( ( migrationCount + 1 ) , migrationFreeClusters.size ( ) ) ; }

Target:
public void testGetAllClustersWithoutMigratingVMs ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > migrationFreeClusters = dao.getWithoutMigratingVms ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( migrationFreeClusters.isEmpty ( ) ) ; final int migrationCount = migrationFreeClusters.size ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAllRunningByCluster ( FixturesTool.CLUSTER_RHEL6_ISCSI ) ; for ( org.ovirt.engine.core.common.businessentities.VM migratingVM : vms ) { vmDynamicDao.updateStatus ( migratingVM.getId ( ) , VMStatus.Up ) ; migrationFreeClusters = dao.getWithoutMigratingVms ( ) ; } org.junit.jupiter.api.Assertions.assertEquals ( ( migrationCount + 1 ) , migrationFreeClusters.size ( ) ) ; }
Source:
public void setPhysicalMemory ( java.lang.Integer value ) { if ( ( ( physicalMemory ) == null ) && ( value == null ) ) { return ; } if ( ( ( physicalMemory ) == null ) || ( ! ( physicalMemory.equals ( value ) ) ) ) { physicalMemory = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "PhysicalMemory" ) ) ; } }

Target:
public void setCpuName ( java.lang.String value ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( cpuName , value ) ) ) { cpuName = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "CpuName" ) ) ; } }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmFromScratchParameters parameters = new org.ovirt.engine.core.common.action.AddVmFromScratchParameters ( vmStatic , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AddVmFromScratch , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getExecutionContext ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmFromScratchParameters parameters = new org.ovirt.engine.core.common.action.AddVmFromScratchParameters ( vmStatic , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return runInternalActionWithTasksContext ( VdcActionType.AddVmFromScratch , parameters ) ; }
Source:
private void commit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getInPreview ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }

Target:
private void undo ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.SnapshotActionEnum.UNDO ) , null , null ) ; } }
Source:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = getStorageDomain ( ) . getSelectedItem ( ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; updateWipeAfterDelete ( selectedStorage.getStorageType ( ) ) ; } updateQuota ( getDataCenter ( ) . getSelectedItem ( ) ) ; }

Target:
private void isShareable_EntityChanged ( ) { boolean isShareable = getIsShareable ( ) . getEntity ( ) ; if ( ( getIsBootable ( ) . getIsChangable ( ) ) || ( ( ! ( isVmContainBootableDisk ) ) && ( ! isShareable ) ) ) { getIsBootable ( ) . setIsChangable ( ( ! isShareable ) ) ; getIsBootable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.cannotEnableBootableForShareableDisk ( ) ) ; } }
Source:
public void testSaveOrUpdate ( ) { org.ovirt.engine.core.common.businessentities.EngineSession sessionFromDb = dao.getBySessionId ( newEngineSession.getEngineSessionId ( ) ) ; org.junit.Assert.assertNull ( sessionFromDb ) ; dao.save ( newEngineSession ) ; sessionFromDb = dao.getBySessionId ( newEngineSession.getEngineSessionId ( ) ) ; org.junit.Assert.assertNotNull ( sessionFromDb ) ; org.junit.Assert.assertEquals ( sessionFromDb , newEngineSession ) ; }

Target:
public void testSaveOrUpdate ( ) { org.ovirt.engine.core.common.businessentities.EngineSession sessionFromDb = dao.getBySessionId ( newEngineSession.getEngineSessionId ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( sessionFromDb ) ; dao.save ( newEngineSession ) ; sessionFromDb = dao.getBySessionId ( newEngineSession.getEngineSessionId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( sessionFromDb ) ; org.junit.jupiter.api.Assertions.assertEquals ( sessionFromDb , newEngineSession ) ; }
Source:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStop ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStop ( volumeName , remoteHost , remoteVolumeName , force ) ) ; } 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 glusterVolumeGeoRepSessionDelete ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionDelete ( volumeName , remoteHost , remoteVolumeName , userName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase res = result.getReturnValue ( ) ; getTestResult ( ) . setEntity ( ( ( res != null ) && ( res.getSucceeded ( ) ) ) ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase res = result.getReturnValue ( ) ; if ( ( res != null ) && ( res.getSucceeded ( ) ) ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.TestProviderConnectivity , new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase res = result.getReturnValue ( ) ; setTestResultValue ( res ) ; stopProgress ( ) ; } } , null , false ) ; } else { setTestResultValue ( res ) ; stopProgress ( ) ; } }
Source:
public void testPoolSpiceProxy ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; entity.setVmPoolSpiceProxy ( org.ovirt.engine.api.restapi.types.VmMapperTest.POOL_SPICE_PROXY ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.POOL_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }

Target:
public void testPoolSpiceProxy ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; entity.setVmPoolSpiceProxy ( org.ovirt.engine.api.restapi.types.VmMapperTest.POOL_SPICE_PROXY ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.POOL_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }
Source:
public org.ovirt.engine.core.compat.Guid executeAsyncCommand ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , final org.ovirt.engine.core.bll.tasks.interfaces.CommandCallBack callBack ) { final org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; org.ovirt.engine.core.bll.tasks.CommandExecutor.executor.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { executeCommand ( command , callBack ) ; } } ) ; return command.getCommandId ( ) ; }

Target:
public java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > executeAsyncCommand ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.action.VdcActionParametersBase parameters ) { final org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; return org.ovirt.engine.core.bll.tasks.CommandExecutor.executor.submit ( new java.util.concurrent.Callable < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.action.VdcReturnValueBase call ( ) throws java.lang.Exception { return executeCommand ( command ) ; } } ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.Host host ) { return host.isSetId ( ) ? new org.ovirt.engine.core.compat.Guid ( host.getId ( ) ) : host.isSetName ( ) ? getEntity ( org.ovirt.engine.core.common.businessentities.VdsStatic.class , VdcQueryType.GetVdsStaticByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host.getName ( ) ) , ( "Hosts: name=" + ( host.getName ( ) ) ) ) . getId ( ) : null ; }

Target:
private org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.Host host ) { return host.isSetId ( ) ? new org.ovirt.engine.core.compat.Guid ( host.getId ( ) ) : host.isSetName ( ) ? getEntity ( org.ovirt.engine.core.common.businessentities.VdsStatic.class , QueryType.GetVdsStaticByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host.getName ( ) ) , ( "Hosts: name=" + ( host.getName ( ) ) ) ) . getId ( ) : null ; }
Source:
public void testVmInPreview ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW.name ( ) ) ) ; }

Target:
public void testVmInPreview ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
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 ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void testCheckGroupsCanBeAttachedAdminIssues ( ) { getRole ( ) . setType ( RoleType.USER ) ; org.ovirt.engine.core.common.businessentities.RoleGroupMap map = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_STORAGE_POOL , getParams ( ) . getRoleId ( ) ) ; mockGetAllForRole ( java.util.Collections.singletonList ( map ) ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < java.lang.String > ( 1 ) ; org.junit.Assert.assertTrue ( "canDoAction should fail" , getCommand ( ) . checkIfGroupsCanBeAttached ( messages ) ) ; org.junit.Assert.assertEquals ( "wrong messages" , VdcBllMessages.CANNOT_ADD_ACTION_GROUPS_TO_ROLE_TYPE.toString ( ) , messages.get ( 0 ) ) ; }

Target:
public void testCheckGroupsCanBeAttachedAdminIssues ( ) { getRole ( ) . setType ( RoleType.USER ) ; org.ovirt.engine.core.common.businessentities.RoleGroupMap map = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_STORAGE_POOL , getParams ( ) . getRoleId ( ) ) ; mockGetAllForRole ( java.util.Collections.singletonList ( map ) ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < java.lang.String > ( 1 ) ; org.junit.Assert.assertTrue ( "canDoAction should fail" , getCommand ( ) . checkIfGroupsCanBeAttached ( messages ) ) ; org.junit.Assert.assertEquals ( "wrong messages" , EngineMessage.CANNOT_ADD_ACTION_GROUPS_TO_ROLE_TYPE.toString ( ) , messages.get ( 0 ) ) ; }
Source:
public void testExistingDiscardAfterDeleteFunctionalityPreservedDiscardAfterDeleteFunctionalityBreaks ( ) { storageDomain.setDiscardAfterDelete ( true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingDiscardAfterDeleteFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , false ) , createLunWithDiscardFunctionality ( 0L , true ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
private com.google.gwt.user.client.ui.IsWidget createGeneralAdditionalInfo ( ) { com.google.gwt.user.client.ui.FlowPanel panel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; panel.addStyleName ( PatternflyConstants.PF_LIST_VIEW_ADDITIONAL_INFO_ITEM ) ; generalExpand = new org.ovirt.engine.ui.common.widget.listgroup.ExpandableListViewItem ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmSnapshotListViewItem.constants.generalLabel ( ) , IconType.EYE.getCssName ( ) ) ; getClickHandlerRegistrations ( ) . add ( generalExpand.addClickHandler ( this ) ) ; panel.add ( generalExpand ) ; return panel ; }

Target:
private com.google.gwt.user.client.ui.IsWidget createGeneralAdditionalInfo ( ) { com.google.gwt.user.client.ui.FlowPanel panel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; panel.addStyleName ( PatternflyConstants.PF_LIST_VIEW_ADDITIONAL_INFO_ITEM ) ; generalExpand = new org.ovirt.engine.ui.common.widget.listgroup.ExpandableListViewItem ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmSnapshotListViewItem.constants.generalLabel ( ) ) , IconType.EYE.getCssName ( ) ) ; getClickHandlerRegistrations ( ) . add ( generalExpand.addClickHandler ( this ) ) ; panel.add ( generalExpand ) ; return panel ; }
Source:
private void expectGetLunsMap ( java.lang.String lunId , java.lang.String cnxId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ret = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap map = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( ) ; map.setLunId ( lunId ) ; map.setstorage_server_connection ( cnxId ) ; ret.add ( map ) ; org.mockito.Mockito.when ( storageServerConnectionLunMapDao.getAll ( lunId ) ) . thenReturn ( ret ) ; }

Target:
private void expectGetLunsMap ( java.lang.String lunId , java.lang.String cnxId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ret = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap map = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( ) ; map.setLunId ( lunId ) ; map.setStorageServerConnection ( cnxId ) ; ret.add ( map ) ; org.mockito.Mockito.when ( storageServerConnectionLunMapDao.getAll ( lunId ) ) . thenReturn ( ret ) ; }