auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmInit > getVmInitByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > ids , boolean secure ) { org.ovirt.engine.core.dao.VmInitDAO db = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmInitDao ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmInit > all = db.getVmInitByIds ( ids ) ; for ( org.ovirt.engine.core.common.businessentities.VmInit vmInit : all ) { if ( secure ) { vmInit.setPasswordAlreadyStored ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vmInit.getRootPassword ( ) ) ) ) ) ; vmInit.setRootPassword ( null ) ; } else { vmInit.setPasswordAlreadyStored ( false ) ; } } return all ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmInit > getVmInitByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > ids , boolean secure ) { org.ovirt.engine.core.dao.VmInitDao db = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmInitDao ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmInit > all = db.getVmInitByIds ( ids ) ; for ( org.ovirt.engine.core.common.businessentities.VmInit vmInit : all ) { if ( secure ) { vmInit.setPasswordAlreadyStored ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vmInit.getRootPassword ( ) ) ) ) ) ; vmInit.setRootPassword ( null ) ; } else { vmInit.setPasswordAlreadyStored ( false ) ; } } return all ; }
Source:
public void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) , vmId ) ; }

Target:
public static void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap ) { try { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addDisk ( image ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }
Source:
private void applyNextRunConfiguration ( ) { org.ovirt.engine.core.common.businessentities.Snapshot runSnap = getSnapshotDAO ( ) . get ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.NEXT_RUN ) ; if ( runSnap != null ) { getSnapshotDAO ( ) . remove ( runSnap.getId ( ) ) ; java.util.Date originalCreationDate = org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getVmCreationDate ( ) ; new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . updateVmFromConfiguration ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) , runSnap.getVmConfiguration ( ) ) ; org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . setVmCreationDate ( originalCreationDate ) ; runInternalAction ( VdcActionType.UpdateVm , updateVmParams ) ; } }

Target:
private void applyNextRunConfiguration ( ) { org.ovirt.engine.core.common.businessentities.Snapshot runSnap = getSnapshotDAO ( ) . get ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.NEXT_RUN ) ; if ( runSnap != null ) { getSnapshotDAO ( ) . remove ( runSnap.getId ( ) ) ; java.util.Date originalCreationDate = org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getVmCreationDate ( ) ; new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . updateVmFromConfiguration ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) , runSnap.getVmConfiguration ( ) ) ; org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . setVmCreationDate ( originalCreationDate ) ; runInternalAction ( VdcActionType.UpdateVm , createUpdateVmParameters ( ) ) ; } }
Source:
protected void setUpGetClusterExpectations ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setStoragePoolId ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , cluster , null ) ; }

Target:
protected void setUpGetClusterExpectations ( int times , java.lang.Object failure ) { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setStoragePoolId ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , cluster , null ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.ProviderType [ ] providerTypes = org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getParameters ( ) . getProviderTypes ( ) ; if ( providerTypes == null ) { setReturnValue ( org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getDbFacade ( ) . getProviderDao ( ) . getAll ( ) ) ; } else { setReturnValue ( org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getDbFacade ( ) . getProviderDao ( ) . getAllByTypes ( providerTypes ) ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.ProviderType [ ] providerTypes = org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getParameters ( ) . getProviderTypes ( ) ; if ( providerTypes == null ) { setReturnValue ( providerDao.getAll ( ) ) ; } else { setReturnValue ( providerDao.getAllByTypes ( providerTypes ) ) ; } }
Source:
public static void GetDiskMaxSize ( 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 ( ) : 2047 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxDiskSize ) , aQuery ) ; }

Target:
public static void GetMaxVmsInPool ( 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 ( ) : 1000 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVmsInPool ) , aQuery ) ; }
Source:
public java.lang.Boolean call ( ) { try { proxy.deleteSnapshot ( snapshotId.toString ( ) ) ; return true ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } }

Target:
public boolean deleteSnapshot ( final org.ovirt.engine.core.compat.Guid snapshotId ) { return execute ( ( ) -> { try { proxy.deleteSnapshot ( snapshotId.toString ( ) ) ; return true ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } } ) ; }
Source:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . remove ( iface.getId ( ) ) ; } }

Target:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.bll.VmTemplateCommand.getVmNicDao ( ) . remove ( iface.getId ( ) ) ; } }
Source:
public void isUSBEnabledByDefault ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback getCallback ( ) { if ( ( cachedCallback ) == null ) { cachedCallback = new org.ovirt.engine.core.bll.ConvertVmCallback ( org.ovirt.engine.core.bll.ConvertVmCommand.getCommandId ( ) ) ; if ( ( getCommandExecutionStatus ( ) ) == ( org.ovirt.engine.core.compat.backendcompat.CommandExecutionStatus.EXECUTED ) ) { getVdsManager ( ) . addV2VJobInfoForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) , JobStatus.UNKNOWN ) ; } } return cachedCallback ; }

Target:
private void monitorV2VJob ( org.ovirt.engine.core.common.businessentities.V2VJobInfo.JobStatus initialJobStatus ) { getVdsManager ( ) . addV2VJobInfoForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) , initialJobStatus ) ; getVmManager ( ) . setConvertProxyHostId ( org.ovirt.engine.core.bll.ConvertVmCommand.getVdsId ( ) ) ; }
Source:
protected void init ( M model ) { items.clear ( ) ; contentPanel.clear ( ) ; modelItems = ( ( java.util.Collection < T > ) ( model.getItems ( ) ) ) ; if ( ( modelItems ) == null ) { modelItems = new java.util.LinkedList < T > ( ) ; model.setItems ( modelItems ) ; return ; } for ( T value : modelItems ) { addEntry ( value ) ; } addGhostEntry ( ) ; }

Target:
protected void init ( M model ) { items.clear ( ) ; contentPanel.clear ( ) ; modelItems = ( ( java.util.Collection < T > ) ( model.getItems ( ) ) ) ; if ( ( modelItems ) == null ) { modelItems = new java.util.LinkedList < T > ( ) ; model.setItems ( modelItems ) ; return ; } for ( T value : modelItems ) { addEntry ( value ) ; } T additionalValue = addGhostEntry ( ) . getFirst ( ) ; modelItems.add ( additionalValue ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getClustersByServiceAndCompatibilityVersion ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > possiblyEligibleClusters = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup possiblyEligibleVDSGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; possiblyEligibleVDSGroup.setId ( baseTest.getSLAVE_CLUSTER_ID ( ) ) ; possiblyEligibleClusters.add ( possiblyEligibleVDSGroup ) ; return possiblyEligibleClusters ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > getClustersByServiceAndCompatibilityVersion ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > possiblyEligibleClusters = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.Cluster possiblyEligibleCluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; possiblyEligibleCluster.setId ( baseTest.getSLAVE_CLUSTER_ID ( ) ) ; possiblyEligibleClusters.add ( possiblyEligibleCluster ) ; return possiblyEligibleClusters ; }
Source:
private void updatePanelsVisibility ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel model ) { exportPanel.setVisible ( ( ( model.getImportSources ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.EXPORT_DOMAIN ) ) ) ; vmwarePanel.setVisible ( ( ( model.getImportSources ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.VMWARE ) ) ) ; }

Target:
private void updatePanelsVisibility ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel model ) { exportPanel.setVisible ( ( ( model.getImportSources ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.EXPORT_DOMAIN ) ) ) ; vmwarePanel.setVisible ( ( ( model.getImportSources ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.VMWARE ) ) ) ; vmwareProvidersEditor.setVisible ( ( ( model.getImportSources ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.VMWARE ) ) ) ; }
Source:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( "%s, storagePoolId = %s, storagePoolName = %s, masterDomainId = %s, masterVersion = %s, domainsList = [%s]" , super . toString ( ) , getStoragePoolId ( ) , getStoragePoolName ( ) , getMasterDomainId ( ) , getMasterVersion ( ) , getPrintableDomainsList ( ) ) ; }

Target:
public java.lang.String toString ( ) { return java.lang.String.format ( ( "%s, vdsSpmId = %i, storagePoolId = %s, " + ( "storagePoolName = %s, masterDomainId = %s, masterVersion = %s, " + "domainsList = [%s]" ) ) , super . toString ( ) , getVdsSpmId ( ) , getStoragePoolId ( ) , getStoragePoolName ( ) , getMasterDomainId ( ) , getMasterVersion ( ) , getPrintableDomainsList ( ) ) ; }
Source:
public void testRemove ( ) { dao.remove ( existingPool.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool result = dao.get ( existingPool.getId ( ) ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testGetAllByStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > result = dao.getAllByStatus ( StoragePoolStatus.Up ) ; org.junit.Assert.assertNotNull ( "list of returned pools in status up shouldn't be null" , result ) ; org.junit.Assert.assertEquals ( "wrong number of storage pools returned for up status" , 5 , result.size ( ) ) ; result = dao.getAllByStatus ( StoragePoolStatus.Maintanance ) ; org.junit.Assert.assertNotNull ( "list of returned pools in maintanance status shouldn't be null" , result ) ; org.junit.Assert.assertEquals ( "wrong number of storage pool returned for maintanance status" , 0 , result.size ( ) ) ; }
Source:
public void getHostNumaTopologyByHostId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.VdsNumaNode > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsNumaNodesByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , asyncQuery ) ; }

Target:
public void getVmTemplatesByBaseTemplateId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > > asyncQuery , org.ovirt.engine.core.compat.Guid baseTemplate ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesByBaseTemplateId , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( baseTemplate ) , asyncQuery ) ; }
Source:
public void moveDiskToGluster ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( false ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
public void validateSameSourceAndDest ( ) { destStorageId = srcStorageId ; initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; command.getParameters ( ) . setStorageDomainId ( destStorageId ) ; command.setStorageDomainId ( destStorageId ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; }
Source:
protected java.lang.String getVmPoolName ( ) { return ( getVmPool ( ) ) != null ? getVmPool ( ) . getName ( ) : null ; }

Target:
public java.lang.String getVmPoolName ( ) { java.lang.String vmPoolName = org.ovirt.engine.core.bll.VmPoolCommandBase.getParameters ( ) . getVmPoolName ( ) ; if ( vmPoolName != null ) { return vmPoolName ; } else { return ( getVmPool ( ) ) != null ? getVmPool ( ) . getName ( ) : null ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.network getClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.network entity : getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) ) ) { if ( ( ( id != null ) && ( id.equals ( entity.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( entity.getname ( ) ) ) ) ) { return entity ; } } return null ; }

Target:
protected org.ovirt.engine.api.model.Network getClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name ) { for ( org.ovirt.engine.api.model.Network entity : getBackendCollection ( org.ovirt.engine.api.model.Network.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) ) ) { if ( ( ( id != null ) && ( id.equals ( entity.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( entity.getname ( ) ) ) ) ) { return entity ; } } return null ; }
Source:
private void updateDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalActionWithTasksContext ( VdcActionType.UpdateVolume , buildUpdateVolumeCommandParameters ( diskImage ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , returnValue.getFault ( ) . getMessage ( ) ) ; } }

Target:
private void updateDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = runInternalActionWithTasksContext ( ActionType.UpdateVolume , buildUpdateVolumeCommandParameters ( diskImage ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , returnValue.getFault ( ) . getMessage ( ) ) ; } }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , java.lang.String value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { sb.appendHtmlConstant ( "<a href='javascript:;' style='display: inline-block'>" ) ; super . render ( context , value , sb ) ; sb.appendHtmlConstant ( "</a>" ) ; } }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , java.lang.String value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( value != null ) { sb.append ( template.link ( id ) ) ; super . render ( context , value , sb , ( id + ( org.ovirt.engine.ui.common.widget.table.cell.LinkCell.CONTENT_ID_SUFFIX ) ) ) ; sb.appendHtmlConstant ( "</a>" ) ; } }
Source:
public static java.lang.String modifyLoginNameForKerberos ( java.lang.String loginName , java.lang.String domain ) { java.lang.String [ ] parts = loginName.split ( "[@]" ) ; org.ovirt.engine.extensions.aaa.builtin.kerberosldap.Domain requestedDomain = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.UsersDomainsCacheManagerService.getInstance ( ) . getDomain ( domain ) ; if ( requestedDomain == null ) { throw new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.DomainNotConfiguredException ( domain ) ; } org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LDAPSecurityAuthentication securityAuthentication = requestedDomain.getLdapSecurityAuthentication ( ) ; boolean isKerberosAuth = securityAuthentication.equals ( LDAPSecurityAuthentication.GSSAPI ) ; if ( ( parts.length ) != 2 ) { return isKerberosAuth ? ( loginName + "@" ) + ( domain.toUpperCase ( ) ) : loginName ; } java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; result.append ( parts [ 0 ] ) ; if ( isKerberosAuth ) { java.lang.String realm = parts [ 1 ] . toUpperCase ( ) ; result.append ( "@" ) . append ( realm ) ; } return result.toString ( ) ; }

Target:
public static java.lang.String modifyLoginNameForKerberos ( java.lang.String loginName , java.lang.String domain , java.util.Properties configuration ) { java.lang.String [ ] parts = loginName.split ( "[@]" ) ; org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LDAPSecurityAuthentication securityAuthentication = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LDAPSecurityAuthentication.valueOf ( configuration.getProperty ( "config.LDAPSecurityAuthentication" ) ) ; boolean isKerberosAuth = securityAuthentication.equals ( LDAPSecurityAuthentication.GSSAPI ) ; if ( ( parts.length ) != 2 ) { return isKerberosAuth ? ( loginName + "@" ) + ( domain.toUpperCase ( ) ) : loginName ; } java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; result.append ( parts [ 0 ] ) ; if ( isKerberosAuth ) { java.lang.String realm = parts [ 1 ] . toUpperCase ( ) ; result.append ( "@" ) . append ( realm ) ; } return result.toString ( ) ; }
Source:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { remove ( tracking , id , org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; tracking.getClient ( ) . disconnect ( "Vds timeout occured" ) ; }

Target:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { remove ( tracking , id , org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; if ( tracking.isResetConnection ( ) ) { tracking.getClient ( ) . disconnect ( "Vds timeout occured" ) ; } }
Source:
private static void testParseLunFromXmlRpcForDevtypeField ( org.ovirt.engine.core.common.businessentities.StorageType expectedStorageType , java.lang.String mockDevtype ) { java.util.Map < java.lang.String , java.lang.Object > xlun = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; xlun.put ( GetDeviceListVDSCommand.DEVTYPE_FIELD , mockDevtype ) ; org.ovirt.engine.core.common.businessentities.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLunFromXmlRpc ( xlun ) ; org.junit.Assert.assertEquals ( expectedStorageType , lun.getLunType ( ) ) ; }

Target:
private static void testParseLunFromXmlRpcForDevtypeField ( org.ovirt.engine.core.common.businessentities.StorageType expectedStorageType , java.lang.String mockDevtype ) { java.util.Map < java.lang.String , java.lang.Object > xlun = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; xlun.put ( GetDeviceListVDSCommand.DEVTYPE_FIELD , mockDevtype ) ; org.ovirt.engine.core.common.businessentities.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc ( xlun ) ; org.junit.Assert.assertEquals ( expectedStorageType , lun.getLunType ( ) ) ; }
Source:
public void getNumberOfVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return java.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfActiveVmsInClusterByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void checkFault ( org.apache.http.HttpResponse response ) { org.ovirt.engine.sdk4.types.Fault fault = null ; try ( org.ovirt.api.metamodel.runtime.xml.XmlReader reader = new org.ovirt.api.metamodel.runtime.xml.XmlReader ( response.getEntity ( ) . getContent ( ) ) ) { fault = org.ovirt.engine.sdk4.internal.xml.XmlFaultReader.readOne ( reader ) ; if ( fault != null ) { this . throwError ( response , fault ) ; } } catch ( java.io.IOException ex ) { throw new java.lang.RuntimeException ( ex ) ; } finally { org.apache.http.util.EntityUtils.consumeQuietly ( response.getEntity ( ) ) ; } }

Target:
public void checkFault ( org.apache.http.HttpResponse response ) { org.ovirt.engine.sdk4.types.Fault fault = null ; try ( org.ovirt.api.metamodel.runtime.xml.XmlReader reader = new org.ovirt.api.metamodel.runtime.xml.XmlReader ( response.getEntity ( ) . getContent ( ) ) ) { fault = org.ovirt.engine.sdk4.internal.xml.XmlFaultReader.readOne ( reader ) ; if ( fault != null ) { this . throwError ( response , fault ) ; } } catch ( java.io.IOException ex ) { throw new java.lang.Error ( "Failed to read response" , ex ) ; } finally { org.apache.http.util.EntityUtils.consumeQuietly ( response.getEntity ( ) ) ; } }
Source:
protected org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters buildDeleteMemoryConfParams ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { return org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.storage.domain.PostDeleteActionHandler.class ) . fixParameters ( new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( guids.get ( 1 ) , guids.get ( 0 ) , guids.get ( 4 ) , isPostZero ( ) , false ) ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters buildDeleteMemoryConfParams ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { boolean discardAfterDelete = storageDomainDao.get ( guids.get ( 0 ) ) . isDiscardAfterDelete ( ) ; return postDeleteActionHandler.fixParameters ( new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( guids.get ( 1 ) , guids.get ( 0 ) , guids.get ( 4 ) , isPostZero ( ) , discardAfterDelete , false ) ) ; }
Source:
public void appendCustomValueAppend ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = "_" ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }

Target:
public void appendCustomValueAppendsWithNull ( ) { final java.lang.String key = "foo" ; final java.lang.String value = null ; final java.lang.String newVal = "bar" ; final java.lang.String sep = "_" ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }
Source:
public void revealPlace ( final java.lang.String placeToken ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { placeManager.revealPlace ( new com.gwtplatform.mvp.shared.proxy.PlaceRequest.Builder ( ) . nameToken ( placeToken ) . build ( ) ) ; } } ) ; }

Target:
public void revealPlace ( final java.lang.String historyToken ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { placeManager.revealPlace ( new com.gwtplatform.mvp.client.proxy.PlaceRequest.Builder ( ) . nameToken ( historyToken ) . build ( ) ) ; } } ) ; }
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 ) { super . eventRaised ( ev , sender , args ) ; if ( getEnabled ( ) . equals ( sender ) ) { updateChangeability ( ) ; } else if ( this . equals ( sender ) ) { getEnabled ( ) . setIsChangable ( getIsChangable ( ) ) ; } }

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 ) { super . eventRaised ( ev , sender , args ) ; if ( getEnabled ( ) . equals ( sender ) ) { updateChangeability ( ) ; } else if ( this . equals ( sender ) ) { getEnabled ( ) . setIsChangeable ( getIsChangable ( ) ) ; } }
Source:
private void UpdateStorageDomainsAvailability ( ) { if ( ( disks ) == null ) { return ; } for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : disks ) { diskModel.getSourceStorageDomain ( ) . setIsAvailable ( isSourceStorageDomainAvailable ) ; diskModel.getSourceStorageDomainName ( ) . setIsAvailable ( isSourceStorageDomainNameAvailable ) ; diskModel.getVolumeType ( ) . setIsAvailable ( isVolumeFormatAvailable ) ; diskModel.getVolumeType ( ) . setIsChangable ( isVolumeFormatChangable ) ; diskModel.getAlias ( ) . setIsChangable ( isAliasChangable ) ; } }

Target:
private void updateStorageDomainsAvailability ( ) { if ( ( disks ) == null ) { return ; } for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : disks ) { diskModel.getSourceStorageDomain ( ) . setIsAvailable ( isSourceStorageDomainAvailable ) ; diskModel.getSourceStorageDomainName ( ) . setIsAvailable ( isSourceStorageDomainNameAvailable ) ; diskModel.getVolumeType ( ) . setIsAvailable ( isVolumeFormatAvailable ) ; diskModel.getVolumeType ( ) . setIsChangable ( isVolumeFormatChangable ) ; diskModel.getAlias ( ) . setIsChangable ( isAliasChangable ) ; } }
Source:
public void networNotExist ( ) { simulateNicExists ( ) ; org.junit.Assert.assertThat ( validator.networkExists ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_NOT_EXIST , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_ID_REPLACEMENT , org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) ) ) ; }

Target:
public void networNotExist ( ) { simulateNicExists ( ) ; org.junit.Assert.assertThat ( validator.networkExists ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_NOT_EXIST , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_ID_REPLACEMENT , org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > getAllForAdElement ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { int appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "ad_element_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsByAdElementId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > getAllForAdElement ( org.ovirt.engine.core.compat.Guid id , long engineSessionSeqId , boolean isFiltered ) { int appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "ad_element_id" , id ) . addValue ( "engine_session_seq_id" , engineSessionSeqId ) . addValue ( "is_filtered" , isFiltered ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsByAdElementId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }
Source:
public void migrationNotSupported ( ) { org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }

Target:
public void migrationNotSupported ( ) { org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }
Source:
public void shouldMigrateCandidateFromNegativeGroup ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup positiveSatisfiedGroup = createAffinityGroup ( vdsGroup , true , vm1 , vm2 ) ; org.ovirt.engine.core.common.scheduling.AffinityGroup negativeUnsatisfiedGroup = createAffinityGroup ( vdsGroup , false , vm2 , vm3 , vm6 ) ; affinityGroups.add ( negativeUnsatisfiedGroup ) ; affinityGroups.add ( positiveSatisfiedGroup ) ; final org.ovirt.engine.core.common.businessentities.VM candidate = enforcer.chooseNextVmToMigrate ( vdsGroup ) ; org.junit.Assert.assertTrue ( java.util.Arrays.asList ( vm2 , vm3 ) . contains ( candidate ) ) ; }

Target:
public void shouldMigrateCandidateFromNegativeGroup ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup positiveSatisfiedGroup = createAffinityGroup ( vdsGroup , true , vm1 , vm2 ) ; org.ovirt.engine.core.common.scheduling.AffinityGroup negativeUnsatisfiedGroup = createAffinityGroup ( vdsGroup , false , vm2 , vm3 , vm6 ) ; affinityGroups.add ( negativeUnsatisfiedGroup ) ; affinityGroups.add ( positiveSatisfiedGroup ) ; final org.ovirt.engine.core.common.businessentities.VM candidate = enforcer.chooseNextVmToMigrate ( vdsGroup ) ; org.assertj.core.api.Assertions.assertThat ( candidate ) . isIn ( vm2 , vm3 ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase removeCinderDisk ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RemoveCinderDisk , buildChildCommandParameters ( cinderDisk ) , org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.cloneContextAndDetachFromParent ( ) ) ; try { return future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { e.printStackTrace ( ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase removeCinderDisk ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RemoveCinderDisk , buildChildCommandParameters ( cinderDisk ) , org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.cloneContextAndDetachFromParent ( ) , new org.ovirt.engine.core.common.businessentities.SubjectEntity ( org.ovirt.engine.core.common.VdcObjectType.Storage , cinderDisk.getStorageIds ( ) . get ( 0 ) ) ) ; try { return future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { e.printStackTrace ( ) ; } return null ; }
Source:
public org.ovirt.engine.core.dao.StorageDomainDAO getStorageDomainDAO ( ) { final org.ovirt.engine.core.common.businessentities.storage_domains sd = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; sd.setstorage_domain_type ( StorageDomainType.ImportExport ) ; sd.setstatus ( StorageDomainStatus.Active ) ; final org.ovirt.engine.core.dao.StorageDomainDAO d = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( d.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( sd ) ; return d ; }

Target:
protected boolean canAddVm ( ) { return true ; }
Source:
public static void GetDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public static void GetoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public void testUpdateSetAndUploadIconFailure ( ) throws java.lang.Exception { control.replay ( ) ; final org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 0 ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; try { verifyModel ( resource.update ( model ) , 0 ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
static org.ovirt.engine.api.model.Vm getModelClearingPayloads ( int index ) { org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 0 ) ; model.setPayloads ( new org.ovirt.engine.api.model.Payloads ( ) ) ; return model ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; if ( ( object.getVmEntityType ( ) ) == null ) { setTitle ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.unattachedDisk ( ) ) ; return null ; } return object.getVmEntityType ( ) . isVmType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.vmsImage ( ) : object.getVmEntityType ( ) . isTemplateType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.templatesImage ( ) : null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.lunDisksLabel ( ) ) ; } return null ; }
Source:
public void testSucceedInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( diskImageGuid , vmId ) , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( ) ; org.junit.Assert.assertTrue ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }

Target:
public void testSucceedInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( diskImageGuid , vmId ) , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskVmElement.class ) ) ; org.junit.Assert.assertTrue ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }
Source:
com.google.gwt.user.cellview.client.Header < ? > createHeader ( com.google.gwt.user.cellview.client.Column < T , ? > column , java.lang.String headerTextOrHtml , boolean allowHtml ) { com.google.gwt.safehtml.shared.SafeHtml headerHtml = ( allowHtml ) ? com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( headerTextOrHtml ) : com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( headerTextOrHtml ) ; return createHeader ( column , headerHtml ) ; }

Target:
public void addColumnWithHtmlHeader ( com.google.gwt.user.cellview.client.Column < T , ? > column , com.google.gwt.safehtml.shared.SafeHtml headerHtml ) { com.google.gwt.user.cellview.client.Header < ? > header = new org.ovirt.engine.ui.common.widget.table.header.SafeHtmlHeader ( headerHtml ) ; addColumn ( column , header ) ; }
Source:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel vmGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateImportInterfaceListModel templateImportInterfaceListModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( vmGeneralModel ) ; list.add ( templateImportInterfaceListModel ) ; list.add ( templateImportDiskListModel ) ; setDetailModels ( list ) ; }

Target:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel vmGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateImportInterfaceListModel templateImportInterfaceListModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( vmGeneralModel ) ; list.add ( templateImportInterfaceListModel ) ; list.add ( templateImportDiskListModel ) ; setDetailModels ( list ) ; }