auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void initUser ( ) { }

Target:
private void initUnregisteredOVFData ( org.ovirt.engine.core.common.businessentities.OvfEntityData resultOvfEntityData ) { java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList = new java.util.ArrayList < > ( ) ; if ( resultOvfEntityData != null ) { ovfEntityDataList.add ( resultOvfEntityData ) ; } org.mockito.Mockito.when ( unregisteredOVFDataDao.getByEntityIdAndStorageDomain ( vmId , org.ovirt.engine.core.bll.exportimport.ImportVMFromConfigurationCommandTest.storageDomainId ) ) . thenReturn ( ovfEntityDataList ) ; }
Source:
protected void onExportChanged ( ) { if ( getExport ( ) . getEntity ( ) ) { getHasVLanTag ( ) . setIsChangable ( false ) ; getVLanTag ( ) . setIsChangable ( false ) ; getIsVmNetwork ( ) . setIsChangable ( false ) ; getNetworkLabel ( ) . setIsChangable ( false ) ; } super . onExportChanged ( ) ; }

Target:
protected void onExportChanged ( ) { super . onExportChanged ( ) ; if ( getExport ( ) . getEntity ( ) ) { getHasVLanTag ( ) . setIsChangable ( false ) ; getVLanTag ( ) . setIsChangable ( false ) ; getIsVmNetwork ( ) . setIsChangable ( false ) ; getNetworkLabel ( ) . setIsChangable ( false ) ; getNeutronPhysicalNetwork ( ) . setIsChangable ( false ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc updateVmPolicy ( java.util.Map params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.updateVmPolicy" ) . withParameter ( "vmID" , ( ( java.lang.String ) ( params.get ( "vmId" ) ) ) ) . withParameter ( "params" , params ) . 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 ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn updateVmPolicy ( java.util.Map params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.updateVmPolicy" ) . withParameter ( "vmID" , ( ( java.lang.String ) ( params.get ( "vmId" ) ) ) ) . withParameter ( "params" , params ) . 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.StatusOnlyReturn ( response ) ; }
Source:
public boolean canBeSelected ( ) { boolean hasVmSpiceSupport = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . hasSpiceSupport ( getEntity ( ) . getOs ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ; return ( getEntity ( ) . getGraphicsInfos ( ) . containsKey ( GraphicsType.SPICE ) ) && hasVmSpiceSupport ; }

Target:
public boolean canBeSelected ( ) { boolean hasVmSpiceSupport = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . hasSpiceSupport ( getEntity ( ) . getOs ( ) , getEntity ( ) . getClusterCompatibilityVersion ( ) ) ) ; return ( getEntity ( ) . getGraphicsInfos ( ) . containsKey ( GraphicsType.SPICE ) ) && hasVmSpiceSupport ; }
Source:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldDetectDuplicateNodeIndex ( ) { vmNumaNodes.get ( 0 ) . setIndex ( 1 ) ; vmNumaNodes.get ( 1 ) . setIndex ( 1 ) ; assertValidationFailure ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_INDEX_DUPLICATE ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolIsoMapDao ( ) ; storagePoolIsoMapDao = dbFacade.getStoragePoolDao ( ) ; existingPool = storagePoolIsoMapDao.get ( FixturesTool.DATA_CENTER ) ; existingStoragePoolIsoMap = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( org.ovirt.engine.core.dao.StoragePoolIsoMapDaoTest.EXISTING_ISO_ID , existingPool.getId ( ) ) ) ; newStoragePoolIsoMap = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( org.ovirt.engine.core.dao.StoragePoolIsoMapDaoTest.FREE_ISO_ID , existingPool.getId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unattached ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolIsoMapDao ( ) ; storagePoolIsoMapDao = dbFacade.getStoragePoolDao ( ) ; existingPool = storagePoolIsoMapDao.get ( FixturesTool.DATA_CENTER ) ; existingStoragePoolIsoMap = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , existingPool.getId ( ) ) ) ; newStoragePoolIsoMap = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( org.ovirt.engine.core.dao.StoragePoolIsoMapDaoTest.FREE_ISO_ID , existingPool.getId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unattached ) ; }
Source:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType search , org.ovirt.engine.core.common.queries.VdcQueryParametersBase searchParameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunQuery invoked!" ) ; debugQuery ( search , searchParameters ) ; searchParameters.setSessionId ( getEngineSessionId ( ) ) ; return getBackend ( ) . runQuery ( search , searchParameters ) ; }

Target:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType search , org.ovirt.engine.core.common.queries.VdcQueryParametersBase searchParameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunQuery invoked!" ) ; debugQuery ( search , searchParameters ) ; searchParameters.setSessionId ( getEngineSessionId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = getBackend ( ) . runQuery ( search , searchParameters ) ; returnValue.setReturnValue ( org.ovirt.engine.ui.frontend.server.gwt.hibernate.HibernateCleaner.doClean ( returnValue.getReturnValue ( ) ) ) ; return returnValue ; }
Source:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc createVG ( java.lang.String sdUUID , java.lang.String [ ] deviceList ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.createVG ( sdUUID , deviceList ) ; org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( 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.irsbroker.StatusReturnForXmlRpc verifyUntrustedVolume ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.verifyUntrustedVolume ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VmNumaNode toVmNumaNode ( ) { final org.ovirt.engine.core.common.businessentities.VmNumaNode newNode = new org.ovirt.engine.core.common.businessentities.VmNumaNode ( ) ; newNode.setIndex ( vmNumaNode.getIndex ( ) ) ; newNode.setId ( vmNumaNode.getId ( ) ) ; newNode.setMemTotal ( vmNumaNode.getMemTotal ( ) ) ; if ( isPinned ( ) ) { newNode.setVdsNumaNodeList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > > ( null , new org.ovirt.engine.core.common.utils.Pair ( pinned , hostNodeIndex ) ) ) ) ; } return newNode ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmNumaNode toVmNumaNode ( ) { final org.ovirt.engine.core.common.businessentities.VmNumaNode newNode = new org.ovirt.engine.core.common.businessentities.VmNumaNode ( ) ; newNode.setIndex ( vmNumaNode.getIndex ( ) ) ; newNode.setId ( vmNumaNode.getId ( ) ) ; newNode.setMemTotal ( vmNumaNode.getMemTotal ( ) ) ; newNode.setCpuIds ( vmNumaNode.getCpuIds ( ) ) ; if ( isPinned ( ) ) { newNode.setVdsNumaNodeList ( java.util.Arrays.asList ( hostNodeIndex ) ) ; } return newNode ; }
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 ( ) ) , true , true , null ) ; }

Target:
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 ( ) ) , true , true , null ) ; }
Source:
private void updateOriginalTemplateNameOnDerivedVms ( ) { boolean templateNameChanged = ! ( org.apache.commons.lang.ObjectUtils.equals ( mOldTemplate.getName ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ) ; if ( templateNameChanged ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDAO ( ) . updateOriginalTemplateName ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ; } }

Target:
private void updateOriginalTemplateNameOnDerivedVms ( ) { boolean templateNameChanged = ! ( org.apache.commons.lang.ObjectUtils.equals ( mOldTemplate.getName ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ) ; if ( templateNameChanged ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDao ( ) . updateOriginalTemplateName ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ; } }
Source:
private void validateLockForAcquireAndWait ( org.ovirt.engine.core.utils.lock.EngineLock lock ) { if ( ( ( lock.getSharedLocks ( ) ) != null ) && ( ( lock.getExclusiveLocks ( ) . size ( ) ) > 1 ) ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.log.error ( "Trying to acquire or wait on shared or more than one exclussive locks '{}'" , lock ) ; throw new java.lang.IllegalArgumentException ( "Trying to acquire or wait on shared or more than one exclussive locks" ) ; } }

Target:
private void validateLockForAcquireAndWait ( org.ovirt.engine.core.utils.lock.EngineLock lock ) { if ( ( ( lock.getSharedLocks ( ) ) != null ) && ( ( lock.getExclusiveLocks ( ) . size ( ) ) > 1 ) ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.log.error ( "Trying to acquire or wait on shared or more than one exclusive locks '{}'" , lock ) ; throw new java.lang.IllegalArgumentException ( "Trying to acquire or wait on shared or more than one exclusive locks" ) ; } }
Source:
public void testEnd ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.EndExternalStep , org.ovirt.engine.core.common.action.EndExternalStepParameters.class , new java.lang.String [ ] { "Id" , "Status" } , new java.lang.Object [ ] { GUIDS [ 0 ] , true } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setSucceeded ( true ) ; verifyActionResponse ( resource.end ( action ) ) ; }

Target:
public void testEnd ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.EndExternalStep , org.ovirt.engine.core.common.action.EndExternalStepParameters.class , new java.lang.String [ ] { "Id" , "Status" } , new java.lang.Object [ ] { GUIDS [ 0 ] , true } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setSucceeded ( true ) ; verifyActionResponse ( resource.end ( action ) ) ; }
Source:
protected void performLogout ( ) { getLoginModel ( ) . resetAfterLogout ( ) ; user.onUserLogout ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.clearCache ( ) ; org.ovirt.engine.ui.common.uicommon.model.CleanupModelEvent.fire ( eventBus ) ; }

Target:
void initLocalStorageLogHandler ( java.util.logging.Logger rootLogger ) { localStorageLogHandler.init ( ) ; rootLogger.addHandler ( localStorageLogHandler ) ; eventBus.addHandler ( org.ovirt.engine.ui.common.system.ApplicationFocusChangeEvent.getType ( ) , new org.ovirt.engine.ui.common.system.ApplicationFocusChangeEvent.ApplicationFocusChangeHandler ( ) { @ java.lang.Override public void onApplicationFocusChange ( org.ovirt.engine.ui.common.system.ApplicationFocusChangeEvent event ) { localStorageLogHandler.setActive ( event.isInFocus ( ) ) ; } } ) ; }
Source:
private java.lang.Void executeAddQutoa ( ) { getQuotaDAO ( ) . save ( getQuota ( ) ) ; if ( getParameters ( ) . isCopyPermissions ( ) ) { copyQuotaPermissions ( ) ; } getReturnValue ( ) . setSucceeded ( true ) ; return null ; }

Target:
private java.lang.Void executeAddQutoa ( ) { getQuotaDAO ( ) . save ( getQuota ( ) ) ; if ( getParameters ( ) . isCopyPermissions ( ) ) { copyQuotaPermissions ( ) ; } getReturnValue ( ) . setSucceeded ( true ) ; setActionReturnValue ( getQuota ( ) . getId ( ) ) ; return null ; }
Source:
protected void executeQueryCommand ( ) { try { org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setReturnValue ( getUserRequestForStorageDomainRepoFileList ( ) ) ; } catch ( java.lang.Exception e ) { java.lang.String message = java.util.Optional.of ( e.getCause ( ) ) . map ( java.lang.Throwable :: getMessage ) . orElse ( "" ) ; log.error ( "Failed to retrieve image list: {}" , message ) ; org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setExceptionString ( message ) ; org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setSucceeded ( false ) ; } }

Target:
protected void executeQueryCommand ( ) { try { org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setReturnValue ( getUserRequestForStorageDomainRepoFileList ( ) ) ; } catch ( java.lang.Exception e ) { java.lang.String message = java.util.Optional.ofNullable ( e.getCause ( ) ) . map ( java.lang.Throwable :: getMessage ) . orElse ( "" ) ; log.error ( "Failed to retrieve image list: {}" , message ) ; org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setExceptionString ( message ) ; org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setSucceeded ( false ) ; } }
Source:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; setDetailModels ( list ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.Network getNetwork ( ) { if ( ( ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) != null ) && ( ( network ) == null ) ) { vnicProfile = vnicProfileDao.get ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) ; network = org.ovirt.engine.core.bll.network.cluster.NetworkHelper.getNetworkByVnicProfile ( vnicProfile ) ; } return network ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.Network getNetwork ( ) { if ( ( ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) != null ) && ( ( network ) == null ) ) { vnicProfile = vnicProfileDao.get ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) ; network = networkHelper.getNetworkByVnicProfile ( vnicProfile ) ; } return network ; }
Source:
private void mockCheckStatus ( java.lang.String status ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue retValue = new org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ( ) ; retValue.setSucceeded ( true ) ; org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue stat = new org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ( status , "" ) ; retValue.setReturnValue ( stat ) ; org.mockito.Mockito.when ( executor.checkHostStatus ( ) ) . thenReturn ( retValue ) ; }

Target:
private void mockVdsDynamicDao ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic currentVds = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; currentVds.setId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ; currentVds.setStatus ( VDSStatus.NonResponsive ) ; org.mockito.Mockito.when ( vdsDynamicDAO.get ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ) . thenReturn ( currentVds ) ; org.mockito.Mockito.when ( dbFacade.getVdsDynamicDao ( ) ) . thenReturn ( vdsDynamicDAO ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; getVmDisks ( ) . clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( Disk.DiskStorageType.LUN ) ) { continue ; } org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; getVmDisks ( ) . add ( diskImage ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; getVmDisks ( ) . clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { continue ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; getVmDisks ( ) . add ( diskImage ) ; } }
Source:
protected java.lang.String getIconToShow ( java.lang.String currentOsDefaultIcon ) { if ( ( getIcon ( ) . getEntity ( ) ) == null ) { return currentOsDefaultIcon ; } return getIcon ( ) . getEntity ( ) . isCustom ( ) ? getIcon ( ) . getEntity ( ) . getIcon ( ) : currentOsDefaultIcon ; }

Target:
private void updateSoundCard ( ) { if ( ( ( getOSType ( ) . getSelectedItem ( ) ) != null ) && ( ( getSelectedCluster ( ) ) != null ) ) { int osType = getOSType ( ) . getSelectedItem ( ) ; boolean soundCardEnabled = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isSoundDeviceEnabled ( osType , getSelectedCluster ( ) . getCompatibilityVersion ( ) ) ; getIsSoundcardEnabled ( ) . setIsChangeable ( soundCardEnabled , constants.soundDeviceUnavailable ( ) ) ; } }
Source:
public static 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }

Target:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) , aQuery ) ; }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getLabeledNics ( org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > clusters = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.SyncNetworkParametersBuilder.getNetworkClusterDAO ( ) . getAllForNetwork ( network.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > labeledNics = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster : clusters ) { labeledNics.addAll ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.SyncNetworkParametersBuilder.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesByLabelForCluster ( networkCluster.getClusterId ( ) , network.getLabel ( ) ) ) ; } return labeledNics ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getLabeledNics ( org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > clusters = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.SyncNetworkParametersBuilder.getNetworkClusterDao ( ) . getAllForNetwork ( network.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > labeledNics = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster : clusters ) { labeledNics.addAll ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.SyncNetworkParametersBuilder.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesByLabelForCluster ( networkCluster.getClusterId ( ) , network.getLabel ( ) ) ) ; } return labeledNics ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }

Target:
public void queryFailed ( ) { stopProgress ( this ) ; cancel ( ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.Cluster createClusterWithOlderVersion ( boolean supportsVirtService , boolean supportsGlusterService ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.ovirt.engine.core.bll.UpdateClusterCommandTest.createNewCluster ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_0 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DC_ID1 ) ; group.setVirtService ( supportsVirtService ) ; group.setGlusterService ( supportsGlusterService ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.Cluster createClusterWithOlderVersion ( boolean supportsVirtService , boolean supportsGlusterService ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.ovirt.engine.core.bll.UpdateClusterCommandTest.createNewCluster ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_0 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DC_ID1 ) ; group.setVirtService ( supportsVirtService ) ; group.setGlusterService ( supportsGlusterService ) ; group.setMaxVdsMemoryOverCommit ( 100 ) ; return group ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.provider.ProviderValidator validatorOld = new org.ovirt.engine.core.bll.provider.ProviderValidator ( getOldProvider ( ) ) ; org.ovirt.engine.core.bll.provider.ProviderValidator validatorNew = new org.ovirt.engine.core.bll.provider.ProviderValidator ( getProvider ( ) ) ; return ( validate ( validatorOld.providerIsSet ( ) ) ) && ( ( nameKept ( ) ) || ( validate ( validatorNew.nameAvailable ( ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.provider.ProviderValidator validatorOld = new org.ovirt.engine.core.bll.provider.ProviderValidator ( getOldProvider ( ) ) ; org.ovirt.engine.core.bll.provider.ProviderValidator validatorNew = new org.ovirt.engine.core.bll.provider.ProviderValidator ( getProvider ( ) ) ; return ( ( validate ( validatorOld.providerIsSet ( ) ) ) && ( ( nameKept ( ) ) || ( validate ( validatorNew.nameAvailable ( ) ) ) ) ) && ( validate ( providerTypeNotChanged ( getOldProvider ( ) , getProvider ( ) ) ) ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; if ( ! ( "mouseover" . equals ( event.getType ( ) ) ) ) { return ; } if ( ( value != null ) && ( showTooltip ( parent , value ) ) ) { parent.setTitle ( getTooltip ( value ) ) ; } else { parent.setTitle ( "" ) ; } }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; if ( ! ( BrowserEvents.MOUSEOVER.equals ( event.getType ( ) ) ) ) { return ; } if ( ( value != null ) && ( showTooltip ( parent , value ) ) ) { parent.setTitle ( getTooltip ( value ) ) ; } else { parent.setTitle ( "" ) ; } }
Source:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.ServiceInfo > prepareServiceInfo ( java.util.Map < java.lang.String , java.lang.Object > statusInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.ServiceInfo > serviceInfoList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.ServiceInfo > ( ) ; prepareServiceInfo ( statusInfo , serviceInfoList , org.ovirt.engine.core.vdsbroker.irsbroker.GlusterVolumeStatusReturnForXmlRpc.NFS_KEY ) ; prepareServiceInfo ( statusInfo , serviceInfoList , org.ovirt.engine.core.vdsbroker.irsbroker.GlusterVolumeStatusReturnForXmlRpc.SHD_KEY ) ; return serviceInfoList ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.ServiceInfo > prepareServiceInfo ( java.util.Map < java.lang.String , java.lang.Object > statusInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.ServiceInfo > serviceInfoList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.ServiceInfo > ( ) ; prepareServiceInfo ( statusInfo , serviceInfoList , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeStatusReturnForXmlRpc.NFS_KEY ) ; prepareServiceInfo ( statusInfo , serviceInfoList , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeStatusReturnForXmlRpc.SHD_KEY ) ; return serviceInfoList ; }
Source:
public void OnForceRemove ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ! ( model.Validate ( ) ) ) { return ; } org.ovirt.engine.core.common.action.VdcActionParametersBase parametersBase = new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) ; org.ovirt.engine.core.common.action.StoragePoolParametersBase tempVar = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) . getId ( ) ) ; tempVar.setForceDelete ( true ) ; parametersBase = tempVar ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStoragePool , parametersBase ) ; Cancel ( ) ; }

Target:
public void onForceRemove ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ! ( model.validate ( ) ) ) { return ; } org.ovirt.engine.core.common.action.StoragePoolParametersBase tempVar = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) . getId ( ) ) ; tempVar.setForceDelete ( true ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase parametersBase = tempVar ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStoragePool , parametersBase ) ; cancel ( ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.provider.ProviderValidator validator = new org.ovirt.engine.core.bll.provider.ProviderValidator ( getProvider ( ) ) ; org.ovirt.engine.core.common.businessentities.Provider oldProvider = org.ovirt.engine.core.bll.provider.UpdateProviderCommand.getDbFacade ( ) . getNetworkProviderDao ( ) . get ( getProvider ( ) . getId ( ) ) ; return ( nameKept ( oldProvider ) ) || ( validate ( validator.nameAvailable ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.provider.ProviderValidator validatorOld = new org.ovirt.engine.core.bll.provider.ProviderValidator ( getOldProvider ( ) ) ; org.ovirt.engine.core.bll.provider.ProviderValidator validatorNew = new org.ovirt.engine.core.bll.provider.ProviderValidator ( getProvider ( ) ) ; return ( validate ( validatorOld.providerIsSet ( ) ) ) && ( ( nameKept ( ) ) || ( validate ( validatorNew.nameAvailable ( ) ) ) ) ; }
Source:
private void processUnremovedDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { java.util.List < java.lang.String > disksLeftInVm = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { disksLeftInVm.add ( diskImage.getDiskAlias ( ) ) ; } addCustomValue ( "DisksNames" , org.apache.commons.lang.StringUtils.join ( disksLeftInVm , "," ) ) ; }

Target:
private void processUnremovedDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { java.util.List < java.lang.String > disksLeftInVm = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImages ) { disksLeftInVm.add ( diskImage.getDiskAlias ( ) ) ; } addCustomValue ( "DisksNames" , org.apache.commons.lang.StringUtils.join ( disksLeftInVm , "," ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc glusterVolumeGeoRepStatusDetail ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatusDetail" ) . withParameter ( "volName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc glusterVolumeGeoRepSessionStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionStatus" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc ( response ) ; }
Source:
private boolean checkDerivedVmFromTemplateExists ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { java.util.List < java.lang.String > vmNames = getNamesOfDerivedVmsFromTemplate ( diskImage ) ; if ( ! ( vmNames.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM ) ; addCanDoActionMessageVariable ( "vmsList" , org.apache.commons.lang.StringUtils.join ( vmNames , "," ) ) ; return false ; } return true ; }

Target:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) || ( ! ( checkDerivedDisksFromDiskNotExist ( diskImage ) ) ) ) { return false ; } return true ; }
Source:
protected boolean addVmLease ( org.ovirt.engine.core.compat.Guid leaseStorageDomainId , org.ovirt.engine.core.compat.Guid vmId ) { if ( leaseStorageDomainId == null ) { return true ; } return runInternalActionWithTasksContext ( ActionType.AddVmLease , new org.ovirt.engine.core.common.action.VmLeaseParameters ( getStoragePoolId ( ) , leaseStorageDomainId , vmId ) ) . getSucceeded ( ) ; }

Target:
private void updateHeOvf ( ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) == null ) { ovfDataUpdater.triggerNow ( ) ; return ; } org.ovirt.engine.core.bll.VmCommand.registerRollbackHandler ( new org.ovirt.engine.core.utils.transaction.TransactionCompletionListener ( ) { @ java.lang.Override public void onSuccess ( ) { ovfDataUpdater.triggerNow ( ) ; } @ java.lang.Override public void onRollback ( ) { } } ) ; }
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 getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
private void storeVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vm.getDynamicData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStatisticsDao ( ) . update ( vm.getStatisticsData ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = vm.getInterfaces ( ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface ifc : interfaces ) { org.ovirt.engine.core.common.businessentities.VmNetworkStatistics stats = ifc.getStatistics ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkStatisticsDao ( ) . update ( stats ) ; } } }

Target:
private void storeVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vm.getDynamicData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStatisticsDao ( ) . update ( vm.getStatisticsData ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = vm.getInterfaces ( ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ifc : interfaces ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics stats = ifc.getStatistics ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkStatisticsDao ( ) . update ( stats ) ; } } }
Source:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { mockOsRepository ( ) ; initCommand ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }

Target:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { mockOsRepository ( ) ; initCommand ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }
Source:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.StorageDomain model = new org.ovirt.engine.api.model.StorageDomain ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "StorageDomain" , "add" , "id|name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.StorageDomain model = new org.ovirt.engine.api.model.StorageDomain ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "StorageDomain" , "add" , "id|name" ) ; }
Source:
public void processSoftwareCapabilities ( org.ovirt.engine.core.common.businessentities.VDS vds ) { boolean softwareCapabilitiesAreMet = true ; if ( ( ( vds.getkvm_enabled ( ) ) != null ) && ( vds.getkvm_enabled ( ) . equals ( false ) ) ) { softwareCapabilitiesAreMet = false ; } if ( ( ! softwareCapabilitiesAreMet ) && ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) ) { vdsNonOperational ( vds ) ; vds.setstatus ( VDSStatus.NonOperational ) ; } }

Target:
public void processSoftwareCapabilities ( org.ovirt.engine.core.common.businessentities.VDS vds ) { boolean softwareCapabilitiesAreMet = true ; if ( ( ( vds.getKvmEnabled ( ) ) != null ) && ( vds.getKvmEnabled ( ) . equals ( false ) ) ) { softwareCapabilitiesAreMet = false ; } if ( ( ! softwareCapabilitiesAreMet ) && ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) ) { vdsNonOperational ( vds ) ; vds.setStatus ( VDSStatus.NonOperational ) ; } }