auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void insertNewVariable ( ) { org.ovirt.engine.core.common.ExternalVariable newVar = new org.ovirt.engine.core.common.ExternalVariable ( ) ; newVar.setName ( "new-var" ) ; newVar.setValue ( "123456" ) ; newVar.setUpdateDate ( new java.util.Date ( ) ) ; dao.save ( newVar ) ; org.ovirt.engine.core.common.ExternalVariable found = dao.get ( newVar.getName ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( newVar , found ) ; }

Target:
public void insertNewVariable ( ) { org.ovirt.engine.core.common.ExternalVariable newVar = new org.ovirt.engine.core.common.ExternalVariable ( ) ; newVar.setName ( "new-var" ) ; newVar.setValue ( "123456" ) ; newVar.setUpdateDate ( new java.util.Date ( ) ) ; dao.save ( newVar ) ; org.ovirt.engine.core.common.ExternalVariable found = dao.get ( newVar.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( found ) ; org.junit.jupiter.api.Assertions.assertEquals ( newVar , found ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.vms.register.RegisterVmData registerVmData ) { java.lang.String problem ; if ( ( registerVmData.getError ( ) ) != null ) { problem = registerVmData.getError ( ) ; } else { problem = registerVmData.getWarning ( ) ; } return problem == null ? null : com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( problem ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.vms.register.RegisterVmData registerVmData ) { java.lang.String problem ; if ( ( registerVmData.getError ( ) ) != null ) { problem = registerVmData.getError ( ) ; } else { problem = registerVmData.getWarning ( ) ; } return problem == null ? null : new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) . appendEscapedLines ( problem ) . toSafeHtml ( ) ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static 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.RunQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
private void stpTest ( org.ovirt.engine.core.bll.ValidationResult expected , boolean vmNetwork , boolean stp ) { org.mockito.Mockito.when ( network.isVmNetwork ( ) ) . thenReturn ( vmNetwork ) ; org.mockito.Mockito.when ( network.getStp ( ) ) . thenReturn ( stp ) ; org.junit.Assert.assertEquals ( expected , validator.stpForVmNetworkOnly ( ) ) ; }

Target:
private void stpTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , boolean vmNetwork , boolean stp ) { org.mockito.Mockito.when ( network.isVmNetwork ( ) ) . thenReturn ( vmNetwork ) ; org.mockito.Mockito.when ( network.getStp ( ) ) . thenReturn ( stp ) ; org.junit.Assert.assertThat ( validator.stpForVmNetworkOnly ( ) , matcher ) ; }
Source:
public org.ovirt.engine.core.common.asynctasks.AsyncTaskType getCurrentTaskHandlerTaskType ( ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; }

Target:
public org.ovirt.engine.core.compat.Guid persistAsyncTaskPlaceHolder ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.compat.Guid retValue = org.ovirt.engine.core.compat.Guid.Empty ; try { org.ovirt.engine.core.common.businessentities.AsyncTasks task = createAsyncTask ( new org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo ( ) , parentCommand ) ; retValue = task.getTaskId ( ) ; org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.addOrUpdateTaskInDB ( task , null , org.ovirt.engine.core.bll.CommandBase.EMPTY_GUID_ARRAY ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during persistAsyncTaskPlaceHolders for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } return retValue ; }
Source:
protected void setGetVdsQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , vds ) ; } }

Target:
protected void setGetVdsQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , vds ) ; } }
Source:
public static void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public 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 > ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
public void testVmWithDisks ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( vm , null , disks ) , true , null ) ; }

Target:
public void canRunVmDuringInit ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }
Source:
public void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public 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.Cluster > ( ) ; } 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 ) ; }
Source:
private void handleSequentialQueries ( final java.lang.String key ) { org.ovirt.engine.ui.frontend.Frontend.currentRequests.remove ( queryWrapper.getKey ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.QueryWrapper wrapper = org.ovirt.engine.ui.frontend.Frontend.pendingRequests.get ( key ) ; if ( wrapper != null ) { org.ovirt.engine.ui.frontend.Frontend.pendingRequests.remove ( queryWrapper.getKey ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( wrapper.getQueryType ( ) , wrapper.getParameters ( ) , service , wrapper.getCallback ( ) ) ; } }

Target:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , 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 runAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; if ( callback != null ) { callback.executed ( f ) ; } }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeOptionVDSCommand.getBroker ( ) . glusterVolumeSet ( org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeOptionVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeOptionVDSCommand.getParameters ( ) . getVolumeOption ( ) . getKey ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeOptionVDSCommand.getParameters ( ) . getVolumeOption ( ) . getValue ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeOptionVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeOptionVDSCommand.getBroker ( ) . glusterVolumeSet ( org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeOptionVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeOptionVDSCommand.getParameters ( ) . getVolumeOption ( ) . getKey ( ) , org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeOptionVDSCommand.getParameters ( ) . getVolumeOption ( ) . getValue ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.SetGlusterVolumeOptionVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > generateDisksList ( int size ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < size ; ++ i ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disksList.add ( diskImage ) ; } return disksList ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > generateDisksList ( int size ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < size ; ++ i ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.AddVmCommandTest.createDiskImage ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) ; disksList.add ( diskImage ) ; } return disksList ; }
Source:
public static void IsHotPlugAvailable ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String 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.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HotPlugEnabled ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void GetNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }
Source:
private static void AddEventNotificationEntry ( org.ovirt.engine.core.common.EventNotificationEntity entity , org.ovirt.engine.core.common.AuditLogType auditLogType ) { java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > entry = org.ovirt.engine.core.common.VdcEventNotificationUtils.eventNotificationTypeMap.get ( entity ) ; if ( entry == null ) { entry = new java.util.HashSet < > ( ) ; org.ovirt.engine.core.common.VdcEventNotificationUtils.eventNotificationTypeMap.put ( entity , entry ) ; } entry.add ( auditLogType ) ; }

Target:
private static void addEventNotificationEntry ( org.ovirt.engine.core.common.EventNotificationEntity entity , org.ovirt.engine.core.common.AuditLogType auditLogType ) { java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > entry = org.ovirt.engine.core.common.VdcEventNotificationUtils.eventNotificationTypeMap.get ( entity ) ; if ( entry == null ) { entry = new java.util.HashSet < > ( ) ; org.ovirt.engine.core.common.VdcEventNotificationUtils.eventNotificationTypeMap.put ( entity , entry ) ; } entry.add ( auditLogType ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( org.ovirt.engine.core.bll.network.host.UpdateNetworkAttachmentCommand.getParameters ( ) . getVdsId ( ) ) ; params.getNetworkAttachments ( ) . add ( org.ovirt.engine.core.bll.network.host.UpdateNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.HostSetupNetworks , params ) ; propagateFailure ( returnValue ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( org.ovirt.engine.core.bll.network.host.UpdateNetworkAttachmentCommand.getParameters ( ) . getVdsId ( ) ) ; params.getNetworkAttachments ( ) . add ( org.ovirt.engine.core.bll.network.host.UpdateNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.HostSetupNetworks , params ) ; propagateFailure ( returnValue ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { removeListeners ( model ) ; getView ( ) . flush ( ) ; org.ovirt.engine.ui.userportal.section.main.presenter.popup.console.ConsoleModelChangedEvent.fire ( getEventBus ( ) , ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( model.getSelectedItem ( ) ) ) ) ; hideAndUnbind ( ) ; }

Target:
protected void beforeCommandExecuted ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . beforeCommandExecuted ( command ) ; if ( command == ( model.getDefaultCommand ( ) ) ) { removeListeners ( model ) ; getView ( ) . flushToPrivateModel ( ) ; org.ovirt.engine.ui.userportal.section.main.presenter.popup.console.ConsoleModelChangedEvent.fire ( getEventBus ( ) , ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( model.getModel ( ) . getSelectedItem ( ) ) ) ) ; } }
Source:
public boolean validateAndSetQuota ( ) { if ( ! ( org.ovirt.engine.core.bll.AddVmTemplateCommand.isInternalExecution ( ) ) ) { if ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getQuotaManager ( ) . validateQuotaForStoragePool ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getStoragePool ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getVdsGroupId ( ) , getQuotaId ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ) { return org.ovirt.engine.core.bll.AddVmTemplateCommand.getQuotaManager ( ) . validateAndSetStorageQuota ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getStoragePool ( ) , getStorageQuotaListParameters ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; } return false ; } return true ; }

Target:
protected void endSuccessfully ( ) { setVmTemplateId ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) ) ; setVmId ( getVmIdFromImageParameters ( ) ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . EndAction ( VdcActionType.CreateImageTemplate , p ) ; } if ( ( reloadVmTemplateFromDB ( ) ) != null ) { endDefaultOperations ( ) ; } org.ovirt.engine.core.bll.AddVmTemplateCommand.setSucceeded ( true ) ; }
Source:
private long getSwapUsed ( org.ovirt.engine.core.common.businessentities.VdsStatistics s ) { if ( s == null ) { return 0 ; } else { if ( ( s.getswap_total ( ) ) == null ) { return 0 ; } else { if ( ( s.getswap_free ( ) ) == null ) { return s.getswap_total ( ) ; } else { return ( s.getswap_total ( ) ) - ( s.getswap_free ( ) ) ; } } } }

Target:
private long getSwapUsed ( org.ovirt.engine.core.common.businessentities.VdsStatistics s ) { if ( s == null ) { return 0 ; } else { if ( ( s.getSwapTotal ( ) ) == null ) { return 0 ; } else { if ( ( s.getSwapFree ( ) ) == null ) { return s.getSwapTotal ( ) ; } else { return ( s.getSwapTotal ( ) ) - ( s.getSwapFree ( ) ) ; } } } }
Source:
protected void connectAllHostToPoolAndDomain ( final org.ovirt.engine.core.common.businessentities.storage_domains masterDomain ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.getAllRunningVdssInPool ( ) ; final org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.getStoragePool ( ) ; org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations sync = new org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations ( vdsList.size ( ) , null , new org.ovirt.engine.core.bll.storage.ActivateDeactivateSingleAsyncOperationFactory ( ) { @ java.lang.Override public org.ovirt.engine.core.utils.ISingleAsyncOperation CreateSingleAsyncOperation ( ) { return new org.ovirt.engine.core.bll.storage.ConntectVDSToPoolAndDomains ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( vdsList ) ) , masterDomain , storagePool ) ; } @ java.lang.Override public void Initialize ( java.util.ArrayList parameters ) { } } ) ; sync.Execute ( ) ; }

Target:
protected void connectAllHostToPoolAndDomain ( final org.ovirt.engine.core.common.businessentities.storage_domains masterDomain ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.getAllRunningVdssInPool ( ) ; final org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.getStoragePool ( ) ; org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations sync = new org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations ( vdsList.size ( ) , null , new org.ovirt.engine.core.bll.storage.ActivateDeactivateSingleAsyncOperationFactory ( ) { @ java.lang.Override public org.ovirt.engine.core.utils.ISingleAsyncOperation createSingleAsyncOperation ( ) { return new org.ovirt.engine.core.bll.storage.ConntectVDSToPoolAndDomains ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( vdsList ) ) , masterDomain , storagePool ) ; } @ java.lang.Override public void initialize ( java.util.ArrayList parameters ) { } } ) ; sync.Execute ( ) ; }
Source:
protected boolean isBalloonEnabled ( ) { java.lang.Boolean balloonEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isBalloonEnabled ( ) ; return balloonEnabled != null ? balloonEnabled : osRepository.isBalloonEnabled ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) ) ; }

Target:
protected boolean isBalloonEnabled ( ) { java.lang.Boolean balloonEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isBalloonEnabled ( ) ; return balloonEnabled != null ? balloonEnabled : osRepository.isBalloonEnabled ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; }
Source:
public void canRunVmFailVmRunning ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }

Target:
public void canRunVmFailVmRunning ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS makeTestVds ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.common.businessentities.VDS newVdsData = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; newVdsData.setHostName ( "BUZZ" ) ; newVdsData.setVdsName ( "BAR" ) ; newVdsData.setVdsGroupCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "1.2.3" ) ) ; newVdsData.setVdsGroupId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; newVdsData.setId ( vdsId ) ; return newVdsData ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS makeTestVds ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.common.businessentities.VDS newVdsData = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; newVdsData.setHostName ( "BUZZ" ) ; newVdsData.setSshPort ( 22 ) ; newVdsData.setSshUsername ( "root" ) ; newVdsData.setSshKeyFingerprint ( "1234" ) ; newVdsData.setVdsName ( "BAR" ) ; newVdsData.setVdsGroupCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "1.2.3" ) ) ; newVdsData.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newVdsData.setId ( vdsId ) ; return newVdsData ; }
Source:
public java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findUsers ( java.util.List < org.ovirt.engine.core.common.utils.ExternalId > ids ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserIdList , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByUserIdListParameters ( getName ( ) , ids , false ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ldapUsers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUsers ( ldapUsers ) ; }

Target:
public java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findUsers ( java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.compat.Guid > guids = new java.util.ArrayList < > ( ) ; for ( java.lang.String id : ids ) { guids.add ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( id ) ) ; } org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserIdList , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByUserIdListParameters ( getName ( ) , guids , true ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ldapUsers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUsers ( ldapUsers ) ; }
Source:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > > asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getBroker ( ) . connectStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getvds_spm_id ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getMasterDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getBroker ( ) . connectStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getvds_spm_id ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getMasterDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; proceedProxyReturnValue ( ) ; }
Source:
private boolean stopSuspendedVm ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setVm ( null ) ; final org.ovirt.engine.core.common.businessentities.VMStatus vmStatus = org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ; if ( vmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { return false ; } updateVmStatus ( VMStatus.ImageLocked ) ; if ( ! ( removeVmHibernationVolumes ( ) ) ) { updateVmStatus ( vmStatus ) ; return false ; } return true ; }

Target:
private boolean stopSuspendedVm ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setVm ( null ) ; final org.ovirt.engine.core.common.businessentities.VMStatus vmStatus = org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ; if ( vmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { return false ; } updateVmStatus ( VMStatus.ImageLocked ) ; if ( ! ( removeHibernationDisks ( ) ) ) { updateVmStatus ( vmStatus ) ; return false ; } return true ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.providers.ProviderListModel , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel > getProviderGeneralProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider ) { return new org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.providers.ProviderListModel , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel > ( eventBus , defaultConfirmPopupProvider , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderListModel.class , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel.class ) ; }

Target:
protected void configure ( ) { bind ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderListModel.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel.class ) . in ( com.google.inject.Singleton.class ) ; bind ( new com.google.inject.TypeLiteral < org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.providers.ProviderListModel , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel > > ( ) { } ) . to ( new com.google.inject.TypeLiteral < org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.providers.ProviderListModel , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel > > ( ) { } ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public java.lang.String convertFieldEnumValueToActualValue ( java.lang.String fieldValue ) { for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > e : map.entrySet ( ) ) { if ( fieldValue.toLowerCase ( ) . startsWith ( e.getValue ( ) ) ) { return e.getKey ( ) . toString ( ) ; } } return "" ; }

Target:
public java.lang.String convertFieldEnumValueToActualValue ( java.lang.String fieldValue ) { for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > e : map.entrySet ( ) ) { if ( fieldValue.equalsIgnoreCase ( e.getValue ( ) ) ) { return e.getKey ( ) . toString ( ) ; } } return "" ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedBonds ( org.ovirt.engine.core.compat.Guid ... ids ) { if ( emptyParameters ( ids ) ) { return this ; } if ( ( parameters.getRemovedBonds ( ) ) == null ) { parameters.setRemovedBonds ( new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ) ; } parameters.getRemovedBonds ( ) . addAll ( java.util.Arrays.asList ( ids ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedBonds ( org.ovirt.engine.core.compat.Guid ... ids ) { if ( nullParameters ( ids ) ) { return this ; } if ( ( parameters.getRemovedBonds ( ) ) == null ) { parameters.setRemovedBonds ( new java.util.HashSet < > ( ) ) ; } parameters.getRemovedBonds ( ) . addAll ( java.util.Arrays.asList ( ids ) ) ; return this ; }
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 getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
protected boolean validate ( org.ovirt.engine.core.bll.ValidationResult validationResult ) { if ( ! ( validationResult.isValid ( ) ) ) { addCanDoActionMessage ( validationResult.getMessage ( ) ) ; for ( java.lang.String variableReplacement : validationResult.getVariableReplacements ( ) ) { addCanDoActionMessage ( variableReplacement ) ; } } return validationResult.isValid ( ) ; }

Target:
protected final boolean failValidation ( org.ovirt.engine.core.common.errors.EngineMessage message , java.lang.String ... variableReplacements ) { addValidationMessage ( message ) ; for ( java.lang.String variableReplacement : variableReplacements ) { addValidationMessage ( variableReplacement ) ; } return false ; }
Source:
public static void getTemplateListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesByStoragePoolId , new org.ovirt.engine.core.common.queries.GetVmTemplatesByStoragePoolIdParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.GlusterVolumeType glusterVolumeType , java.lang.String template ) { switch ( glusterVolumeType ) { case DISTRIBUTE : return GlusterVolumeType.DISTRIBUTE.value ( ) ; case REPLICATE : return GlusterVolumeType.REPLICATE.value ( ) ; case DISTRIBUTED_REPLICATE : return GlusterVolumeType.DISTRIBUTED_REPLICATE.value ( ) ; case STRIPE : return GlusterVolumeType.STRIPE.value ( ) ; case DISTRIBUTED_STRIPE : return GlusterVolumeType.DISTRIBUTED_STRIPE.value ( ) ; default : return null ; } }

Target:
public static java.lang.String map ( org.ovirt.engine.api.model.GlusterVolumeType glusterVolumeType , java.lang.String template ) { switch ( glusterVolumeType ) { case DISTRIBUTE : return GlusterVolumeType.DISTRIBUTE.value ( ) ; case REPLICATE : return GlusterVolumeType.REPLICATE.value ( ) ; case DISTRIBUTED_REPLICATE : return GlusterVolumeType.DISTRIBUTED_REPLICATE.value ( ) ; case STRIPE : return GlusterVolumeType.STRIPE.value ( ) ; case DISTRIBUTED_STRIPE : return GlusterVolumeType.DISTRIBUTED_STRIPE.value ( ) ; case STRIPED_REPLICATE : return GlusterVolumeType.STRIPED_REPLICATE.value ( ) ; case DISTRIBUTED_STRIPED_REPLICATE : return GlusterVolumeType.DISTRIBUTED_STRIPED_REPLICATE.value ( ) ; default : 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 ( ( ( getRaidTypeList ( ) . getSelectedItem ( ) ) != ( org.ovirt.engine.core.common.businessentities.RaidType.None ) ) && ( ( getRaidTypeList ( ) . getSelectedItem ( ) ) != ( org.ovirt.engine.core.common.businessentities.RaidType.Raid0 ) ) ) { getNoOfPhysicalDisksInRaidVolume ( ) . setIsAvailable ( true ) ; getStripeSize ( ) . setIsAvailable ( true ) ; } else { getNoOfPhysicalDisksInRaidVolume ( ) . setIsAvailable ( false ) ; getStripeSize ( ) . setIsAvailable ( false ) ; } onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "raidTypeChanged" ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getRaidTypeList ( ) . getSelectedItem ( ) ) != ( org.ovirt.engine.core.common.businessentities.RaidType.NONE ) ) && ( ( getRaidTypeList ( ) . getSelectedItem ( ) ) != ( org.ovirt.engine.core.common.businessentities.RaidType.RAID0 ) ) ) { getNoOfPhysicalDisksInRaidVolume ( ) . setIsAvailable ( true ) ; getStripeSize ( ) . setIsAvailable ( true ) ; } else { getNoOfPhysicalDisksInRaidVolume ( ) . setIsAvailable ( false ) ; getStripeSize ( ) . setIsAvailable ( false ) ; } onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "raidTypeChanged" ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.ImageTransfer imageTransfer ) { org.ovirt.engine.core.common.action.TransferDiskImageParameters params = new org.ovirt.engine.core.common.action.TransferDiskImageParameters ( ) ; if ( ( imageTransfer.isSetDirection ( ) ) && ( ( imageTransfer.getDirection ( ) ) == ( org.ovirt.engine.api.model.ImageTransferDirection.DOWNLOAD ) ) ) { params.setTransferType ( TransferType.Download ) ; } params.setImageId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( imageTransfer.getImage ( ) . getId ( ) ) ) ; return performCreate ( ActionType.TransferDiskImage , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetImageTransferById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response addForImage ( org.ovirt.engine.api.model.ImageTransfer imageTransfer ) { org.ovirt.engine.core.common.action.TransferDiskImageParameters params = new org.ovirt.engine.core.common.action.TransferDiskImageParameters ( ) ; params.setImageGroupID ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( imageTransfer.getImage ( ) . getId ( ) ) ) ; return performCreate ( imageTransfer , params ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageByImageId ( parameters.getImageId ( ) ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getCurrentUser ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageByImageId ( parameters.getImageId ( ) ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( diskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getCurrentUser ( ) ) ) ; }
Source:
public static void GetDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , 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.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
private org.ovirt.engine.api.model.Permits getPermits ( ) { org.ovirt.engine.api.model.Permits permits = new org.ovirt.engine.api.model.Permits ( ) ; for ( org.ovirt.engine.api.model.PermitType permit : org.ovirt.engine.api.model.PermitType.values ( ) ) { permits.getPermits ( ) . add ( map ( permit ) ) ; } return permits ; }

Target:
private void addSupportedQosTypes ( org.ovirt.engine.api.model.VersionCaps version ) { version.setQosTypes ( new org.ovirt.engine.api.model.QosTypes ( ) ) ; if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_3 ) ) { addQosTypes ( version , QosType.NETWORK ) ; } if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { addQosTypes ( version , QosType.STORAGE , QosType.CPU ) ; } if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_6 ) ) { addQosTypes ( version , QosType.HOSTNETWORK ) ; } }
Source:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; updateOSValues ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateVirtioScsiAvailability ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; updateOSValues ( ) ; if ( ( getModel ( ) . getTemplateWithVersion ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplateWithVersion ( ) . getSelectedItem ( ) . getTemplateVersion ( ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateVirtioScsiAvailability ( ) ; }