auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldPool = org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPoolDao ( ) . get ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPool ( ) . getVmPoolId ( ) ) ; if ( ( oldPool ) == null ) { return failCanDoAction ( EngineMessage.VM_POOL_CANNOT_UPDATE_POOL_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) < 0 ) { return failCanDoAction ( EngineMessage.VM_POOL_CANNOT_DECREASE_VMS_FROM_POOL ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } oldPool = org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPoolDao ( ) . get ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPool ( ) . getVmPoolId ( ) ) ; if ( ( oldPool ) == null ) { return failValidation ( EngineMessage.VM_POOL_CANNOT_UPDATE_POOL_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) < 0 ) { return failValidation ( EngineMessage.VM_POOL_CANNOT_DECREASE_VMS_FROM_POOL ) ; } return true ; }
Source:
protected boolean validateSpaceRequirements ( ) { if ( ! ( isStorageDomainSpaceWithinThresholds ( ) ) ) { return false ; } org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getSnapshots ( ) . addAll ( getAllImageSnapshots ( ) ) ; if ( ! ( isDomainHasStorageSpaceForRequest ( ) ) ) { return false ; } return true ; }

Target:
protected boolean validateSpaceRequirements ( ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = createStorageDomainValidator ( ) ; if ( validate ( storageDomainValidator.isDomainWithinThresholds ( ) ) ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getSnapshots ( ) . addAll ( getAllImageSnapshots ( ) ) ; return validate ( storageDomainValidator.hasSpaceForClonedDisk ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) ) ; } return false ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profile ) { driver.edit ( profile ) ; initCustomPropertySheet ( profile ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { networkEditor.setLabel ( constants.networkProfilePopup ( ) ) ; nameEditor.setLabel ( constants.nameProfilePopup ( ) ) ; descriptionEditor.setLabel ( constants.descriptionProfilePopup ( ) ) ; portMirroringEditor.setLabel ( constants.portMirroringProfilePopup ( ) ) ; publicUseEditor.setLabel ( constants.publicUseProfilePopup ( ) ) ; }
Source:
protected void onEntityChanged ( ) { if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ( this ) ; } else if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ( this ) ; } else { throw new java.lang.UnsupportedOperationException ( ) ; } behavior.onEntityChanged ( ) ; }

Target:
public void setLargeIconId ( org.ovirt.engine.core.compat.Guid largeIconId ) { if ( ! ( java.util.Objects.equals ( this . largeIconId , largeIconId ) ) ) { this . largeIconId = largeIconId ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "LargeIconId" ) ) ; } }
Source:
public void checkMissingIpAddressDetailsBootProtocolStatic ( ) { final boolean initAddress = random.nextBoolean ( ) ; initIpConfigurationDetails ( Ipv4BootProtocol.STATIC_IP , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_STATIC_BOOT_PROTOCOL_MISSING_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) ) ) ; }

Target:
public void checkMissingV4BootProtocol ( ) { initIpv4ConfigurationWithPrimaryAddress ( ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_MISSING_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc glusterVolumeGeoRepSessionStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response = vdsServer.glusterVolumeGeoRepSessionStatus ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc ( response ) ; } 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 glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String userName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepConfigReset ( volumeName , slaveHost , slaveVolumeName , configKey , userName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > getGraphicsTypesForEntity ( org.ovirt.engine.api.restapi.resource.BackendResource backendResource , org.ovirt.engine.core.compat.Guid id ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = backendResource.getEntity ( java.util.List.class , VdcQueryType.GetGraphicsDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , "GetGraphicsDevices" , true ) ; if ( graphicsDevices != null ) { for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : graphicsDevices ) { graphicsTypes.add ( graphicsDevice.getGraphicsType ( ) ) ; } } return graphicsTypes ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > getGraphicsDevicesForEntity ( org.ovirt.engine.api.restapi.resource.BackendResource backendResource , org.ovirt.engine.core.compat.Guid id ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = backendResource.getEntity ( java.util.List.class , VdcQueryType.GetGraphicsDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , id.toString ( ) , true ) ; return graphicsDevices ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; command.insertAsyncTaskPlaceHolders ( ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; command.insertAsyncTaskPlaceHolders ( ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }
Source:
protected void executeQueryCommand ( ) { setReturnValue ( org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getDbFacade ( ) . getDiskDao ( ) . getAllAttachableDisksByPoolId ( org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { setReturnValue ( diskDao.getAllAttachableDisksByPoolId ( org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
protected void initMtu ( ) { getHasMtu ( ) . setEntity ( ( ( getNetwork ( ) . getMtu ( ) ) != 0 ) ) ; getMtu ( ) . setEntity ( ( ( getNetwork ( ) . getMtu ( ) ) != 0 ? getNetwork ( ) . getMtu ( ) : null ) ) ; }

Target:
protected void initMtu ( ) { boolean isCustomMtu = ( getNetwork ( ) . getMtu ( ) ) != 0 ; getMtuSelector ( ) . setSelectedItem ( ( isCustomMtu ? MtuSelector.customMtu : MtuSelector.defaultMtu ) ) ; getMtu ( ) . setEntity ( ( isCustomMtu ( ) ? getNetwork ( ) . getMtu ( ) : null ) ) ; }
Source:
public void setInputFieldsEnabled ( boolean enabled ) { nameEditor.setEnabled ( enabled ) ; descriptionEditor.setEnabled ( enabled ) ; isVmNetworkEditor.setEnabled ( enabled ) ; vlanTagging.setEnabled ( enabled ) ; vlanTag.setEnabled ( enabled ) ; hasMtuEditor.setEnabled ( enabled ) ; mtuEditor.setEnabled ( enabled ) ; }

Target:
public void setMtuEnabled ( boolean flag ) { mtuEditor.setEnabled ( flag ) ; }
Source:
public 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterDesktopMemoryOverCommit ( 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected boolean canDetachDomain ( boolean isDestroyStoragePool , boolean isRemoveLast , boolean isInternal ) { return ( ( ( ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.checkStoragePool ( ) ) && ( checkStorageDomain ( ) ) ) && ( checkStorageDomainStatus ( StorageDomainStatus.Inactive , StorageDomainStatus.Maintenance ) ) ) && ( ( ( isMaster ( ) ) || isDestroyStoragePool ) || ( checkMasterDomainIsUp ( ) ) ) ) && ( isNotLocalData ( isInternal ) ) ) && ( isDetachAllowed ( isRemoveLast ) ) ; }

Target:
protected boolean canDetachDomain ( boolean isDestroyStoragePool , boolean isRemoveLast , boolean isInternal ) { return ( ( ( ( ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.checkStoragePool ( ) ) && ( checkStorageDomain ( ) ) ) && ( checkStorageDomainStatus ( StorageDomainStatus.Inactive , StorageDomainStatus.Maintenance ) ) ) && ( ( ( isMaster ( ) ) || isDestroyStoragePool ) || ( checkMasterDomainIsUp ( ) ) ) ) && ( isNotLocalData ( isInternal ) ) ) && ( isDetachAllowed ( isRemoveLast ) ) ) && ( isCinderStorageHasNoDisks ( ) ) ; }
Source:
public void testInputDataOk ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; org.mockito.Mockito.doReturn ( mockVm ( GraphicsType.SPICE ) ) . when ( getQuery ( ) ) . getCachedVm ( ) ; org.junit.Assert.assertTrue ( getQuery ( ) . validateInputs ( ) ) ; }

Target:
public void testInputDataOk ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; org.mockito.Mockito.doReturn ( mockVm ( GraphicsType.SPICE ) ) . when ( getQuery ( ) ) . getCachedVm ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( getQuery ( ) . validateInputs ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails getNetworkImplementationDetails ( ) { if ( ! ( isAttached ( ) ) ) { return null ; } org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = ( hasVlan ( ) ) ? getVlanNicModel ( ) . getIface ( ) : getAttachedToNic ( ) . getIface ( ) ; return nic.getNetworkImplementationDetails ( ) ; }

Target:
public boolean isManaged ( ) { return ! ( ( isAttached ( ) ) && ( ( getNetworkAttachment ( ) ) == null ) ) ; }
Source:
protected boolean validate ( ) { if ( ! ( checkRemoveEditValidations ( ) ) ) { return false ; } if ( ( getVdsGroupDao ( ) . getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) . size ( ) ) > 0 ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE , java.lang.String.format ( "$clusters %1$s" , clustersListIntoTokenizedString ( ) ) ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( checkRemoveEditValidations ( ) ) ) { return false ; } if ( ( getClusterDao ( ) . getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) . size ( ) ) > 0 ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE , java.lang.String.format ( "$clusters %1$s" , clustersListIntoTokenizedString ( ) ) ) ; } return true ; }
Source:
public static java.lang.String encryptPassword ( java.lang.String password ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( password ) ) { return password ; } java.lang.String keyFile = org.ovirt.engine.core.common.config.Config.resolveKeyStorePath ( ) ; java.lang.String passwd = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.keystorePass , ConfigCommon.defaultConfigurationVersion ) ; java.lang.String alias = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.CertAlias , ConfigCommon.defaultConfigurationVersion ) ; try { return org.ovirt.engine.core.engineencryptutils.EncryptionUtils.encrypt ( password , keyFile , passwd , alias ) ; } catch ( java.lang.Exception e ) { throw new java.lang.SecurityException ( e ) ; } }

Target:
public static java.lang.String encryptPassword ( java.lang.String password ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( password ) ) { return password ; } java.lang.String keyFile = org.ovirt.engine.core.common.config.Config.resolveKeyStorePath ( ) ; java.lang.String passwd = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.keystorePass , ConfigCommon.defaultConfigurationVersion ) ; java.lang.String alias = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.CertAlias , ConfigCommon.defaultConfigurationVersion ) ; try { return org.ovirt.engine.core.utils.crypt.EncryptionUtils.encrypt ( password , keyFile , passwd , alias ) ; } catch ( java.lang.Exception e ) { throw new java.lang.SecurityException ( e ) ; } }
Source:
public org.ovirt.engine.api.model.Groups list ( ) { return mapDbGroupsCollection ( getGroupsCollection ( SearchType.DBUser , getSearchPattern ( ) ) ) ; }

Target:
private org.ovirt.engine.api.model.Groups mapDbGroupCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.DbGroup > entities ) { org.ovirt.engine.api.model.Groups collection = new org.ovirt.engine.api.model.Groups ( ) ; for ( org.ovirt.engine.core.common.businessentities.DbGroup entity : entities ) { org.ovirt.engine.api.model.Group group = map ( entity ) ; group = populate ( group , entity ) ; group = addLinks ( group , org.ovirt.engine.api.model.BaseResource.class ) ; collection.getGroups ( ) . add ( group ) ; } return collection ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Cluster cluster ) { validateParameters ( cluster , "name" , "dataCenter.name|id" ) ; validateEnums ( org.ovirt.engine.api.model.Cluster.class , cluster ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.getStoragePool ( cluster.getDataCenter ( ) , this ) ; org.ovirt.engine.core.common.businessentities.VDSGroup entity = map ( cluster , map ( pool ) ) ; return performCreate ( VdcActionType.AddVdsGroup , new org.ovirt.engine.core.common.action.AddClusterOperationParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Cluster cluster ) { validateParameters ( cluster , getMandatoryParameters ( ) ) ; validateEnums ( org.ovirt.engine.api.model.Cluster.class , cluster ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( cluster ) ; return performCreate ( VdcActionType.AddVdsGroup , createAddCommandParams ( cluster , dataCenter ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void getUsbPolicyUsbTypeNull31 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setCompatibilityVersion ( Version.v3_1 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }

Target:
public void getUsbPolicyOnUpdateCurrentlyNativeGotNullUsb ( ) { org.ovirt.engine.api.model.Usb usb = null ; org.ovirt.engine.core.common.businessentities.UsbPolicy currentPolicy = org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_NATIVE ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , currentPolicy ) , currentPolicy ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( templates , new org.ovirt.engine.ui.uicommonweb.Linq.VmTemplateComparator ( ) ) ; setItems ( templates ) ; setIsEmpty ( ( ( templates.size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( templates , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; setItems ( templates ) ; setIsEmpty ( ( ( templates.size ( ) ) == 0 ) ) ; }
Source:
private void updateSizeInDb ( ) { org.ovirt.engine.core.compat.Guid diskImage = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getBaseImage ( ) . getImageId ( ) ; long sizeInBytes = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getTopImage ( ) . getSize ( ) ; org.ovirt.engine.core.bll.MergeExtendCommand.getDbFacade ( ) . getImageDao ( ) . updateImageSize ( diskImage , sizeInBytes ) ; org.ovirt.engine.core.bll.MergeExtendCommand.log.info ( "Updated size of image to {}" , diskImage , sizeInBytes ) ; }

Target:
private void updateSizeInDb ( ) { org.ovirt.engine.core.compat.Guid diskImage = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getBaseImage ( ) . getImageId ( ) ; long sizeInBytes = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getTopImage ( ) . getSize ( ) ; org.ovirt.engine.core.bll.MergeExtendCommand.log.info ( "Updating size of image to {}" , diskImage , sizeInBytes ) ; org.ovirt.engine.core.bll.MergeExtendCommand.getDbFacade ( ) . getImageDao ( ) . updateImageSize ( diskImage , sizeInBytes ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { if ( ( ( diskVm ) == null ) && ( ( getDisk ( ) ) != null ) ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVmDAO ( ) . getVmsListForDisk ( getDisk ( ) . getId ( ) , false ) ) { diskVm = vm ; break ; } } return diskVm ; }

Target:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { if ( ( ( diskVm ) == null ) && ( ( getDisk ( ) ) != null ) ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVmDao ( ) . getVmsListForDisk ( getDisk ( ) . getId ( ) , false ) ) { diskVm = vm ; break ; } } return diskVm ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAllForUserAndGroups ( org.ovirt.engine.core.compat.Guid id , java.lang.String groupIds ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , id ) . addValue ( "group_ids" , groupIds ) ; return getCallsHandler ( ) . executeReadList ( "GetAllRolesByUserIdAndGroupIds" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAllForUserAndGroups ( org.ovirt.engine.core.compat.Guid id , java.lang.String groupIds , int appMode ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , id ) . addValue ( "group_ids" , groupIds ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetAllRolesByUserIdAndGroupIds" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }
Source:
private java.lang.String [ ] GetUserNameParts ( java.lang.String value ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( value ) ) ) { int index = value.indexOf ( '@' ) ; return new java.lang.String [ ] { index > ( - 1 ) ? value.substring ( 0 , index ) : value , index > ( - 1 ) ? value.substring ( ( index + 1 ) ) : null } ; } return new java.lang.String [ ] { "" , null } ; }

Target:
private java.lang.String [ ] getUserNameParts ( java.lang.String value ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( value ) ) ) { int index = value.indexOf ( '@' ) ; return new java.lang.String [ ] { index > ( - 1 ) ? value.substring ( 0 , index ) : value , index > ( - 1 ) ? value.substring ( ( index + 1 ) ) : null } ; } return new java.lang.String [ ] { "" , null } ; }
Source:
public void testQueryWithNonExistingHostId ( ) { org.ovirt.engine.core.common.queries.VdsIdParametersBase params = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.GetoVirtISOsQuery < org.ovirt.engine.core.common.queries.VdsIdParametersBase > query = new org.ovirt.engine.core.bll.GetoVirtISOsQuery < org.ovirt.engine.core.common.queries.VdsIdParametersBase > ( params ) ; query.setInternalExecution ( true ) ; query.ExecuteCommand ( ) ; checkSucceeded ( query , true ) ; checkReturnValue ( query ) ; }

Target:
public void testQueryWithNonExistingHostId ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVdsId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . ExecuteCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.GetoVirtISOsTest.checkReturnValue ( getQuery ( ) ) ; }
Source:
private boolean isVncSelected ( ) { boolean isVnc = false ; if ( ( getDisplayProtocol ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.DisplayType displayType = getDisplayProtocol ( ) . getSelectedItem ( ) . getEntity ( ) ; isVnc = displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.vnc ) ; } return isVnc ; }

Target:
public boolean isNumaChanged ( ) { return ( numaChanged ) || ( ( initialsNumaNodeCount ) != ( getNumaNodeCount ( ) . getEntity ( ) ) ) ; }
Source:
public void shouldNotMigrateVmOnClusterTwoWhenEnforced ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.eq ( cluster2 ) ) ) . thenReturn ( null ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void shouldNotMigrateVmOnClusterTwoWhenEnforced ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.ArgumentMatchers.eq ( cluster2 ) ) ) . thenReturn ( null ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc getVGList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getVGList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extend_image_ticket ( java.lang.String ticketId , long timeout ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.extend_image_ticket ( ticketId , timeout ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.optimizer.common.ScoreResult recomputeScore ( org.ovirt.optimizer.service.problemspace.OptimalDistributionStepsSolution situation , org.ovirt.optimizer.common.Result result ) { org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore score = org.ovirt.optimizer.service.ClusterOptimizer.computeScore ( situation , result.getMigrations ( ) , configProvider.customRuleFiles ( ) ) ; org.ovirt.optimizer.common.ScoreResult scoreResult = new org.ovirt.optimizer.common.ScoreResult ( ) ; scoreResult.setHardScore ( score.getHardScore ( ) ) ; scoreResult.setSoftScore ( score.getSoftScore ( ) ) ; return scoreResult ; }

Target:
public org.ovirt.optimizer.common.ScoreResult recomputeScore ( org.ovirt.optimizer.service.problemspace.OptimalDistributionStepsSolution situation , org.ovirt.optimizer.common.Result result ) { org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore score = org.ovirt.optimizer.service.ClusterOptimizer.computeScore ( situation , result.getMigrations ( ) , java.util.Collections.< java.lang.String > emptySet ( ) , configProvider.customRuleFiles ( ) ) ; org.ovirt.optimizer.common.ScoreResult scoreResult = new org.ovirt.optimizer.common.ScoreResult ( ) ; scoreResult.setHardScore ( score.getHardScore ( ) ) ; scoreResult.setSoftScore ( score.getSoftScore ( ) ) ; return scoreResult ; }
Source:
private void buildDictionaries ( ) { for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { mVerbs.put ( field.fieldName , field.displayName ) ; } buildCompletions ( ) ; for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { getTypeDictionary ( ) . put ( field.fieldName , field.fieldType ) ; } for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { mColumnNameDict.put ( field.fieldName , field.columnName ) ; } buildBasicValidationTable ( ) ; }

Target:
private void buildDictionaries ( ) { for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { mVerbs.put ( field.fieldName , field.displayName ) ; } buildCompletions ( ) ; for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { getTypeDictionary ( ) . put ( field.fieldName , field.fieldType ) ; } for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { columnNameDict.put ( field.fieldName , field.columnName ) ; } buildBasicValidationTable ( ) ; }
Source:
public void performAction ( ) { if ( ( ( ! ( this . isInInit ( ) ) ) && ( this . policy.isOutgoingHeartbeat ( ) ) ) && ( this . isOutgoingHeartbeatExeeded ( ) ) ) { this . sendHeartbeat ( ) ; } }

Target:
public void performAction ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( ( ! ( this . isInInit ( ) ) ) && ( this . policy.isOutgoingHeartbeat ( ) ) ) && ( this . isOutgoingHeartbeatExeeded ( ) ) ) { this . sendHeartbeat ( ) ; this . processOutgoing ( ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateSelectedBricksActions ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( getShowBricksList ( ) . getEntity ( ) ) { getBricksFromServer ( ) . setIsAvailable ( true ) ; getBrickDirectory ( ) . setIsAvailable ( false ) ; updateBricksFromHost ( ) ; } else { getBricksFromServer ( ) . setIsAvailable ( false ) ; getBrickDirectory ( ) . setIsAvailable ( true ) ; } }
Source:
public java.lang.Object runInTransaction ( ) { try { org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } return null ; }

Target:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName , java.lang.String snapshotName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue ; if ( snapshotName == null ) { xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( "" , volumeName ) ; } else { xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( snapshotName , volumeName ) ; } org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , volumeName , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterSnapshotActivate ( java.lang.String snapshotName , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterSnapshotActivate ( snapshotName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void waitUntilCheck ( java.util.function.Predicate < org.ovirt.vdsm.jsonrpc.client.JsonRpcClient > check , java.lang.String formatBefore , java.lang.String formatAfter ) throws java.lang.InterruptedException { java.lang.String hostname = client.getHostname ( ) ; org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( formatBefore , hostname ) ; int retries = 50 ; while ( check.test ( this . client ) ) { if ( retries == 0 ) { throw new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( ( ( "Unable to reconnect to " + hostname ) + " after policy reset" ) ) ; } retries -- ; java.util.concurrent.TimeUnit.MILLISECONDS.sleep ( 200 ) ; } org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( formatAfter , hostname ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc sparsifyVolume ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > volumeAddress ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.sparsify_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , volumeAddress ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void testSaveInterfaceForVds ( ) { newVdsInterface.setVdsId ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.VDS_ID ) ; dao.saveInterfaceForVds ( newVdsInterface ) ; dao.saveStatisticsForVds ( newVdsStatistics ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result = dao.getAllInterfacesForVds ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.VDS_ID ) ; boolean found = false ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : result ) { found |= iface.getName ( ) . equals ( newVdsInterface.getName ( ) ) ; } org.junit.Assert.assertTrue ( found ) ; }

Target:
public void testSaveInterfaceForVds ( ) { newVdsInterface.setVdsId ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.VDS_ID ) ; dao.saveInterfaceForVds ( newVdsInterface ) ; dao.saveStatisticsForVds ( newVdsStatistics ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result = dao.getAllInterfacesForVds ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.VDS_ID ) ; boolean found = false ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : result ) { found |= ( iface.getName ( ) . equals ( newVdsInterface.getName ( ) ) ) && ( iface.getQos ( ) . equals ( newVdsInterface.getQos ( ) ) ) ; } org.junit.Assert.assertTrue ( found ) ; }
Source:
public boolean isMacInUse ( java.lang.String mac ) { lockObj.readLock ( ) . lock ( ) ; try { return ( allocatedMacs.contains ( mac ) ) || ( allocatedCustomMacs.contains ( mac ) ) ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }

Target:
public boolean addMac ( java.lang.String mac ) { boolean retVal = false ; lockObj.writeLock ( ) . lock ( ) ; try { if ( availableMacs.contains ( mac ) ) { retVal = commitNewMac ( mac ) ; } else if ( allocatedMacs.containsKey ( mac ) ) { retVal = addMacToMap ( allocatedMacs , mac ) ; } else { retVal = addMacToMap ( allocatedCustomMacs , mac ) ; } } finally { lockObj.writeLock ( ) . unlock ( ) ; } return retVal ; }
Source:
private void verifyCertificate ( org.ovirt.engine.api.model.VM model ) { assertNotNull ( model.getDisplay ( ) ) ; assertNotNull ( model.getDisplay ( ) . getCertificate ( ) ) ; assertEquals ( model.getDisplay ( ) . getCertificate ( ) . getSubject ( ) , org.ovirt.engine.api.restapi.resource.BackendVmResourceTest.CERTIFICATE ) ; }

Target:
protected void setUpGetNoPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , null ) ; } }
Source:
public void Activate ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ActivateVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void OnApproveInternal ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ApproveVds , new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.action.VdcActionParametersBase [ ] { new org.ovirt.engine.core.common.action.ApproveVdsParameters ( vds.getId ( ) ) } ) ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
private static void addVideoDevice ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.VIDEO , vm.getDefaultDisplayType ( ) . getVmDeviceType ( ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getMemExpr ( vm.getNumOfMonitors ( ) , vm.getSingleQxlPci ( ) ) , true , true , null ) ; }

Target:
private static void addVideoDevice ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.common.utils.VmDeviceType vmDeviceType = org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.getDisplayDevice ( vm.getOsId ( ) , org.ovirt.engine.core.bll.utils.ClusterUtils.getCompatibilityVersion ( vm ) , vm.getDefaultDisplayType ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.VIDEO , vmDeviceType , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getMemExpr ( vm.getNumOfMonitors ( ) , vm.getSingleQxlPci ( ) ) , true , true , null ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MaxMemSize64 ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; }

Target:
private void updateBootMenu ( ) { if ( ( getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.compat.Version version = getSelectedCluster ( ) . getcompatibility_version ( ) ; final boolean supported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isBootMenuSupported ( version.toString ( ) ) ; if ( ! supported ) { getBootMenuEnabled ( ) . setEntity ( false ) ; getBootMenuEnabled ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . bootMenuNotSupported ( version.toString ( 2 ) ) ) ; } getBootMenuEnabled ( ) . setIsChangable ( supported ) ; } }
Source:
public void getClustersHavingHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getClustersHavingHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void SaveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( storageModel.getSelectedItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { OnSaveSanStorage ( ) ; } else { ForceCreationWarning ( usedLunsMessages ) ; } }

Target:
private void saveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( storageModel.getSelectedItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { OnSaveSanStorage ( ) ; } else { forceCreationWarning ( usedLunsMessages ) ; } }
Source:
public void testPositiveCanDoActionWithNoDisks ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testPositiveCanDoActionWithNoDisks ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }
Source:
public void setModel ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel nodeModel , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > numaNodeList ) { numaPanel.setModel ( nodeModel ) ; this . nodeModel = nodeModel ; createMenu ( numaNodeList , nodeModel.getVmNumaNode ( ) . getIndex ( ) ) ; }

Target:
public void setModel ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel nodeModel , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > numaNodeList ) { numaPanel.setModel ( nodeModel ) ; this . nodeModel = nodeModel ; if ( nodeModel.isLocked ( ) ) { enableDrag ( false ) ; } else { createMenu ( numaNodeList , nodeModel.getVmNumaNode ( ) . getIndex ( ) ) ; } }