auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmt ; vmt = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . getTemplateWithLatestVersionInChain ( org.ovirt.engine.core.bll.GetLatestTemplateInChainQuery.getParameters ( ) . getId ( ) ) ; if ( vmt != null ) { org.ovirt.engine.core.bll.VmTemplateHandler.updateDisksFromDb ( vmt ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( vmt , true ) ; } org.ovirt.engine.core.bll.GetLatestTemplateInChainQuery.getQueryReturnValue ( ) . setReturnValue ( vmt ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmt ; vmt = vmTemplateDao.getTemplateWithLatestVersionInChain ( org.ovirt.engine.core.bll.GetLatestTemplateInChainQuery.getParameters ( ) . getId ( ) ) ; if ( vmt != null ) { org.ovirt.engine.core.bll.VmTemplateHandler.updateDisksFromDb ( vmt ) ; vmHandler.updateVmInitFromDB ( vmt , true ) ; } org.ovirt.engine.core.bll.GetLatestTemplateInChainQuery.getQueryReturnValue ( ) . setReturnValue ( vmt ) ; }
Source:
public static void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public static void getMaxVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean is64 ) { 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 262144 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ( is64 ? org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static int getOptimizeSchedulerForSpeedPendingRequests ( ) { return ( ( java.lang.Integer ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.SpeedOptimizationSchedulingThreshold , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskDummiesForSpaceValidations ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > dummies = new java.util.ArrayList ( disksList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : disksList ) { org.ovirt.engine.core.compat.Guid targetSdId = imageToDestinationDomainMap.get ( image.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage dummy = org.ovirt.engine.core.bll.ImagesHandler.createDiskImageWithExcessData ( image , targetSdId ) ; dummies.add ( dummy ) ; } return dummies ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskDummiesForSpaceValidations ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > dummies = new java.util.ArrayList ( disksList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : disksList ) { org.ovirt.engine.core.compat.Guid targetSdId = imageToDestinationDomainMap.get ( image.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage dummy = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.createDiskImageWithExcessData ( image , targetSdId ) ; dummies.add ( dummy ) ; } return dummies ; }
Source:
public void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public 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 ) ) : 1000 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVmsInPool , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void RemoveSnapshotFromDB ( org.ovirt.engine.core.common.businessentities.DiskImage snapshot ) { org.ovirt.engine.core.bll.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesForDisk = getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }

Target:
protected void RemoveSnapshot ( org.ovirt.engine.core.common.businessentities.DiskImage snapshot ) { org.ovirt.engine.core.bll.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesForDisk = getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }
Source:
public void testExecuteQueryWithoutDirectOnly ( ) { org.ovirt.engine.core.common.VdcObjectType type = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( org.ovirt.engine.core.common.VdcObjectType.values ( ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getVdcObjectType ( ) ) . thenReturn ( type ) ; org.ovirt.engine.core.dao.PermissionDAO permissionDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.PermissionDAO.class ) ; org.mockito.Mockito.when ( permissionDAOMock.getTreeForEntity ( objectID , type , org.ovirt.engine.core.bll.UNPRIVILEGED_USER_SESSION_ID , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( mockedPermissions ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDAOMock ) ; assertQueryDAOCall ( false ) ; }

Target:
public void testExecuteQueryWithoutDirectOnly ( ) { org.ovirt.engine.core.common.VdcObjectType type = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( org.ovirt.engine.core.common.VdcObjectType.values ( ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getVdcObjectType ( ) ) . thenReturn ( type ) ; org.ovirt.engine.core.dao.PermissionDao permissionDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.PermissionDao.class ) ; org.mockito.Mockito.when ( permissionDaoMock.getTreeForEntity ( objectID , type , org.ovirt.engine.core.bll.UNPRIVILEGED_USER_SESSION_ID , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( mockedPermissions ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDaoMock ) ; assertQueryDaoCall ( false ) ; }
Source:
private void updateNumOfMonitors ( ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.DisplayType > selectedDisplayType = getDisplayType ( ) . getSelectedItem ( ) ; if ( ( selectedDisplayType != null ) && ( ( selectedDisplayType.getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } else { getNumOfMonitors ( ) . setIsChangable ( true ) ; } }

Target:
private void updateNumOfMonitors ( ) { if ( ( getDisplayType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) { getNumOfMonitors ( ) . setIsChangeable ( true ) ; } else { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangeable ( false ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc diskReplicateStart ( java.lang.String vmUUID , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct srcDisk , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct dstDisk ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.diskReplicateStart ( vmUUID , srcDisk.getInnerMap ( ) , dstDisk.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterHookEnable ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookEnable ( glusterCommand , stage , hookName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void shouldElectActiveDataDomain ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = prepareStorageDomainForElection ( StorageDomainStatus.Active , "not he domain name" ) ; org.junit.Assert.assertEquals ( domain , cmd.electNewMaster ( ) ) ; }

Target:
public void shouldElectActiveDataDomain ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = prepareStorageDomainForElection ( StorageDomainStatus.Active , "not he domain name" ) ; org.mockito.Mockito.when ( hostedEngineHelper.isHostedEngineStorageDomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertEquals ( domain , cmd.electNewMaster ( ) ) ; }
Source:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; validDisksDomains = org.ovirt.engine.core.bll.ImagesHandler.findDomainsInApplicableStatusForDisks ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , VdcBllMessages.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }

Target:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; validDisksDomains = org.ovirt.engine.core.bll.ImagesHandler.findDomainsInApplicableStatusForDisks ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , VdcBllMessages.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }
Source:
public static void GetStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void GetStorageDomainList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }
Source:
public void nGuidGuidCtorNull ( ) { b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( null , null ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , gu ) ; }

Target:
public void nGuidGuidCtorNull ( ) { b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( null , null ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( Guid.Empty , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( Guid.Empty , gu ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void testAddIncompleteParameters2 ( ) { org.ovirt.engine.api.model.Disk model = org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.getModel ( ) ; model.setProvisionedSize ( null ) ; 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 , "Disk" , "testAddIncompleteParameters2" , "provisionedSize|size" ) ; } }

Target:
public void testAddIncompleteParameters2 ( ) { org.ovirt.engine.api.model.Disk model = org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.getModel ( ) ; model.setProvisionedSize ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "Disk" , "lambda$testAddIncompleteParameters2$2" , "provisionedSize|size" ) ; }
Source:
public boolean validate ( ) { return true ; }

Target:
private boolean containsLun ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel lunModel , java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > > models , boolean isIncluded ) { if ( models == null ) { return isIncluded ; } for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > model : models ) { if ( model instanceof org.ovirt.engine.ui.uicommonweb.models.storage.LunModel ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel ) ( model ) ) . getLunId ( ) . equals ( lunModel.getLunId ( ) ) ) { return true ; } } } return false ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DbUser > lookupUsers ( ) { if ( isFiltered ( ) ) { return getBackendCollection ( org.ovirt.engine.core.common.businessentities.DbUser.class , VdcQueryType.GetAllDbUsers , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; } return asCollection ( org.ovirt.engine.core.common.businessentities.DbUser.class , getEntity ( java.util.List.class , SearchType.DBUser , "users:" ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DbUser > lookupUsers ( ) { org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ; queryParams.setFiltered ( isFiltered ( ) ) ; return getBackendCollection ( org.ovirt.engine.core.common.businessentities.DbUser.class , VdcQueryType.GetAllDbUsers , queryParams ) ; }
Source:
public void addTab ( final org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab tab ) { tabContainer.add ( tab ) ; tab.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { switchTab ( tab ) ; } } ) ; if ( ( tabContainer.getWidgetCount ( ) ) == 1 ) { switchTab ( tab ) ; } }

Target:
public void onKeyUp ( com.google.gwt.event.dom.client.KeyUpEvent event ) { if ( ( org.ovirt.engine.ui.common.widget.dialog.tab.DialogTabPanel.SPACE_KEY_CODE ) == ( event.getNativeKeyCode ( ) ) ) { switchTab ( tab ) ; } }
Source:
private org.ovirt.engine.api.model.StorageDomain getExistingStorageDomain ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > existing = asCollection ( org.ovirt.engine.api.model.StorageDomain.class , getEntity ( java.util.ArrayList.class , VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , cnx.getConnection ( ) ) , ( "Existing storage domains: path=" + ( cnx.getConnection ( ) ) ) ) ) ; return ( existing.size ( ) ) != 0 ? existing.get ( 0 ) : null ; }

Target:
private org.ovirt.engine.api.model.StorageDomain getExistingStorageDomain ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > existing = asCollection ( org.ovirt.engine.api.model.StorageDomain.class , getEntity ( java.util.ArrayList.class , QueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , cnx.getConnection ( ) ) , ( "Existing storage domains: path=" + ( cnx.getConnection ( ) ) ) ) ) ; return ( existing.size ( ) ) != 0 ? existing.get ( 0 ) : null ; }
Source:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) , aQuery ) ; }

Target:
public static void GetVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = getDbFacade ( ) . getDiskDao ( ) . get ( getParameters ( ) . getObjectId ( ) ) ; if ( disk == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } if ( ( disk.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_DISK_OPERATION ) ; return false ; } this . disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = getDbFacade ( ) . getDiskDao ( ) . get ( getParameters ( ) . getObjectId ( ) ) ; if ( disk == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } if ( ! ( disk.getDiskStorageType ( ) . isInternal ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_DISK_OPERATION ) ; return false ; } this . disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; return super . canDoAction ( ) ; }
Source:
public static void GetNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }
Source:
private void scanAlignment ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameterList = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : getSelectedItems ( ) ) { parameterList.add ( new org.ovirt.engine.core.common.action.GetDiskAlignmentParameters ( disk.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.GetDiskAlignment , parameterList , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , this ) ; }

Target:
private void scanAlignment ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameterList = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : getSelectedItems ( ) ) { parameterList.add ( new org.ovirt.engine.core.common.action.GetDiskAlignmentParameters ( disk.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.GetDiskAlignment , parameterList , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , this ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( e.PropertyName.equals ( "IS_STATUS_APPLICABLE" ) ) { status.setText ( constants.rebalanceComplete ( ) ) ; status.setVisible ( true ) ; } else if ( e.PropertyName.equals ( "STOP_TIME_UPDATED" ) ) { stopTimePanel.setVisible ( object.isStopTimeVisible ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( e.PropertyName.equals ( "STATUS_UPDATED" ) ) { status.setVisible ( object.isStatusAvailable ( ) ) ; } else if ( e.PropertyName.equals ( "STOP_TIME_UPDATED" ) ) { stopTimePanel.setVisible ( object.isStopTimeVisible ( ) ) ; } }
Source:
protected void OnEntityChanged ( ) { if ( ( getEntity ( ) ) == null ) { return ; } super . OnEntityChanged ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolumeEntity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( getEntity ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity glusterVolumeOption : glusterVolumeEntity.getOptions ( ) ) { list.add ( glusterVolumeOption ) ; } setItems ( list ) ; }

Target:
protected void onEntityChanged ( ) { if ( ( getEntity ( ) ) == null ) { return ; } super . onEntityChanged ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolumeEntity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( getEntity ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity glusterVolumeOption : glusterVolumeEntity.getOptions ( ) ) { list.add ( glusterVolumeOption ) ; } setItems ( list ) ; }
Source:
public void testHostInMaintenance ( ) { hosts.get ( 0 ) . setHighlyAvailableLocalMaintenance ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.Assert.assertEquals ( 5 , result.size ( ) ) ; }

Target:
public void testHostInMaintenance ( ) { hosts.get ( 0 ) . setHighlyAvailableLocalMaintenance ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 5 , result.size ( ) ) ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.nameExternalSubnet ( ) ) ; cidrEditor.setLabel ( constants.cidrExternalSubnet ( ) ) ; ipVersionEditor.setLabel ( constants.ipVersionExternalSubnet ( ) ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.nameExternalSubnet ( ) ) ; cidrEditor.setLabel ( constants.cidrExternalSubnet ( ) ) ; ipVersionEditor.setLabel ( constants.ipVersionExternalSubnet ( ) ) ; gatewayEditor.setLabel ( constants.gatewayExternalSubnet ( ) ) ; }
Source:
private void New ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ( getSystemTreeSelectedItem ( ) ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . addVirtualDiskTitle ( ) ) ; model.setHashName ( "new_virtual_disk" ) ; setWindow ( model ) ; org.ovirt.engine.ui.uicommonweb.UICommand cancelCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) ; cancelCommand.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) ; cancelCommand.setIsCancel ( true ) ; model.setCancelCommand ( cancelCommand ) ; model.Initialize ( ) ; }

Target:
private void New ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewDiskModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.NewDiskModel ( getSystemTreeSelectedItem ( ) ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . addVirtualDiskTitle ( ) ) ; model.setHashName ( "new_virtual_disk" ) ; setWindow ( model ) ; org.ovirt.engine.ui.uicommonweb.UICommand cancelCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) ; cancelCommand.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) ; cancelCommand.setIsCancel ( true ) ; model.setCancelCommand ( cancelCommand ) ; model.Initialize ( ) ; }
Source:
public void testRefreshUserSessionAfterExpiration ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , true ) ; org.junit.Assert.assertNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , false ) ) ; }

Target:
public void testRefreshUserSessionAfterExpiration ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , true ) ; org.junit.jupiter.api.Assertions.assertNull ( container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , false ) , "Get should return null since the session wasn't refresh" ) ; }
Source:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( TimeZoneInfo.Local.getId ( ) ) ; } switch ( vm.getStaticData ( ) . getos ( ) ) { case WindowsXP : case Windows2003 : case Windows2003x64 : timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; break ; case Windows2008 : default : timeZone = vm.getTimeZone ( ) ; break ; } return timeZone ; }

Target:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( TimeZoneInfo.Local.getId ( ) ) ; } switch ( vm.getStaticData ( ) . getOs ( ) ) { case WindowsXP : case Windows2003 : case Windows2003x64 : timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; break ; case Windows2008 : default : timeZone = vm.getTimeZone ( ) ; break ; } return timeZone ; }
Source:
private void proxyUp ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > model ) { if ( ( listModel.getItems ( ) ) == null ) { return ; } java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > list = new java.util.ArrayList ( listModel.getItems ( ) ) ; int selectedItemIndex = list.indexOf ( model ) ; if ( selectedItemIndex > 0 ) { list.remove ( selectedItemIndex ) ; list.add ( ( selectedItemIndex - 1 ) , model ) ; listModel.setItems ( list ) ; listModel.setSelectedItem ( model ) ; } }

Target:
private void proxyDown ( org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel model ) { if ( ( listModel.getItems ( ) ) == null ) { return ; } java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel > list = new java.util.ArrayList ( listModel.getItems ( ) ) ; int selectedItemIndex = list.indexOf ( model ) ; if ( selectedItemIndex < ( list.size ( ) ) ) { list.remove ( selectedItemIndex ) ; list.add ( ( selectedItemIndex + 1 ) , model ) ; listModel.setItems ( list ) ; listModel.setSelectedItem ( model ) ; } }
Source:
private long getImageSizeInBytes ( ) { return ( ( ( long ) ( ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getVmMemSizeMb ( ) ) + 200 ) + ( 64 * ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getNumOfMonitors ( ) ) ) ) ) * 1024 ) * 1024 ; }

Target:
public org.ovirt.engine.core.compat.NGuid getStorageDomainId ( ) { if ( ( _storageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) ) != null ) ) { long sizeNeeded = ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) ) + ( getMetaDataSizeInBytes ( ) ) ) / ( BYTES_IN_GB ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getStoragePoolId ( ) , sizeNeeded ) ; if ( storageDomain != null ) { _storageDomainId = storageDomain.getId ( ) ; } } return _storageDomainId ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( VmOsType.RHEL6 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockVMDAO ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockVMDAO ( vm ) ; return vm ; }
Source:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { try { org.ovirt.engine.core.aaa.SSOOAuthServiceUtils.revoke ( ( ( java.lang.String ) ( request.getSession ( true ) . getAttribute ( WelcomeUtils.TOKEN ) ) ) ) ; javax.servlet.http.HttpSession session = request.getSession ( ) ; if ( session != null ) { session.invalidate ( ) ; } } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.SwitchUserServlet.log.error ( "Unable to logout user: {}" , ex.getMessage ( ) ) ; } request.getRequestDispatcher ( WelcomeUtils.LOGIN_URI ) . forward ( request , response ) ; }

Target:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { try { org.ovirt.engine.core.aaa.SsoOAuthServiceUtils.revoke ( ( ( java.lang.String ) ( request.getSession ( true ) . getAttribute ( WelcomeUtils.TOKEN ) ) ) ) ; javax.servlet.http.HttpSession session = request.getSession ( ) ; if ( session != null ) { session.invalidate ( ) ; } } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.SwitchUserServlet.log.error ( "Unable to logout user: {}" , ex.getMessage ( ) ) ; } request.getRequestDispatcher ( WelcomeUtils.LOGIN_URI ) . forward ( request , response ) ; }
Source:
public static int GetMaximalVmMemSize32OS ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.Integer ) ( returnValue.getReturnValue ( ) ) ) ; } return 262144 ; }

Target:
public static int GetMaximalVmMemSize32OS ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.Integer ) ( returnValue.getReturnValue ( ) ) ) ; } return 262144 ; }
Source:
public static void getStorageDomainList ( 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.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface setUpNicExpectations ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic = control.createMock ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface.class ) ; org.easymock.EasyMock.expect ( nic.getId ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.BackendInstanceTypeNicResourceTest.NIC_ID ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( nic.getType ( ) ) . andReturn ( 0 ) . anyTimes ( ) ; return nic ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface setUpNicExpectations ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface.class ) ; org.mockito.Mockito.when ( nic.getId ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendInstanceTypeNicResourceTest.NIC_ID ) ; org.mockito.Mockito.when ( nic.getType ( ) ) . thenReturn ( 0 ) ; return nic ; }
Source:
public void canDoActionDiskIsOvfStore ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; command.getImage ( ) . setContentType ( DiskContentType.OVF_STORE ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED ) ; }

Target:
public void canDoActionVmInPreview ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( object.isBoot ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.bootableDisk ( ) ) ; } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getDiskVmElements ( ) . size ( ) ) == 1 ) { if ( object.getDiskVmElements ( ) . iterator ( ) . next ( ) . isBoot ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.bootableDisk ( ) ) ; } } return null ; }